Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: set context for method's return valuesby Marshall (Canon) |
on Jan 27, 2022 at 04:09 UTC ( [id://11140889]=note: print w/replies, xml ) | Need Help?? |
Your code:
Yields: I think what you want is: print can take a file handle as an optional arg and this can be confusing. putting a dummy null string in front disambiguates this. The split creates a list, put the list into paren and use the bracketed 2 to get C. Basically don't put a Perl variable or a function call immediately after the keyword "print". Adding more parens is a possible solution, but I prefer the above. Mileage varies.
In Section
Seekers of Perl Wisdom
|
|