G
goodcall1
Problem: I am having trouble figuring out why a system call in the
background *always* returns 0. Debian Linux Perl 5.8.7
What am I trying to do: I am trying to launch a browser from a perl/Tk
button and it always returns 0 (and hence prints the failed to open
browser message) whether or not the browser actually gets launched.
Here is some sample code:
my $browser = '/usr/bin/firefox';
my $url = 'http://www.google.ca';
my $return = system ("$browser \"$url\" &");
if (!$return) {
print "failed to open browser\n";
}
background *always* returns 0. Debian Linux Perl 5.8.7
What am I trying to do: I am trying to launch a browser from a perl/Tk
button and it always returns 0 (and hence prints the failed to open
browser message) whether or not the browser actually gets launched.
Here is some sample code:
my $browser = '/usr/bin/firefox';
my $url = 'http://www.google.ca';
my $return = system ("$browser \"$url\" &");
if (!$return) {
print "failed to open browser\n";
}