There's more than one way to do things | |
PerlMonks |
What protects me from doing this stupid thing..?by Cody Pendant (Prior) |
on Aug 11, 2007 at 23:59 UTC ( [id://631989]=perlquestion: print w/replies, xml ) | Need Help?? |
Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
I'd got into the habit of doing this:
so that I get a default if the var isn't defined. But then, genius that I am, I used a more complex version of it like this in an HTML::Template param() assignment. which doesn't work. What I've told perl to do is to assign the non-existent variable, or do "10", is that right? But I don't get a "contant in void context" warning the way I would if I just put: in the middle of my script. Is there any way I could have caught that? Nobody says perl looks like line-noise any more
Back to
Seekers of Perl Wisdom
|
|