|
|
| P is for Practical | |
| PerlMonks |
Re: Interesting line which I read from Monk's snippetsby Tanktalus (Canon) |
| on Jan 31, 2006 at 04:38 UTC ( #526657=note: print w/ replies, xml ) | Need Help?? |
|
qw(a - b = c ~ d ^) creates a list: "a", "-", "b", "=", "c", "~", "d", "^". Put that in braces, and you are initialising an anonymous hash. Use the arrow to dereference that hash. The brace to the right shows what key to use to dereference the hash. The key to use is the substring of $0 (the program name) - starting at position 0, length of 1. It's like this: Just a bit more concisely, and much less readably. It's a cute trick, but I wouldn't recommend learning how to code from it ;-)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||