|
|
| Keep It Simple, Stupid | |
| PerlMonks |
$scalar => 'WTF?';by {}think (Acolyte) |
| on Sep 07, 2011 at 00:42 UTC ( #924492=perlquestion: print w/ replies, xml ) | Need Help?? |
|
{}think has asked for the
wisdom of the Perl Monks concerning the following question:
When debuggin a program today, I noticed a simple typo in my scalar assignment. Instead of saying
my $x = 3;, I typed my $x => 3; Even with strict and warn, the code ran and executed with no errors, but $x was undefined after the mistyped statement. I'm very familiar with using the => operator (does it have a name?!?!) for hash initializtion. What exactly happens when on misapplies it to a scalar, as I did? Wouldn't you think this is a good candidate for a warn message?
{}think; #Think outside of the brackets
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||