Thanks stefby, that works. But I don't understand why. Where does $_ derive from in this case, and why do I need ""? | [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] [d/l] |
| [reply] [Watch: Dir/Any] |
Stefby, I am actually familiar with $_ in general, but in this specific case I don't understand where its value comes from. I'm guessing it's because $_ can handle lists and say for cannot? But, why?
Here is my understanding of what's going on in your answer:
- values %alphabet spits out a list;
- $_ iterates through that list (but why wasn't my original say for iterating through the list?)
- @ dereferences the array (again, why didn't my original @{...} dereference it?)
- " " joins the output with $".
Would you mind correcting / clarifying the above? Thank you for your help so far.
| [reply] [Watch: Dir/Any] [d/l] [select] |
$ perldoc -v $_
$ARG
$_ The default input and pattern-searching space. The followi
+ng
... ... ... ... ... ... ...
(Mnemonic: underline is understood in certain operations.)
| [reply] [Watch: Dir/Any] [d/l] |