--- Dermot Paikkos <[EMAIL PROTECTED]> wrote: > I still get the error if I remove those lines: > 1 #!/usr/bin/perl -w > 2 > 3 use strict; > 4 > 5 use CGI qw\standard cgi-lib\; > 6 use CGI::Carp qw(fatalsToBrowser); > 7 > 8 $CGI::POST_MAX = 1024 * 1000; # Set limit to 1MB > 9 > 10 > 11 my $q = new CGI; > 12 > 13 my @names = $q->param; > 14 #my $params = Vars; > 15 #my $len = @{$params}; > ....snip
OK, there is something else going on here. Previously I saw that you were importing things incorrectly, but I didn't say anything as Lincoln Stein has done enough strange things with CGI.pm to get it to *just work*. Now I'm pointing this out because it's likely related. First, I can't imagine how your code is functioning at all because you have not imported Vars. For example, the following minimal test script will demonstrate the problem: #!/usr/bin/perl use strict; use warnings; use CGI qw\standard cgi-lib\; my $params = Vars; That will complain about the bareword "Vars". That gets fixed with this: use CGI qw(:standard :cgi-lib); Second, please do not use backslashes '\' as quote operators. They're very visually jarring to most and if you use them, you'll find it difficult to escape any special characters you've quoted. In fact, in my years of using Perl, I've used backslashes for this purpose once. It was a deliberate joke. Third, if you are instantiating a new CGI object with CGI->new, you do not need to use ":standard" in your import list. ":standard" is for importing the most common CGI functions into your namespace (such as "param", "header", etc.). When using the object oriented CGI interface (CGI->new) this is not necessary. use CGI; my $cgi = CGI->new; # "new CGI", though documented, # is not recommended my @params = $cgi->param; print $cgi->header('text/plain'); foreach my $name ( @params ) { # assumes single value params print "$name: " . $cgi->param($name) . "\n"; } Versus: use CGI qw(:standard); print header('text/plain'); foreach my $name ( param() ) { # assumes single value params print "$name: " . param($name) . "\n"; } Which style you prefer will depend upon your needs and tastes. Cheers, Ovid -- If this message is a response to a question on a mailing list, please send follow up questions to the list. Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>