in reply to Newbie question No.2

Sorry! I should know better than to type example code instead of cut & pasting it. Here is the actual code I was using.........

#!e:/Perl/bin/Perl.exe use strict; use diagnostics; #use CGI qw( :all ); use CGI::Pretty qw( :all ); my @test_list = qw/the quick brown fox/; print @test_list, "\n"; print "Have parameters\n" if param; my @params = param(); print @params. "\n";
which gives
C:\www\NB.biz\html>menu.pl "a=1&b=2&" thequickbrownfox Have parameters 2

The result is that I now notice I have a "." (dot) after @params in the print line instead of a "," (comma)!

Thanks for your help guys.

Replies are listed 'Best First'.
Re: Re: Newbie question No.2
by jsprat (Curate) on Jun 05, 2002 at 01:44 UTC
    Context, context, context;) The print function accepts either a list or a scalar. The '."\n"' you are using in the second example forces scalar context, which will return the number of items in the array.

    Changing the dot(.) operator to a comma (,) will give print a list context to work with.