Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
after the inital key, there is a tab, followed by multiple descriptions...lengths and number of them vary again separated by tabs. However I only want to split them once into $id and $descriptions. So far I know I needData_Type:1234567890 data data data data data Data_Type:1237834810 data data data data data
I hope you can help guys, I'm new at programming, so far I'm doing ok, but this has stumped me. Thanks in advanceopen(IN,'file.txt'); while($line = <IN>) { chomp $line; ($id, $description)### regex expression to split it push(%hash{$id, $descriptions)### then a push? }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash from a file
by ikegami (Patriarch) on Oct 04, 2007 at 15:23 UTC | |
by naikonta (Curate) on Oct 04, 2007 at 15:45 UTC | |
|
Re: Hash from a file
by toolic (Bishop) on Oct 04, 2007 at 15:32 UTC | |
by Anonymous Monk on Oct 04, 2007 at 15:43 UTC | |
by naikonta (Curate) on Oct 04, 2007 at 15:56 UTC | |
|
Re: Hash from a file
by mwah (Hermit) on Oct 04, 2007 at 16:06 UTC |