Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Opening Opera windows with Perl

by mooseboy (Pilgrim)
on Dec 26, 2002 at 17:37 UTC ( #222375=perlquestion: print w/replies, xml ) Need Help??

mooseboy has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have a program which outputs URLs of news stories I'm interested in (adapted from one in Sean M Burke's Perl and LWP) that I then pipe to the following mini-script to open them in Opera 6 on Linux:

while (<>) { chomp; m/\S/ and system("opera '$_' &"); }

However, this isn't quite what I'm after, since it opens each story in a separate instance of Opera. What I'm trying to do is to open each story in a separate window within Opera. I tried adding a short sleep at the end of the loop, and then it opens Opera just once, but loads all the stories into the same window one after another. Can anyone help?

Thanks in advance, mooseboy

Replies are listed 'Best First'.
Re: Opening Opera windows with Perl
by Aristotle (Chancellor) on Dec 26, 2002 at 18:34 UTC
    See opera --help, specifically the -remote option.

    Makeshifts last the longest.

      Thanks for the hint -- just changed the one line to this:

      m/\S/ and system("opera -newwindow '$_' &");

      and it works a treat! Cheers, mooseboy
Re: (nrd) Opening Opera windows with Perl
by newrisedesigns (Curate) on Dec 26, 2002 at 17:54 UTC
Re: Opening Opera windows with Perl
by Juerd (Abbot) on Dec 26, 2002 at 17:50 UTC

    . What I'm trying to do is to open each story in a separate window within Opera.

    Create a temporary file with javascript in it.

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://222375]
Approved by IlyaM
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2021-06-25 11:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (135 votes). Check out past polls.

    Notices?