|
|
| XP is just a number | |
| PerlMonks |
Syntax for 1 line "either this or this"by theAcolyte (Pilgrim) |
| on May 29, 2003 at 22:43 UTC ( [id://261712]=perlquestion: print w/replies, xml ) | Need Help?? |
|
theAcolyte has asked for the wisdom of the Perl Monks concerning the following question:
Ok, I saw a code snippet somewhere on this site a few days ago.. and just spent the better part of an hour trying to find it again, without luck.
It showed a nice, simple sytax for saying if(!defined($someValue)) { $myVar = "default" } else { $myVar = $somevalue } except it didn't use an if or an else or even, if I remmeber correctly, curlie brackets. I seem to remember a ? or a : in there. Anyone help out? :-) Thanks
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||