"be consistent" | |
PerlMonks |
Re^2: Perl Code Changes Behavior if Two Subroutine definitions are swappedby rkabhi (Acolyte) |
on Jul 28, 2016 at 05:36 UTC ( [id://1168706]=note: print w/replies, xml ) | Need Help?? |
Hi Athanasius, Thanks for your response. Regarding the empty string. I tried running your example code using perl 5.10.1 and got following output: OUTPUT WITH EXAMPLE CODE:
So, somehow we get different outputs. Not sure why. Since in my case it tries to match with $_ when nothing is specified in switch(), I could not identify any issue with such use of switch and therefore I continued using it. Thanks for mentioning things to take care as best practice about using empty arguments and next statements. I will try your suggestions and get back if the main issue persists. For now I am not going to use switch as it is not necessary for my code. Best Regards, Abhishek
In Section
Seekers of Perl Wisdom
|
|