Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Burak Grsoy

By: a guest on Jul 20th, 2009  |  syntax: Perl  |  size: 0.68 KB  |  views: 49  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. use strict;
  2. use warnings;
  3. use CGI ();
  4. use URI ();
  5.  
  6. my $subject = subject() || '';
  7.  
  8. print "Subject: $subject\n";
  9.  
  10. sub subject {
  11.     my $cgi         = CGI->new;
  12.     my $referrerUrl = $cgi->param('referrerUrl');
  13.     my $uri         = URI->new($referrerUrl);
  14.     my $path        = $uri->path;
  15.     my %param       = $uri->query_form;
  16.     my $value       = $param{q} || return;
  17.  
  18.     return $value =~ /log/          ? 'logging'
  19.          : $value =~ /mailq/        ? 'mailq'
  20.          : $value =~ /loops.+?back/ ? 'loopsback'
  21.          : $value =~ /port/         ? 'changeport'
  22.          : $value =~ /white.+?list/ ? 'whitelist'
  23.          :                            ''
  24.          ;
  25. }