
David4
Deleted
Mar 13, 2000, 9:27 PM
Post #1 of 4
(1464 views)
|
I'm trying to convert a list to an array: fruitfile2.txt: big red apples large juicy oranges small firm peaches to: @fruits = ('big red apples', 'large juicy oranges', 'small firm peaches') Here's the program I used: $tall = "fruitfile2.txt"; open(INFILE, $tall) or die "Couldn't open the ". "fruitfile2.txt file for writing.\n"; while(<INFILE> ){ $Theline = $_; @fruits = split(/^/m, $Theline); print @fruits[0]; } close(INFILE); Can you tell me where's the problem? The books I have are not doing much good. Thank you!
|