in reply to Re: hash from sub directly into foreach loop
in thread hash from sub directly into foreach loop

sorry for all the confusion about the typo.

But thnx for the %{ { &testa } } that does the trick!
I guess it might be very usefull to study the perlsub (how do you guys make this a link, where is it documented, I've search the docs already a couple of times ?)!!

LuCa
  • Comment on Re^2: hash from sub directly into foreach loop

Replies are listed 'Best First'.
Re^3: hash from sub directly into foreach loop
by davido (Cardinal) on Jun 30, 2006 at 09:02 UTC

    You're welcome, but I did say %{ { testa() } }, not %{ { &testa } }. Your specific example code doesn't bump into the difference, but there is a difference. It's just good to be in the habit of using the subroutine() method of calling subs, instead of the Perl4-ish (and sometimes confusing) &subroutine method.

    As for how to link to perlsub, see About the PerlMonks FAQ, and specifically, What shortcuts can I use for linking to other information?. ...but first read perlsub; that's a much more important step toward your understanding Perl.


    Dave

      thnx a lot!!