neo1491 has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to write something like:$foo_path = ('/mnt/foo') if ($^O eq "linux"); $foo_path = ('\\\C:\foo.exe') if (($^O =~ /mswin32|nt/i));
... but using undef in this way doesn't work. I've googledif undef ($foo_path) { print "\nFOO was not intended to run on OS:$^0\n" exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using UNDEF
by pc88mxer (Vicar) on May 22, 2008 at 16:46 UTC | |
by neo1491 (Beadle) on May 22, 2008 at 17:00 UTC | |
|
Re: Using UNDEF
by ikegami (Patriarch) on May 22, 2008 at 16:55 UTC | |
by MidLifeXis (Monsignor) on May 22, 2008 at 16:59 UTC | |
by Your Mother (Archbishop) on May 22, 2008 at 20:42 UTC |