"Sherm Pendley" <> wrote in message
news:78Wdnda4-8L-MJHcRVn-...
> Mark wrote:
>
> > use CGI qw(:standard);
> > use CGI qw(:cgi-lib);
> > #during development, put Perl errors to the browser
> > use CGI::Carp qw(fatalsToBrowser);
> > use strict;
> > my $q = new CGI;
> > my $params = $q->Vars();
> >
> > but the server is giving me an error message:
> >
> > Undefined subroutine CGI::Vars
> >
> > but I'm not sure why.
>
> Is that your *real* code?
*Real* code? Are you suggesting I would post *fake* code?! Would I do such a
thing?

Seriously though, it is just a straight copy and paste.
>
> I suspect that your real code might actually be calling Vars() like this:
>
> my $params = Vars();
>
> In that case, your problem might come from the dual sets of 'use'
> statements. A module that has already been 'use'd won't be reloaded if
> another 'use' is encountered, so the second - which imports the function
> you want to use - wouldn't have any effect.
>
> So you might try one of two things. Either make sure that your real code
> does call Vars() as a method, like the code you posted here does. Or,
> import both groups of functions with a single use statement, like this:
>
> use CGI qw(:standard :cgi-lib);
What I did do is tried every permutation of code I could think of based on
the various articles I read to see where the error could have lain including
what you have given me above but as every permutation brought up the same
errors I did not know where the error lay. The code I posted happened to be
where I was at at the time of posting. (I also tried both OO and method).Yes
I had read about the above in perldoc too but no wonder I was confused - it
was never going to work anyway (see previous post) CGI::Vars was definitely
not installed on the server.
Anyway no need for more replies to this topic for my benefit at least anyway
as had the Vars function been installed on the server my initial code would
have worked right from the start - the perldoc explained it well enough for
me. It was only through messing with the code to try to find the cause of
the error that led to the confused mess of my previous posts. But, of
course, if you still have matters to settle with the other posters in this
thread I will be happily lurking in the background taking notes...
Mark
>
> sherm--
>
> --
> Cocoa programming in Perl: http://camelbones.sourceforge.net
> Hire me! My resume: http://www.dot-app.org