Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I just wondered if this could be turned into a one-liner?
open FH,"< $ARGV[0]" or die $!; while (<FH>) { my ($pre, $last) = $_ =~ m/(.*),(\w+)/; $last = substr(("0" x 5) . $last, -1 * 5, 5); print "$pre,$last\n"; } close FH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: one liner?
by BrowserUk (Patriarch) on Aug 03, 2012 at 12:24 UTC | |
by Anonymous Monk on Aug 03, 2012 at 13:00 UTC | |
by BrowserUk (Patriarch) on Aug 03, 2012 at 13:23 UTC | |
by CountZero (Bishop) on Aug 03, 2012 at 13:21 UTC | |
|
Re: one liner?
by jwkrahn (Abbot) on Aug 03, 2012 at 15:15 UTC |