rmck wrote:
But I run this system call and it took allnight to run :(
You were asking perl to rewrite the whole file for every line
you wanted to change.
#!/usr/bin/perl
use strict;
use warnings; # or just use Foo::Monkey :-)
use POSIX qw(strftime);
die "Usage: $0 FILES\n" unless @ARGV;
$^I = '.bak'; # turn on in-place editing with backups
while (<>) { # process one line at a time
s{ ^(\d+) }
{ strftime("%Y-%m-%d %T", localtime($1)) }exg;
print;
}
--
Steve
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>