No... its not on a single variable... i am opening the file and reading it line by line...
Try:
my $last_line = undef;
while( <$fh> ){
$last_line = $_;
# process file contents, if needed
}
if( defined $last_line ){
$last_line =~ m/$pat\z/;
}else{
warn "file is empty\n";
}
In reply to Re^3: Matching Regular expression at EOF
by shawnhcorey
in thread Matching Regular expression at EOF
by krish28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |