Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I do use CGI qw(Vars....), and when I call Vars it doesn't return a anything, how come? Why don't I get any errors?
bash-2.05$ perl -MCGI -e 'print $CGI::revision,"\n"' $Id: CGI.pm,v 1.5 1998/12/06 10:19:48 lstein Exp $

Replies are listed 'Best First'.
Re: CGI::Vars doesn't return anything
by mattr (Curate) on Aug 06, 2001 at 14:24 UTC
    I think you are looking for this usage (courtesy of the CGI man page:
    use CGI ':cgi-lib'; $params = Vars;
    As for errors, perhaps you should use strict;
      are you telling me that use CGI qw(Vars);# wouldn't work?
      looks like valid syntaxt to me (but i have been wrong often).
      I am using strict and warnings.
      Is it just the nature of CGI (somewhat unlike other modules) that it does not throw errors?
Re: CGI::Vars doesn't return anything
by snowcrash (Friar) on Aug 06, 2001 at 14:34 UTC
    according to the cgi_docs the Vars method was added in version 2.50... as to why no error occures, i couldn't get a copy of CGI.pm as old as 1.5 at CPAN... but I would consider upgrading to the newest version anyway.

    snowcrash //////