Date: 19 Sep 2001 22:45:57 GMT From: damian@qimr.edu.au (Damian James) Subject: Re: returnvalues in perl Message-Id: On 19 Sep 2001 10:37:55 -0700, Markus said: >hi, >i'm new in programming perl, my problem is that I use http_get to a >perlscript and this script should not gernerate html-code it should >only return one value, >has anybody got a code-snippet or an example how this script could >look like?? Um, is there any particular value you want it to return? And what exactly do you mean by 'return' if it is not generating valid html, and you are running in a CGI environment as the above suggests? I would suggest that you first have a look at the documentation for the CGI module, which comes as standard with any recent version of perl. Try `perldoc CGI` from the command line. Note that is your script is run in a CGI environment, it NEEDS to output valid http headers at least, otherwise the browser will report an 'Internal Server Error'. A simple script unsing the CGI module to dump back whatever form or query data the browser has passed to it would look like this: #!/usr/bin/perl -w use strict; use CGI; my $cgi = CGI->new(); print $cgi->header, $cgi->start_html("Parameter Dump: $0"), $cgi->table( { -border => 1 }, $cgi->Tr( [ $cgi->th([ 'Field', 'Value(s)' ]), map { $cgi->td( [ $_, join ', ', $cgi->param($_) ] ) } sort $cgi->param ] ), ), $cgi->end_html; exit; __END__ HTH Cheers, Damian -- @:=grep!(m!$/|#!..$|),split//,;@;=0..$#:;while($:=@;){$;=rand $:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,, $,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__ Just another Perl Hacker,### http://home.pacific.net.au/~djames.hub