http://qs1969.pair.com?node_id=78926


in reply to Perl/Tk Chatterbox Client

Update to accept the new google:// links, in addition to the cpan:// links:

Replace the section for the perlmonks URLs with this code:

# URL to use for links into perlmonks, cpan, and google my($perlmonksURL_base) = 'http://www.perlmonks.org/'; my($perlmonksURL_node) = 'http://www.perlmonks.org/index.pl?node='; my($perlmonksURL_id) = 'http://www.perlmonks.org/index.pl?node_id='; my($perlmonksURL_cpan) = 'http://search.cpan.org/search?mode=module&qu +ery='; my($perlmonksURL_google) = 'http://www.google.com/search?q=';
And update part of the launchBrowser sub with this code (also fixed those escaped slashes...):
printMessage("\n*Launching browser for node $node..."); if ($node =~ s,^id://,,) { $url = $perlmonksURL_id . $n +ode; } elsif ($node =~ s,^node_id=,,) { $url = $perlmonksURL_id . $n +ode; } elsif ($node =~ s,^cpan://,,) { $url = $perlmonksURL_cpan . $n +ode; } elsif ($node =~ s,^google://,,) { $url = $perlmonksURL_google . $n +ode; } elsif ($node =~ m,^http:,) { $url = $node; + } elsif ($node =~ s,^/+,,) { $url = $perlmonksURL_base . $n +ode; } else { $url = $perlmonksURL_node . $n +ode; }

Replies are listed 'Best First'.
Re: Re: Perl/Tk Chatterbox Client
by idnopheq (Chaplain) on May 08, 2001 at 22:51 UTC
    I did
    elsif ($node =~ s/^google:\/\///) { $node =~ s/\s/%20/g; $url = $perlmonksURL_google . $node;
    to take care of the spaces. Still won't get too funky ...

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.