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

Hi All,

So I did up my script for active perl on windows, and then moved it to the linux server. On doing so, I get: Undefined subroutine Vars

big surprise for me. so I looked at my script

#!/usr/local/bin/perl -w use strict; use CGI qw/:standard :cgi-lib/; trimParameters(scalar(Vars()));

I found the CGI.pm file and Vars was listed under the cgi-lib export list, and the file also contained that Vars sub definition.

using CGI::Vars doesn't help, the message is "undefined sub CGI::Vars

trimParameters takes a hash reference, and strips off leading and trailing whitespace characters

Anyone have any suggestions.

thank you

Replies are listed 'Best First'.
Re: Vars in CGI
by PodMaster (Abbot) on Jul 29, 2003 at 05:24 UTC
    use CGI 2.7 qw/:standard :cgi-lib/;
    http://search.cpan.org/src/LDS/CGI.pm-2.98/cgi_docs.html

    Version 2.50

    1. Added a new Vars() method to retrieve all parameters as a tied hash.
    That's probably your problem (not a current enough version of CGI.pm).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Vars in CGI
by hossman (Prior) on Jul 29, 2003 at 05:25 UTC
    What version of CGI is installed on each machine?
      I'm using version 2.46. Thank for the help. Time to upgrade.