in reply to Using UNDEF
Update: In 5.10 you can write:die "FOO was not intended to run on OS $^O\n" unless defined($foo_path);
You might even be able to factor the assignment to $file_path to outside the given statement -- gotta get 5.10 installed and try it out.given ($^O) { when (/linux/) { $file_path = '/mnt/foo' } when (/mswin32|nt/) { $file_path = '\\\C:\foo.exe' } default { die "FOO was not intended..." } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using UNDEF
by neo1491 (Beadle) on May 22, 2008 at 17:00 UTC |