Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: my and local variable significance in a particular case

by brx (Pilgrim)
on Apr 24, 2012 at 15:59 UTC ( #966886=note: print w/replies, xml ) Need Help??


in reply to my and local variable significance in a particular case

Note that $a and $b are special variables !

See perlvar: $a $b : Special package variables when using sort(), see sort. Because of this specialness $a and $b don't need to be declared (using use vars , or our()) even when using the strict 'vars' pragma. Don't lexicalize them with my $a or my $b if you want to be able to use them in the sort() comparison block or function.

Read documentation about local too.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966886]
help
Chatterbox?
[choroba]: Corion ad functional: in Erlang, it's even more like Prolog, as its syntax is very close to Prolog's
[Corion]: choroba: I've only dabbled in Erlang a bit, and I don't even remember what program I wrote in it :)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2017-12-11 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (290 votes). Check out past polls.

    Notices?