develooper Front page | perl.beginners | Postings from January 2002

RE: What's wrong with this?

From:
Brett W. McCoy
Date:
January 29, 2002 07:41
Subject:
RE: What's wrong with this?
Message ID:
Pine.LNX.4.43.0201291046001.20278-100000@chapelperilous.net
On Tue, 29 Jan 2002, Jeff 'japhy' Pinyan wrote:

> On Jan 29, Jonathan E. Paton said:
>
> >> How can the param's be placed into a new hash?
> >
> >my %hash = param();
> >
> >since param() detects whether it's in list/array/hash
> >context and does the Right Thing.
>
> These is no such thing as "hash context" or "array context".  There is
> void context, scalar context, and list context.
>
>   my %hash = param();
>
> is list context, and stores only the NAMES of the fields (not their
> values) in %hash.

There is a method in CGI.pm that *does* return a hash with the fields and
their values.  I believe it is called Vars() (with a capital V).

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
I remember Ulysses well...  Left one day for the post office to mail a letter,
met a blonde named Circe on the streetcar, and didn't come back for 20 years.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About