On Tuesday, November 4, 2003, at 12:58 PM, [EMAIL PROTECTED] wrote:


Hello Perler's

I am trying to create a hash where each key is a referance to subs. The bellow code produces the expected result, with one unexpected side-effect. Why are the subs executed when I only declare them ??

<- cut
 #!/usr/local/bin/perl -w


%hash=( 1 => funca(), 2 => funcb(), );

Try:


%hash = (
        1 => \&funca,
        2 => \&funcb
);

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to