develooper Front page | perl.beginners | Postings from February 2002

Text Files...

Thread Next
From:
Deniz Hepşen
Date:
February 13, 2002 16:24
Subject:
Text Files...
Message ID:
00c301c1b541$d9fca740$0200a8c0@ttnet.net.tr
Hi,
I want to do a parse fonction which reads prices.txt. My prices.txt file is like                 

20::30::1
3::2::7

When i want to see for example "2",   i want to type  "    print "$x[1][1]";    "
Why this function below is false?

thanx


sub parse {

        open (PRICES , "<prices.txt");
        @bilgi=<PRICES>;
        close(PRICES);


        for ($i=0;$i<=$#bilgi;$i++)
        {
         @column=split(/::/, $bilgi[$i]);
         $line=\@column;
         @x=(@x, $line);

        }

}

&parse;


 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About