for my $recNo ( 0 .. $#array ) { next unless $array[$recNo] =~ m{PERL}; my $changeCt = $array[$recNo] =~ s{PERL}{Perl}g; if ( $changeCt ) { print qq{$changeCt changes in record $recNo\n}; } else { warn qq{Failed to change record $recNo\n}; } }
I hope this is of use.
Cheers,
JohnGG
In reply to Re: tie:file get record number
by johngg
in thread tie:file get record number
by smbs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |