Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Sub prototypes...

by bmccoy (Beadle)
on Dec 21, 2001 at 23:38 UTC ( #133846=note: print w/replies, xml ) Need Help??

in reply to Sub prototypes...

Think about the order of execution when you have a subroutine executing as an argument to another subroutine. If you have a sub that is expecting an array as argument, and instead you give it a sub that returns an array, like this:

sub1(sub2()); sub sub1 { my @array = @_; ... } sub sub2 { ... return @arr; }
In what order do you expect them to be executed? I think this is what is happening here, the catch is being executed first since it is an argument to try.

-- Brett

Go not to the Elves for counsel, for they will say both no and yes

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://133846]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2023-05-29 18:44 GMT
Find Nodes?
    Voting Booth?

    No recent polls found