in reply to Re: Re: Re: Re: Want a Hashref. Getting a List in Scalar Context.
in thread Want a Hashref. Getting a List in Scalar Context.

I dunno, I'm not a newbie and I like seeing it. Its strange to write return() in some places but not others. I suppose I could think of it like writing scalar() some places but I haven't.
  • Comment on Re: Re: Re: Re: Re: Want a Hashref. Getting a List in Scalar Context.

Replies are listed 'Best First'.
•Re: Re: Re: Re: Re: Re: Want a Hashref. Getting a List in Scalar Context.
by merlyn (Sage) on May 06, 2004 at 16:13 UTC
    When you think of "return" as "return from this subroutine early", it becomes very clear where you need it: everywhere that you want the subroutine to abort before it would have otherwise. And, by the way, you can also specify the "last expression evaluated" as a convenience after the return. {grin}

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.