in reply to How to assign string "0" in short circuit
#!/usr/bin/perl use warnings; use strict; sub function1 { my $var = defined $_[0] ? shift : 'No argument'; print "$var\n"; } function1('zero'); function1(0); function1('0'); function1(0e0); function1('foolio'); function1();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to assign string "0" in short circuit
by nikhil.patil (Sexton) on Feb 05, 2008 at 06:46 UTC | |
by naikonta (Curate) on Feb 05, 2008 at 07:52 UTC |