Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Sub prototypes...

by bmccoy (Beadle)
on Dec 21, 2001 at 23:38 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-23 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found