Bob Showalter <[EMAIL PROTECTED]> writes: [...]
>> cat test.pl
>> #!/usr/local/bin/perl -w
>>
>> $regex = shift;
>> while(<>){
>> $cnt++;
>> if($cnt == 1){
>> print "$ARGV\n";
>> }
>> if(/$regex/){
>> printf "%-3d %s", $cnt, $_;
>> }elsif(/^$/){
>> $cnt = 0;
>
> add 'close ARGV;' right here.
>
>> next;
>> }
>> }
Yup, that did it and its majorly faster than using the two while
loops as suggested.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
