use constant XX => ( ...



Hi Group,

There are two syntax for the "use constant" pragma: to declare a scalar or to declare a list.

use constant CONST => scalarvalue;

use constant LIST => qw( listitem1, listitem2, listitem3);



I've found this in a perl module :Win32::Exe.
Could someone explain the syntax?


use constant DISPATCH_TABLE => (
"PE\0\0" => "PE",
'*' => sub { die "Incorrect PE header -- not a valid .exe file" },
);

What is DISPATCH_TABLE: a scalar or a list?

Thanks in advance.
.



Relevant Pages

  • Re: Simple question on Pointers
    ... It is undefined to use plain old scalar delete on ... hacks) You can't declare a charEVER. ... As for the inability to declare a variable with that syntax, ... without having to introduce a typedef to insert the variable names before ...
    (microsoft.public.vc.language)
  • Re: use constant XX => ( ...
    ... There are two syntax for the "use constant" pragma: to declare a scalar or to declare a list. ... use constant CONST => scalarvalue; ...
    (comp.lang.perl.misc)
  • Re: use constant XX => ( ...
    ... or to declare a list. ... use constant CONST => scalarvalue; ... Could someone explain the syntax? ... a scalar or a list? ...
    (comp.lang.perl.misc)
  • Re: MIME coding & flags for sending a .csv or Excel file (Question)
    ... Is the scalar function always use to return values in a sub? ... You should really use 'my' instead or 'our' to declare variables ...
    (perl.beginners)
  • Re: merging variables and arrays ...
    ... alreay "use up" that syntax, leaving no way to ... specify traces on the scalar version of the variable ...
    (comp.lang.tcl)