airblaine has asked for the wisdom of the Perl Monks concerning the following question:
I know there is something lame that I'm not doing right but the perl basics on how to handle something so simple is bypassing my little brain....Thanks for any help!#!/usr/bin/perl -w print "File name to renumber:"; my $file = <STDIN>; open (FILE, "$file") || die $!; $|++; my $line = 0; while (<FILE>) { next if /^%/ ; s/^(?:N\d+\s?)?(?{$line++})/N$line / ; } continue { print FILE; close FILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Handle Basics
by fglock (Vicar) on Sep 03, 2002 at 23:20 UTC | |
by Arien (Pilgrim) on Sep 04, 2002 at 00:17 UTC | |
|
Re: File Handle Basics
by sauoq (Abbot) on Sep 04, 2002 at 00:54 UTC | |
|
Re: File Handle Basics
by blaze (Friar) on Sep 04, 2002 at 00:22 UTC |