damian1301 has asked for the wisdom of the Perl Monks concerning the following question:
</SCRIPT1> <SCRIPT2>#!/usr/bin/perl -w use CGI qw(param standard); use strict; my $query = new CGI; my $referrer = $query->param("ref"); my $location = $query->param("place"); if ($referrer){ $referrer =~ tr/A-Z/a-z/; open(REF, ">>referrer.txt") or default('Cant open/write, $!'); print REF "$referrer\n"; close(REF); }elsif ($ENV{'HTTP_REFERER'}) { open(REF1, ">>referrer.txt") or default('Cant open/write, $!'); print REF1 "$ENV{'HTTP_REFERER'}\n"; close(REF1); } if ($location eq ""){ &main }elsif ($location eq lc("misc")){ &misc }elsif ($location eq lc("links")){ &links }else{ default('Where are you trying to go?'); } sub links{ print "links\n"; } sub misc{ print "misc\n"; } sub default{ print "Theres an error: @_"; } sub main{ print "this is sub main!"; }
#!/usr/bin/perl use CGI qw(param); my $query = new CGI; if ($query->param("text1")){ my $one = $query->param("text1"); my $two = $query->param("text2"); my $three = $query->param("text3"); my $four = $query->param("text4"); my $five = $query->param("text5"); my @texts; ($one,$two,$three,$four,$five) = @text; foreach (sort @text){ print "$_ \n\n"; } }else{ print qq~ <HTml><head><title>Alphabetical Sorter</title></head> <body><h2 align="center">Alphabetical Sorter.</h2> <form method="post"> <input type="text" name="text1"><Br> <input type="text" name="text2"><Br> <input type="text" name="text3"><Br> <input type="text" name="text4"><Br> <input type="text" name="text5"><Br> <input type="submit" value="submit form"> </form> ~; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Problems with scripts
by Ovid (Cardinal) on Nov 27, 2000 at 02:42 UTC | |
|
Re: Problems with scripts
by arturo (Vicar) on Nov 27, 2000 at 02:47 UTC | |
|
Re: Problems with scripts
by Fastolfe (Vicar) on Nov 27, 2000 at 02:41 UTC | |
|
Re: Problems with scripts
by quidity (Pilgrim) on Nov 27, 2000 at 03:11 UTC | |
by arturo (Vicar) on Nov 27, 2000 at 03:21 UTC |