Combine hash declaration/assignment into single statement?



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

.



Relevant Pages

  • Re: How to implement sizeof operator
    ... project i want to implemnent my own sizeof operator function (like ... Hint: macros can declare variables. ... difference between foo and foo, where the first foo was declared using ... No, at compile-time, it can be done in pure ISO C. ...
    (comp.lang.c)
  • Re: Subroutines with &
    ... print foo(); ... In addition to the expected "Howdy", it produces the following warning: ... You could declare the sub above the ... Or, you could forward declare the sub, like this: ...
    (comp.lang.perl.misc)
  • Re: Calling functions declared in an entity
    ... In VHDL it is possible to declare the following entity: ... entity Foo is ... ARCHITECTURE rtl OF ent_item_decl IS ...
    (comp.lang.vhdl)
  • Re: Pragmas use strict and use warnings
    ... The strict pragma has three effects: ... globals that belong to the current package. ... global $foo from the current package (which is in this small example, ... to declare a lexical of that name using 'my', ...
    (perl.beginners)
  • Re: Function declarations & use of static functions
    ... > mainand foo(), respectively defined in main.c and foo.c. ... > declare foo() within main.c so maincould call it? ... int main ... dsk_readSectorin disk.h for external consumers. ...
    (comp.lang.c)