Combine hash declaration/assignment into single statement?
- From: usenet@xxxxxxxxxxxxxxx
- Date: 28 Feb 2006 11:00:27 -0800
It is often possible to declare and assign a variable in a single
statement, such as:
my $foo = 'bar';
or
my @foo = qw{bar baz};
Is it possible to do this in a single statement (under strict):
my %character_value;
@character_value{'a'..'z'} = (1..26);
Thanks!
--
http://DavidFilmer.com
.
- Follow-Ups:
- Re: Combine hash declaration/assignment into single statement?
- From: Rick Scott
- Re: Combine hash declaration/assignment into single statement?
- From: attn.steven.kuo@xxxxxxxxx
- Re: Combine hash declaration/assignment into single statement?
- From: Uri Guttman
- Re: Combine hash declaration/assignment into single statement?
- Prev by Date: Re: References as Hash Keys, Tree Structures (Newbie)
- Next by Date: suppress regex parsing in interpolated string
- Previous by thread: concurrency with DBI questions
- Next by thread: Re: Combine hash declaration/assignment into single statement?
- Index(es):
Relevant Pages
|
|