Hello IB2017,

The Browser::Open module determines an OS-sppropriate value for $cmd and then executes a call to system($cmd, $url);. So if the equivalent call fails on your OS when invoked directly, it will fail similarly via a call to open_browser. For example, on my system (Windows 8.1, 64-bit, Perl 5.28.0):

21:47 >perl -wE "system('start', 'https://www.google.com/search?q=fina +nce&source=lnms&tbm=isch');" 'source' is not recognized as an internal or external command, operable program or batch file. 'tbm' is not recognized as an internal or external command, operable program or batch file. 21:53 >

But changing the query delimiter from & to ; fixes the problem for me:

21:53 >perl -wE "system('start', 'https://www.google.com/search?q=fina +nce;source=lnms;tbm=isch');" 21:54 >

— and the equivalent:

use strict; use warnings; use Browser::Open qw( open_browser ); my $url = 'https://www.google.com/search?q=finance;source=lnms;tbm=isc +h'; my $ok = open_browser($url); printf "\$ok = >%s<: %s\n", $ok, !defined($ok) ? 'no recognised command found' : $ok == 0 ? 'command found and executed' : 'command found, error while executing';

works correctly:

21:58 >perl 1952_SoPW.pl $ok = >0<: command found and executed 21:58 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to Re: Browser::Open Windows metacharacters by Athanasius
in thread Browser::Open Windows metacharacters by IB2017

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.