wrml has asked for the wisdom of the Perl Monks concerning the following question:
substr outside of string at ReturnA/ReturnAReplacer.pl line 90, <IN> l +ine 8453.
the thing is, I don't care. I realize the last one is always too short, but I want it to go on and deal with the next file anyway. I can't tell it to just ignor the 8574th line because in the next file it might be the 19756th line and so one... forty some-odd files, each with a different number of lines.
Here's the code:
foreach $file (@infile){ open(IN, '<', "$file") or warn $! and next; open(OUT, '>', $outpath.basename($file)) or warn $! and next; while (<IN>) { substr($_,279) =~ s/$regex/$substitute{$1}/g; print OUT $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substring too short and I don't care
by ikegami (Patriarch) on Aug 19, 2005 at 20:03 UTC | |
|
Re: substring too short and I don't care
by Fletch (Bishop) on Aug 19, 2005 at 20:05 UTC | |
|
Re: substring too short and I don't care
by Transient (Hermit) on Aug 19, 2005 at 20:03 UTC | |
by Anonymous Monk on Aug 19, 2005 at 23:28 UTC | |
by Transient (Hermit) on Aug 20, 2005 at 03:43 UTC |