dump-1.pl

#!/usr/bin/perl # # print header stuff # my $rc=""; my $subname=""; my $printline=""; print "Content-type: text/html", "\n\n"; print "<html>\n"; print "<body>\n"; # # pass 1 get all the file names and subroutine names # $rc=opendir(DIR, "."); while($rc=readdir(DIR)) {  if ($rc =~ /.*\.p[ml]$/i ) {    print "<li><a href=\"#$rc\">$rc</a>\n";    open(CODE,$rc);    while(<CODE>) {     if ($_ =~ /^ *sub / ) {        $subname=$_;        $subname=~s/\n//i;        $subname=~s/\r//i;        $subname=~s/^ *//i;        $subname=~s/sub //i;        $subname=~s/^ *//i;        $subname=~s/ .*//i;        print "<li><a href=\"#$subname.$rc\">$subname $rc</a>\n";     }    }    close(CODE);  } } closedir DIR; # # pass 2 dump out all the files # print "<pre>\n"; print "<tt>\n"; $rc=opendir(DIR, "."); while($rc=readdir(DIR)) {  if ($rc =~ /.*\.p[ml]$/i ) {    #    # print a <p> at the begining of the file    # and print a tag so we can jump to the file    #    print "<a name=\"#$rc\">\n";    print "<h2>$rc</h2>\n";    open(CODE,$rc);    #    # dump the data in the file    #    while(<CODE>) {     if ($_ =~ /^ *sub / ) {        $subname=$_;        $subname=~s/\n//i;        $subname=~s/\r//i;        $subname=~s/^ *//i;        $subname=~s/sub //i;        $subname=~s/^ *//i;        $subname=~s/ .*//i;        print "<a name=\"#$subname.$rc\">\n";     }     #     # clean up the line so it prints nice      #     $printline=$_;     $printline=~s/&/&amp;/g;     $printline=~s/</&lt;/g;     $printline=~s/>/&gt;/g;     $printline=~s/ /&nbsp;/g;     print $printline;    }    close(CODE);  } } closedir DIR; print "</tt>\n"; print "</pre>\n"; exit;
sub foo {  print "sub foo";   return; }

dump.pl

#!/usr/bin/perl # # print header stuff # my $rc=""; my $subname=""; my $printline=""; my @program_list=(); my @sorted_program_list=(); print "Content-type: text/html", "\n\n"; print "<html>\n"; print "<body>\n"; # # pass 1 get all the file names and subroutine names # print "<table border=\"1\">\n"; print "<tr>\n"; print "<td>\n"; print "<ul>\n"; $rc=opendir(DIR, "."); while($rc=readdir(DIR)) {  if ($rc =~ /.*\.p[ml]$/i ) {    print "<li><a href=\"#$rc\">$rc</a>\n";    push(@program_list, "<li><a href=\"#$rc\">$rc</a>\n");    open(CODE,$rc);    while(<CODE>) {     if ($_ =~ /^ *sub / ) {        $subname=$_;        $subname=~s/\n//i;        $subname=~s/\r//i;        $subname=~s/^ *//i;        $subname=~s/sub //i;        $subname=~s/^ *//i;        $subname=~s/ .*//i;        print "<li>&nbsp;&nbsp;<a href=\"#$subname.$rc\">$subname</a>\n";        push(@program_list, "<li><a href=\"#$subname.$rc\">$subname IN $rc</a>\n");     }    }    close(CODE);  } } closedir DIR; print "</ul>\n"; print "</td>\n"; # # sort the list of files and subroutines or functions # @sorted_program_list=sort(@program_list); print "<td>\n"; print "<ul>\n"; foreach (@sorted_program_list) {  print $_; } print "</ul>\n"; print "</td>\n"; print "</tr>\n"; print "</table>\n"; # # pass 2 dump out all the files # print "<pre>\n"; print "<tt>\n"; $rc=opendir(DIR, "."); while($rc=readdir(DIR)) {  if ($rc =~ /.*\.p[ml]$/i ) {    #    # print a <p> at the begining of the file    # and print a tag so we can jump to the file    #    print "<a name=\"#$rc\">\n";    print "<h2>$rc</h2>\n";    open(CODE,$rc);    #    # dump the data in the file    #    while(<CODE>) {     if ($_ =~ /^ *sub / ) {        $subname=$_;        $subname=~s/\n//i;        $subname=~s/\r//i;        $subname=~s/^ *//i;        $subname=~s/sub //i;        $subname=~s/^ *//i;        $subname=~s/ .*//i;        print "<a name=\"#$subname.$rc\">\n";     }     #     # clean up the line so it prints nice      #     $printline=$_;     $printline=~s/&/&amp;/g;     $printline=~s/</&lt;/g;     $printline=~s/>/&gt;/g;     $printline=~s/ /&nbsp;/g;     print $printline;    }    close(CODE);  } } closedir DIR; print "</tt>\n"; print "</pre>\n"; exit;
sub foo {  print "sub foo";   return; }

