Re: ref's to subs

2003-11-04 Thread Jeff 'japhy' Pinyan
On Nov 5, Tore Aursand said: >On Tue, 04 Nov 2003 13:58:41 -0500, mgoland wrote: >> %hash=( 1 => funca(), >> 2 => funcb(), >> ); > >Try this: > > %hash = (1 => \&funca(), > 2 => \&funcb()); No; \&foo is a reference to the foo function, but \&foo() is a reference to the re

Re: ref's to subs

2003-11-04 Thread Tore Aursand
On Tue, 04 Nov 2003 13:58:41 -0500, mgoland wrote: > %hash=( 1 => funca(), > 2 => funcb(), > ); Try this: %hash = (1 => \&funca(), 2 => \&funcb()); -- Tore Aursand <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

RE: ref's to subs

2003-11-04 Thread Tim Johnson
" statement. You CAN prototype a subroutine to check variable types that are passed to a sub, but that's a different story. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 10:59 AM To: [EMAIL PROTECTED] Subject: ref's to s

Re: ref's to subs

2003-11-04 Thread Rob Dixon
Mark wrote: > > 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(), >

Re: ref's to subs

2003-11-04 Thread James Edward Gray II
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 #!

ref's to subs

2003-11-04 Thread mgoland
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(),