Not all CGI's are not created equal, behold:
#!/usr/bin/perl -w
use strict;
use CGI;
print "Version: $CGI::VERSION\n",
"Revision: $CGI::revision\n";
I suggest you crack open CGI.pm and check to see if Vars is in there, it'd be listed under %EXPORTED_TAGS as':cgi-lib' => [qw/ReadParse PrintHeader HtmlTop HtmlBot SplitParam Vars/],
and it would look something like (from 2.752) # These are some tie() interfaces for compatibility
# with Steve Brenner's cgi-lib.pl routines
'Vars' => <<'END_OF_FUNC',
sub Vars {
my $q = shift;
my %in;
tie(%in,CGI,$q);
return %in if wantarray;
return \%in;
}
END_OF_FUNC
ar0n says you don't really need it, and that you can use my %form = map { $_ => $q->param($_) } @labels; to replicate the functionality, but be aware that Vars is significantly faster than the map method. in my benchmarks, Vars was at least %20 percent more efficient (it was significantly more, but I don't recall the exact number, i'll update in a minute).
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;" | [reply] [d/l] [select] |
Err, why are you using CGI::Vars in the first place? It's old (from cgi-lib, I believe). Use param instead:
my @labels = qw(topic words pass name textsize topicsize);
my %form = map { $_ => $q->param($_) } @labels;
[ ar0n -- want job (boston) ]
| [reply] [d/l] |
Not true. Newer versions on CGI.pm Have a Vars subroutine for importing to a hash. Very useful :). jerrygarciuh probably just has an older version. I believe its versions 2.56 and above that have it but don't quote me on that :)
Chris
| [reply] |