Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
this produces something like '2, 6, 5, 6'#!perl -w # use strict; # Typical line '101|14.95|Short Description|Long Description' open (FH, 'c:/items.pl') or die "Couldn't open file, $!"; while (<FH>){ my ($item_number,$price,$short_desc,$long_desc) = split (/|/); print "$item_number, $short_desc, $price, $long_desc\n"; };
No need to warn me about race conditions, this is to be a simple utility used only by myself.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: scalar values from split
by grinder (Bishop) on Jan 14, 2002 at 02:40 UTC | |
|
Re: scalar values from split
by gav^ (Curate) on Jan 14, 2002 at 02:40 UTC | |
|
Re: scalar values from split
by Juerd (Abbot) on Jan 14, 2002 at 02:58 UTC | |
|
Re: scalar values from split
by Anonymous Monk on Jan 14, 2002 at 03:07 UTC | |
by crazyinsomniac (Prior) on Jan 14, 2002 at 13:26 UTC |