diff options
author | lookshe <mail@lookshe.org> | 2012-01-11 09:15:06 +0100 |
---|---|---|
committer | lookshe <mail@lookshe.org> | 2012-01-11 09:15:06 +0100 |
commit | d45663caaad3fb3f266f064b9c70955bf7d985c9 (patch) | |
tree | da89ba9fd571f346955c26b537bc0b10060cdc9e /lastspoke.pl | |
parent | 38252cc5541729f4e3b03bcebf36ca8e6beafa7b (diff) |
masked special characters only for searchstring and not for outputs
Diffstat (limited to 'lastspoke.pl')
-rw-r--r-- | lastspoke.pl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lastspoke.pl b/lastspoke.pl index 09d9104..1c3ea27 100644 --- a/lastspoke.pl +++ b/lastspoke.pl @@ -10,9 +10,10 @@ if ($#ARGV ne 2){ my $folder=$ARGV[0]; my $chan=$ARGV[1]; my $nick=$ARGV[2]; -$nick=~s/\\/\\\\/g; -$nick=~s/\|/\\\|/g; -$nick=~s/\^/\\\^/g; +my $snick=$nick; +$snick=~s/\\/\\\\/g; +$snick=~s/\|/\\\|/g; +$snick=~s/\^/\\\^/g; my @files; @@ -32,7 +33,7 @@ my $log = File::ReadBackwards->new($file) || die $!; while ($line=$log->readline()){ # $line=$log->readline(); if ($date eq 0){ - if ($line =~ m/^\[[0-9]{2}:[0-9]{2}(:[0-9]{2})?\] <$nick> /i && $line !~ m/joined #/ ) { + if ($line =~ m/^\[[0-9]{2}:[0-9]{2}(:[0-9]{2})?\] <$snick> /i && $line !~ m/joined #/ ) { $date=1; ($lastaction=$line)=~s/\n//; } elsif ($line =~ m/^\[00:00(:00)?\] --- /) { |