bugzilla.pl

    1 | #!/usr/bin/perl
    2 | my $File = "bugzilla-buglist";
    3 | my ($Bugs,$BugsDisplay);
    4 | if (length($ENV{'QUERY_STRING'})==0) {
    5 |   open  (READ,"<$File") || print "Cannot read: $!";
    6 |   $Bugs = <READ>;
    7 |   close READ;
    8 |   chomp $Bugs;
    9 |   $BugsDisplay = $Bugs;
   10 |   $BugsDisplay =~ s/,/\n/g;
   11 | } else {
   12 |   $Bugs = $ENV{'QUERY_STRING'};
   13 |   $Bugs =~ s/Bugs=//;
   14 |   $Bugs =~ tr/+/ /;
   15 |   $Bugs =~ s/(?:%0[adAD])+/\n/g;
   16 |   $Bugs =~ s/^\s+//s;
   17 |   $Bugs =~ s/\s+$//s;
   18 |   $BugsDisplay = $Bugs;
   19 |   $Bugs =~ s/\n/,/g;
   20 | }
   21 | 
   22 | print <<PAGE;
   23 | Expires: now
   24 | Content-Type: text/html; charset=iso-8859-1
   25 | 
   26 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
   27 | <html>
   28 | <head>
   29 |   <title>My Bugzilla-Bugs</title>
   30 | </head>
   31 | <body>
   32 | <h1>My Bugzilla-Bugs</h1>
   33 | 
   34 | <form method=get action="bugzilla.pl">
   35 | <p><textarea name=Bugs rows=10 cols=20>$BugsDisplay</textarea></p>
   36 | <p><input type=submit value="Save"></p>
   37 | </form>
   38 | 
   39 | <p><a href="http://bugzilla.mozilla.org/buglist.cgi?order=bugs.product%2C%20bugs.bug_severity%2C%20bugs.bug_id&amp;bug_id=$Bugs">Bugs from the list</a></p>
   40 | </body></html>
   41 | PAGE
   42 | 
   43 | exit if (length($ENV{'QUERY_STRING'})==0);
   44 | open  (SAVE,">$File") || print "Cannot save: $!";
   45 | print (SAVE "$Bugs");
   46 | close (SAVE);

Valid CSS!Valid HTML 4.01!
© Boris 'pi' Piwinger, April 7, 2002