Advertisement
Guest User

Lol

a guest
Nov 16th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.55 KB | None | 0 0
  1. my $logfilehandle;
  2.  
  3. sub loader {
  4.   ...
  5.   open($logfilehandle,>>feed.html”) or print “error: $!;
  6. }
  7.  
  8. sub observe_nick {
  9.   my ($nick, $host, $chan, $text) = @_;
  10.   print “chanlog [$chan] <$nick> $text\n;
  11.   if ($text =~ /^[W|w]elcome/ && $nick eq “Light”) {
  12.     print “ignoring welcome msg\n;
  13.     return;
  14.   }
  15.  
  16.   # escape html codes
  17.   $text =~ s/</\&lt;/;
  18.   $text =~ s/>/\&gt;/;
  19.    
  20.   print $logfilehandle$nick - $chan - $text<br><br>\n;
  21. }
  22.  
  23. sub unloader {
  24.   ...
  25.   close($logfilehandle) or die $!.\n;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement