in reply to passing a variable from a link

Use the CGI module
Use the CGI module. The problem that you have here is that you have to interface with the URL that's being passed to the script. One way to do that with CGI is
#!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; $pet = $q->param{ "animal" }; # Instead of # print "Content-type: text/html\n\n"; # use... print $q->header( "text/html" ); print <<STUFF; <html> <head></head> <body> <center> <form><input type="text" value="$pet" size="25"></form> </body> </html> STUFF
The code $q->param{ "animal" }; finds the part of the URL passed to the script that contains the value of the form element "animal".
It's suggested that you use strict and the -T switch to check for tainted variables perlsec.
Run a Super Search for plenty of CGI info or check out the O'Reilly book CGI Programming with Perl
Rich36
There's more than one way to screw it up...

Updated with $q->header( "text/html: ); - thanks jeffa