in reply to Re^2: Lost Column
in thread Lost Column

Sounds like the offset is beyond the end of the string being substringed. For example:
my $woopsie = substr("Short line.",100);
causes the same error message. Could you show us your revised code?

Replies are listed 'Best First'.
Re^4: Lost Column
by wrml (Novice) on Aug 19, 2005 at 17:42 UTC
    Yeah, here it is.
    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 $_; } }
    These lines are huge. Much larger than 279 characters. by about 7000 characters. I can't figure this one out.
Re^4: Lost Column
by wrml (Novice) on Aug 19, 2005 at 18:45 UTC
    Not a problem. here is 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 $_; } }
    These lines are very long. much longer than 279... I'm really confused.