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: (nrd) Opening Opera windows with Perl
by newrisedesigns (Curate) on Dec 26, 2002 at 17:54 UTC
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: 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.