in reply to RE: RE: Re: Making an array out of each line of a text file
in thread Making an array out of each line of a text file
Here are the errors#!/usr/local/bin/perl open (DATA,"<data.txt") || die "Can't open $DATA $!"; while (<DATA>) { chomp; @line = split(/,/); $key = shift @line; push @{$data{$key}}, \@line; } print $data{"Andrea"}[0][1], " should be good\n"; # offsets off by one + print $data{"Dave"}[0][1], " should be better\n"; print $data{"Joe"}[0][1], " should be 0\n";
sorry if i was confusing.syntax error in file data.pl at line 10, next 2 tokens "@$data" Spurious backslash ignored at data.pl line 10. syntax error in file data_824.pl at line 14, next 2 tokens "}[" syntax error in file data.pl at line 15, next 2 tokens "}[" Execution of data.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: RE: Re: Making an array out of each line of a text file
by tye (Sage) on Aug 25, 2000 at 21:55 UTC |