Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The do block defines the logical context of the my declaration. Essentially, we:
Since Perl does not have the concept of an anonymous scalar ref (in contrast to {} and []), your kludge is one way of getting that. The best reason to use it is because it works. The worst reason is that you had to ask the question; it doesn't scan unless you know the trick. Were I to write it, I'd probably go with the more verbose: If you really want to use a do, you could also which I think scans better. #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way. In reply to Re: Bless and Do
by kennethk
|
|