On Sep 10, Jeff 'japhy/Marillion' Pinyan said:
>On Sep 10, Jorge Goncalvez said:
>
>> if(defined $lastline and $lastline =~ /$success/)
>>
>>The if statement is always verified even the last line don't end with success.
>
>You put the '$' in the wrong place.
>
> /success$/
And while I'm all for using modules, something like that could probably be
done with:
open FILE, $filename or die "can't read $filename: $!";
seek FILE, 10, 2; # 10 bytes from the end
read FILE, $buf, 10; # read those 10 bytes
close FILE;
if ($buf =~ /success$/) { ... }
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]