# Launch new process the Win32 way. # Use alternate browser if installed. sub show_in_browser { no strict; if ( $browser =~ m/mozilla|firefox/ ) { # Display in Mozilla or its derivatives... $_ = shift || ''; my $command = m!^(?:ftp|http|file)://! ? sprintf URL, $_ : -r ($_) ? sprintf URL, 'file://' . abs_path($_) : s!^(www\..+)!http://$1! ? sprintf URL, $_ : s!^(ftp\..+)!ftp://$1! ? sprintf URL, $_ : s/^mailto:// ? sprintf MAIL, $_ : warn "usage: $0 (filename|URL|mailto:foo\@bar.com)\n" ; # Could add a LOG file output here. system "$browser", -remote => sprintf( $command, $_ ); } else { system( qq|start "$browser" "$browser"|, qq|"$_[0]"| ) && log_write( "Oops! Trouble opening $browser"); } }