mod.pl

#!/usr/bin/perl # # print header stuff # $mydebugflag=1; $mydebugflag=0; print "Content-type: text/html", "\n\n"; print "<html>\n"; print "<body background=\"nevada.gif\">\n"; #foreach $key (keys(%ENV)) { # if ( $key eq "REMOTE_ADDR" ) { #  print "KEY=$key<p>"; #  print "\$ENV{KEY}=$ENV{$key}<p>"; #  $my_ip_address=$ENV{'REMOTE_ADDR'}; # } # print "$my_ip_address \$ENV{$key}=\"$ENV{$key}\"<br>\n"; #} $my_ip_address=$ENV{'REMOTE_ADDR'}; #print "$my_ip_address<p>"; @weekarry=("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"); # #define stuff to grab data entered on form # require TripodCGI; use CGI; $cgi = new CGI; # # on june 28, 2006 I discovered that this program stopped working # i suspect TRIPOD changed something in its include files. # i changed the data from POST to GET and that appears to have fixed # the problem.  # buttttt it is better to process the data as POST cuz you can process # more data so i should change it back to post when i can # # # i may want to process the data myself that way i dont have  # to rely on their stinking functions. I guess i do it this way # if ($mydebugflag){  if ($ENV{'REQUEST_METHOD'} eq "GET") {   print "data is via GET<p>\n";   $in = $ENV{'QUERY_STRING'};   }   else {   print "data is via POST<p>\n";   #$in = <STDIN>;   while(<STDIN>) {   #$in .= $_;   print $_;   }   }   print "data=<table border=1><tr><td>$in<\/td><\/tr><\/table>\n"; } # # get the data they entered in the text bos # if ($mydebugflag){print "included headers and shit\n<p>";} $errors=0; $formtext=$cgi->param('text'); $formfile=$cgi->param('file'); $ub=$cgi->param('ub'); $rb=$cgi->param('rb'); $lb=$cgi->param('lb'); $ib=$cgi->param('ib'); $db=$cgi->param('db'); $wb=$cgi->param('wb'); $cw=$cgi->param('cw'); $ss=$cgi->param('ss'); $ii=$cgi->param('ii'); $mymy=$cgi->param('mymy'); if ($mydebugflag){print "buttoms selected<table border=1><tr><td>$ub$rb$lb$ib$db$wb$cw$ss$ii$mymy<\/td><\/tr><\/table>";} if ($mydebugflag){print "text entered<table border=1><tr><td> $formtext $formfile <\/td><\/tr><\/table>";} # # they must click on ONE or more of the boxes to  # indicate what type of news article this is. # if they dont click on a box dont let them add # the news article # if ($mydebugflag){print "checking for checked box\n<p>";} if ($mydebugflag){print "errors=$errors\n<p>";} if ( $ub eq '' && $rb eq '' && $lb eq '' && $ib eq '' && $db eq '' &&       $wb eq '' && $cw eq '' && $ss eq '' && $ii eq '' && $mymy eq '' ) {     $errors++; } if ($mydebugflag){print "errors=$errors\n<p>";} # #they must also enter some NON-BLANK TEXT #if they dont dont let them continue if ($formtext =~ /^[ \n\r]*$/ ) {   $errors++; } if ($mydebugflag){print "errors=$errors\n<p>";} #if ($errors > 0 ) { if ($errors == 1 ) {   if ($formtext =~ /^[ \n\r]*$/ ) {     print "ERROR!!!! You MUST enter a News Article you idiot<p>";   }   if ( $ub eq '' && $rb eq '' && $lb eq '' && $ib eq '' && $db eq '' &&         $wb eq '' && $cw eq '' && $ss eq '' && $ii eq '' && $mymy eq '' ) {       print "ERROR!!!! You must check one of the boxes idiot<p>";   }   print "ERROR!!!! IDIOT!!!!<p>";   exit; } $zdate=time(); if ($errors == 0 ) {   open(ALL,">>mod.txt");   #   # (we still have to get the header data)   # print the header data   #   #print ALL "AA <a name=\"$zdate\">\n";   print ALL "HH header";   if ($ub eq 'on') {print ALL " UB";}   if ($rb eq 'on') {print ALL " RB";}   if ($lb eq 'on') {print ALL " LB";}   if ($ib eq 'on') {print ALL " IB";}   if ($db eq 'on') {print ALL " DB";}   if ($wb eq 'on') {print ALL " WB";}   if ($cw eq 'on') {print ALL " CW";}   if ($ss eq 'on') {print ALL " SS";}   if ($ii eq 'on') {print ALL " II";}   if ($mymy eq 'on') {print ALL " MY";}   print ALL "\n";   #   # get and print each line   #   @x=split("\n",$formtext);   for ($i=0;$i<=$#x;$i++) {    $thisline=$x[$i];    $bw=print ALL "DD $thisline\n";    #    # if $bw is != 1 the the write probably failed!!!!!    if ($bw != 1 ) {      print "error???????<br>";      print "\$bw=$bw!!! does this mean the write to ALL failed???<br>";    }   }   close(ALL); } else {   print "<h1>NOTHING SAVED TO DISK<\/h1>\n"; } print "1) Ener Your News Article<br>"; print "2) Click Where you wish to save your news article"; # # # on june 28, 2006 I discovered that this program stopped working # i suspect TRIPOD changed something in its include files. # i changed the data from POST to GET and that appears to have fixed # the problem.  # but you can grab more data when you do it as post so i should # change it back # # print "<form action=\"mod.pl\" method=\"post\">"; #print "<form action=\"mod.pl\" >"; print "<input type=\"submit\" name=submit value=\"SUBMIT\">"; print "<table border=1>"; print "<tr>"; &start($ib,'ib','ib','1'); &start($ub,'ub','useless','2'); &start($rb,'rb','god','3'); &start($lb,'lb','putz','4'); &start($db,'db','libdis','5'); &start($wb,'wb','war','6'); &start($cw,'cw','cop','7'); &start($ss,'ss','secret service','8'); &start($mymy,'mymy','messy yards','9'); &start($ii,'ii','no stinking ID','10'); print "</tr>"; print "</table>"; #print "<select name=\"file\">"; #print "<option value=\"NEW\" $xnew >New News Articles"; #print "<option value=\"ALL\" $xall >ALL"; #print "<option value=\"WAR\" $xwar >Anti-War"; #print "<option value=\"LIB\" $xlib >Libertarian"; #print "<option value=\"ATH\" $xath >Atheist & Religion"; #print "<option value=\"GOV\" $xgov >Government Idiots & Rulers"; #print "<option value=\"SCI\" $xsci >Science"; #print "<option value=\"USE\" $xuse >Useless Information"; #print "<option value=\"SEX\" $xsex >Sylvia"; #print "<option value=\"NEW\" $xnew >New News Articles"; #print "<option value=\"EATH\" $mxath >Atheist E-Mail"; #print "<option value=\"ELIB\" $mxlib >Libertarian E-Mail"; #print "<option value=\"EGUN\" $mxgun >Gun E-Mail"; #print "<option value=\"ELS\" $mxls >List Servers E-Mail"; #print "<option value=\"ECOP\" $mxcop >COPWATCHERS E-Mail"; #print "<option value=\"EMEDIA\" $mxmed >MEDIA Contact E-Mail"; #print "</select>"; print "<br>"; print "<textarea name=\"text\" cols=\"50\" rows=\"20\">"; print "</textarea>"; print "<hr>"; print "<input type=\"reset\" name=reset value=\"CLEAR MENU\">"; print "<input type=\"hidden\" name=\"formname\" value=\"resume.form\">"; print "<input type=\"hidden\" name=\"title\" value=\"E-mail Resume\">"; print "<input type=\"hidden\" name=\"bcc\" value=\"\">"; print "<input type=\"hidden\" name=\"debugflag\" value=\"\">"; print "</form>"; print "NEWSPAPERS"; print "<ul>"; print "<li>Daily"; print "   <ul>"; print "<li><a href=\"http://www.azcentral.com\">http://www.azcentral.com</a>"; print "<li><a href=\"http://www.arizonarepublic.com\">http://www.arizonarepublic.com</a>"; print "<li><a href=\"http://www.arizonatribune.com\">http://www.arizonatribune.com</a>"; print "<li><a href=\"http://www.azstarnet.com\">http://www.azstarnet.com</a>"; print "<li><a href=\"http://www.tucsoncitizen.com\">http://www.tucsoncitizen.com</a>"; print "   </ul>"; print "<li>Weekly"; print "   <ul>"; print "<li><a href=\"http://www.phoenixnewtimes.com\">http://www.phoenixnewtimes.com</a>"; print "<li><a href=\"http://www.phoenixnewtimes.com\">http://www.phoenixnewtimes.com</a>"; print "<li><a href=\"http://www.tucsonweekly.com\">Tucson Weekly</a>"; print "   </ul>"; print "<li>POLITICAL Party Newspapers"; print "   <ul>"; print "<li><a href=\"http://www.pww.org\">http://www.pww.org</a> Communist Party"; print "   </ul>"; print "<li>COLLEGE Newspapers"; print "   <ul>"; print "<li><a href=\"http://www.statepress.com\">http://www.statepress.com</a> ASU"; print "<li><a href=\"http://www.mc.maricopa.edu/legend\">http://www.mc.maricopa.edu/legend MCC</a>"; print "<li><a href=\"http://wildcat.arizona.edu\">http://wildcat.arizona.edu</a> U of A"; print "   </ul>"; print "<li>SPANISH WEEKLYS"; print "   <ul>"; print '<li><a href="http://www.lavozinternet.com">http://www.lavozinternet.com</a> La Voz'; print '<li><a href="http://www.azcentral.com/lavoz">http://www.azcentral.com/lavoz</a> La Voz'; print '<li><a href="http://www.prensahispanaaz.com">http://www.prensahispanaaz.com</a> La Prensa'; print "   </ul>"; print "<li>FAKE News (Humor)"; print "   <ul>"; print '<li><a href="http://www.theonion.com">The Onion</a>'; print "   </ul>"; print "</ul>"; print "<p>Details and information"; print "<blockquote>"; print '<a name="1">1) Criminal acts and stupid stuff done by the Government<br>'; print '<a name="2">2) Useless Information<br>'; print '<a name="3">3) Stupid stuff done by people for God and in the name of religion<br>'; print '<a name="4">4) Stupid stuff done by those idiots Paul Putz and Linda Chapman<br>'; print '<a name="5">5) Libertarian Discussions and stuff from the Libertarian listservers<br>'; print '<a name="6">6) Stuff about the current war or current country the US government is invading in the name of freedom<br>'; print '<a name="7">7) Stuff to post on the C*pW*tch web site<br>'; print '<a name="8">8) Criminal acts committed by the Secret Service in the name of protecting the American Emperor<br>'; print '<a name="9">9) Crimes committed and homes seized by the messy yard cops from people who didn\'t mow their lawns or paint their coolers<br>'; print '<a name="10">10) No Stinking Id!!! Articles about how American is becoming a police state where you need ID to go to the bathroom<br>'; print "</blockquote>"; for ($i=0;$i<50;$i++){print '<p><br>';} exit; &display_form(); print "</html>\n"; exit;
sub display_form {  print "<p><a name=\"#top\">\n";  print "$title\n";  &print_z_date;  #print "<a href=\"#help\">Help on how this Web page works</a><p>";  print "<p>";  print "<form action=\"silver_resume_bccmail_felt.pl\">\n";  #in form allow them to enter userid and password  print "Userid: <input type=\"text\" size=\"60\" name=\"userid\" value=\"$userid\"><br>\n";  print "Password: <input type=\"password\" size=\"60\" name=\"password\" value=\"$password\"><br>\n";  print "Password2: <input type=\"password\" size=\"60\" name=\"checksum\" value=\"$checksum\"><br>\n";  &dump_files;  #print "From: <input type=\"text\" size=\"60\" name=\"frommail\" value=\"$frommail\"><br>\n";  #print "Reply-To: <input type=\"text\" size=\"60\" name=\"replyto\" value=\"$replyto\">\n";  print "<br>\n";  print "Subject: <input type=\"text\" size=\"60\" name=\"subject\" value=\"$subject\">\n";  print "<p>\n";  print "<input type=\"submit\" name=submit value=\"SUBMIT\"> \n";  print "<p>\n";  #print "<textarea name=\"text\" cols=\"79\" rows=\"300\">\n";  #print "$text";  #print "</textarea>";  print "<hr>\n";  print "<p>\n";  print "<input type=\"reset\" name=reset value=\"CLEAR MENU\">\n";  print "<input type=\"hidden\" name=\"formname\" value=\"$formname\">\n";  print "<input type=\"hidden\" name=\"title\" value=\"$title\">\n";  print "<input type=\"hidden\" name=\"debugflag\" value=\"$debugflag\">\n";  print "</form>\n";  print "<p><a href=\"coronado.html\">help</a>\n";  #print "<a name=\"help\">How to enter E-Mail address's and Peoples names<p>";  #print "<p><a href=\"#top\">Jump to top of Page</a><p>";  #print "<ol>";  #print "<li>The From: e-mail address is required.";  #print "<li>The e-mail will appear to be sent from the From: e-mail address.";  #print "<li>Normally when a person replys to an e-mail the reply will be sent";  #print " to the From: e-mail address. Thats unless a Reply-To: address is entered.";  #print "<li>The Reply-To: e-mail address is not required.";  #print "<li>If a Reply-To: e-mail address is given when a ";  #print " person replys to the e-mail the reply will be sent to ";  #print " the Reply-To: address instead of the From: address. ";  #print " However not all e-mail software works this way. ";  #print "<li>For both the From: and Reply-To: e-mail address you ";  #print " may enter an email address that looks like this: ";  #print " <blockquote> ";  #print " lousy_aim\@aol.com ";  #print " </blockquote> ";  #print " <p> ";  #print "<li>For both the From: and Reply-To: e-mail address you ";  #print " may follow the email address with a human name thats ";  #print " enclosed in (\"  \") like this: ";  #print " <blockquote> ";  #print " lousy_aim\@aol.com (\"Larry Naman\")";  #print " </blockquote> ";  #print " <p> ";  #print "<li>The Subject: is required! ";  #print "I'm not going to let you piss off";  #print " people by sending an e-mail with out a subject. ";  #print "</ol>";  #print "<p>At the top of the page will be the title:<p> ";  #print " <blockquote> ";  #print "File to send Press Releases to<p>";  #print " </blockquote> ";  #print "followed by one or file names each which has a radio button.";  #print "<a href=\"#stinking_file_list\"> Click here to jump to the list</a><p>";  #print "The web site times out if it sends out more then 200 e-mails at a time.<p>";  #print "To get around that problem all the e-mail addresses are split";  #print " into files of of 200 or less e-mail addresses.<p>";  #print "To send an e-mail to all of the addresses<p>";  #print "<ol>";  #print "<li>Click on the radio button of the first file ";  #print "<li>Click on SUBMIT button to send the e-mail to the address in the first file ";  #print "<li>Click on the radio button of the next file and repeat the ";  #print " 1st 2 steps until you have sent e-mails to all files in the list ";  #print "</ol>";  #print "<p><a href=\"#top\">Jump to top of Page</a><p>";  print "</html>";  return; }  sub dump_files {  print "<a name=\"stinking_file_list\">\n";  #$mask="m/^".$file_prefix."\\.[0-9]+\\.email\$/";  $mask=$file_prefix."\\.[0-9]+.*\\.email";  print "<ul>\n";  opendir(DIR,".");  $nf=0;  $checked=' checked ';  while ($the_file_name=readdir(DIR)) {    #if ($the_file_name =~ /^aitp\.[0-9]+\.email$/ ) {    if ($the_file_name =~ $mask ) {       print "<li>$the_file_name <input type=\"radio\" name=\"thefile\" value=\"$the_file_name\" $checked>\n";       $nf++;       $checked='';    }  }  if ($nf == 0 ) {     print "<p>Somethings screwed up!!!!!!!!!!<br>\n";     print "ERROR!! No files exist that match '$file_prefix'<br>\n";     print "ERROR!! Tell mike mask is '$mask'<p>\n";  }  closedir(DIR);  print "</ul>\n";  return; } sub print_z_date {  @snot=localtime();  $zstinkingdate=$snot[3];  $zstinkingmonth=$snot[4]+1;  $mud='';  $zstinkingyear=$snot[5]-100;  $zstinkingseconds=time;  $zstinkingseconds/=3600;  $zstinkingseconds=int($zstinkingseconds);  if ( $zstinkingyear < 10 ) {  $mud='0';  }  print "$zstinkingmonth/$zstinkingdate/$mud$zstinkingyear";  print " $zstinkingseconds";  #print " $snot[0],0 ";  #print "$snot[1],1 ";  #print "$snot[2],2 ";  #print "$snot[3],3 ";  #print "$snot[4],4 ";  #print "$snot[5],5 ";  #print "$snot[6],6 ";  #print "$snot[7],7 ";  return; } sub start {  print "<td";  if ($_[0] eq 'on' ) {     print " style=\"background-color: rgb(255,255,0)\"";  }  print ">";  print "$_[2]<sup><a href=#$_[3]>$_[3]</a></sup>";  print "<br><input type=checkbox name=";  print "$_[1]";  print "></td>\n";  return; } sub sub { } sub frog { }