Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: About "state" variables in Perl 5.10

by shmem (Chancellor)
on Dec 28, 2007 at 16:48 UTC ( [id://659352]=note: print w/replies, xml ) Need Help??


in reply to About "state" variables in Perl 5.10

Since I find the latter very simple to follow and understand I would like to know if there are differences between them
Er... between what?

Do you know the difference between a hippo?

Each sub has its own scope, so sharing a lexical state variable via state $var is not an option, you have to allocate that var in an outer scope. my and state make no difference there.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-24 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found