"anonymous" variable in Perl?
From: Ronald Fischer (ronaldf_at_eml.cc)
Date: 11/30/04
- Next message: Marcel: "looking for simple code to build a search engine"
- Previous message: azbycx_47_at_yahoo.com: "Regarding Usage on Perl"
- Next in thread: Richard Gration: "Re: "anonymous" variable in Perl?"
- Reply: Richard Gration: "Re: "anonymous" variable in Perl?"
- Reply: KKramsch: "Re: "anonymous" variable in Perl?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Nov 2004 01:29:08 -0800
Consider a call to, say, localtime, where I only need the current month:
my ($a, $b, $c, $d, $month) = localtime time,
Here I had to invent names ($a...$d) for the first four fields. Is it possible
in Perl to have kind of an "anonymous" variable as a placeholder for those
fields, similar to the '_' variable in Prolog?
I darkly remember to have read about such a feature introduced with Perl 5.6,
but I can't find out how to do it.
Ronald
- Next message: Marcel: "looking for simple code to build a search engine"
- Previous message: azbycx_47_at_yahoo.com: "Regarding Usage on Perl"
- Next in thread: Richard Gration: "Re: "anonymous" variable in Perl?"
- Reply: Richard Gration: "Re: "anonymous" variable in Perl?"
- Reply: KKramsch: "Re: "anonymous" variable in Perl?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|