in reply to regexp's
-------------------update-------------- as per merlyn's advice: (godz it's hard not to try to make spaceballs jokes...)@ARGV = filename.txt; while(<>) { /^(\d)\s+time\s+\d{2}\:\d{2}\:\d{2}\s+(\d+)/; $hash{$1} = $2; }
or didn't i read something about this possibly being acceptable:while(<>) { if(/^(\d)\s+time\s+\d{2}\:\d{2}\:\d{2}\s+(\d+)/) { $hash{$1} = $2; } }
since the enclosing {} puts it in a seperate block? i fully expect to be waaaay off on this.while(<>) { { /^(\d)\s+time\s+\d{2}\:\d{2}\:\d{2}\s+(\d+)/; $hash{$1} = $2; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: regexp's
by merlyn (Sage) on Oct 03, 2000 at 18:14 UTC |