in reply to Using UNDEF

Use defined:
die "FOO was not intended to run on OS $^O\n" unless defined($foo_path);
Update: In 5.10 you can write:
given ($^O) { when (/linux/) { $file_path = '/mnt/foo' } when (/mswin32|nt/) { $file_path = '\\\C:\foo.exe' } default { die "FOO was not intended..." } }
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.

Replies are listed 'Best First'.
Re^2: Using UNDEF
by neo1491 (Beadle) on May 22, 2008 at 17:00 UTC
    Thanks pc88mxer... the 'unless defined' statement works great.