Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: providing a callback routine to sort

by Anonymous Monk
on Jan 22, 2014 at 04:17 UTC ( #1071563=note: print w/replies, xml ) Need Help??


in reply to Re: providing a callback routine to sort
in thread providing a callback routine to sort

I really think you did not provide enough information to help you

See Re: providing a callback routine to sort ( $::a $::b )

The only reason $a and $b are undefined is because they're not $main::a and $main::b -- sort deals with $main::a and $main::b or $::a for sort -- this is the OPs problem and the solution, use the right variable (package affects unqualified variables)

sort talks about this exactly

An alternate solution (using prototypes) is also talked about in sort and in chromatics free book Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.

looks probably wrong to me. Left side looks like a function, right side not.

Well, they're both perfectly identical method calls

  • Comment on Re^2: providing a callback routine to sort

Replies are listed 'Best First'.
Re^3: providing a callback routine to sort
by Anonymous Monk on Jan 22, 2014 at 14:24 UTC
    Thank you! I provided $pkgdir::pkg::a and $pkgdir::pkg::b and it worked! My apologies for missing that in the documentation. Unfortunately, it's all the way at end (in very tiny letters ;)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2022-08-08 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?