--- nfo/perl/libs/shortcuts.pm 2003/02/14 14:17:04 1.3 +++ nfo/perl/libs/shortcuts.pm 2003/02/22 17:26:13 1.5 @@ -1,7 +1,13 @@ ## --------------------------------------------------------------------------- -## $Id: shortcuts.pm,v 1.3 2003/02/14 14:17:04 joko Exp $ +## $Id: shortcuts.pm,v 1.5 2003/02/22 17:26:13 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: shortcuts.pm,v $ +## Revision 1.5 2003/02/22 17:26:13 joko +## + enhanced unix compatibility fix +## +## Revision 1.4 2003/02/22 17:19:36 joko +## + unix compatibility fix +## ## Revision 1.3 2003/02/14 14:17:04 joko ## - shortened seperator ## @@ -59,6 +65,19 @@ print " ", $cmd, "\n"; print " ", $caption, "\n" if $caption; print $sep, "\n"; + + # strip name of executable from full command string + $cmd =~ m/(.+?)\s/; + my $executable = $1; + + # for unix: check if executable is in local directory, if so - prefix with './' + if (!RUNNING_IN_HELL()) { + #if ($cmd !~ m/\//) { + if (-e $executable) { + $cmd = "./$cmd"; + } + } + system($cmd); #`$cmd`; print "ready.", "\n"; @@ -81,4 +100,7 @@ return ($bool ? 'ok' : 'failed'); } +sub RUNNING_IN_HELL () { $^O eq 'MSWin32' } + + 1;