[toulouse-pm] Un script sympa

Michel Rodriguez mrodrigu at xmltwig.com
Fri Oct 11 06:17:24 CDT 2002


Ce script permet d'ouvrir une url dans une tab de mozilla (ou phoenix dans
mon cas) au lieu d'ouvrir une nouvelle fenetre

#!/usr/bin/perl -w

use strict;

use constant USAGE => <<EOU;
USAGE:
$0 (filename|URL|mailto:email\@addre.ss)
EOU

$_ = shift;
my $command = 'openURL(%s, new-tab)';

SWITCH: {
    s{^(www\..+)}{http://$1};
    m{^(ftp|http|file)://} and last;
    -r and do {
        require Cwd;
        $_ = 'file://' . Cwd::abs_path( $_ );
        last;
    };
    print USAGE and exit;
}

system "phoenix", "-remote", sprintf($command, $_);


Michel Rodriguez
Perl &amp; XML
http://www.xmltwig.com




More information about the Toulouse-pm mailing list