Opening new browser windows using Perl


From my Perl program I want to open several new browser windows and load different HTML pages, whose URLs I have.
How can this be done?
leoleoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

helverCommented:
print <<Opens;

<SCRIPT LANGUAGE="JavaScript">

<!--

window.open(\"$url1\", window1);
window.open(\"$url2\", window2);

// -->

</script>

Opens
;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jhurstCommented:
I would agree with the above except that it does have the problem that it is not really a perl solution and does require that the user has JS enabled.  But, I have nothing better to suggest.
0
leoleoAuthor Commented:

 I have tried this. But there was a problem when I tried reading the URLs from an array. The array has some values like,
 @urls = ('url1', 'url2', 'url3');

 Instead of giving separate window.open() statements, I want to use a loop inside the Javascript. The number of urls in the array may vary depending on the input from the html.
 
 How can this be done?
0
ozoCommented:
print <<Opens;

<SCRIPT LANGUAGE="JavaScript">

<!--

@{[map {qq{window.open("$_", window}.(/(\d+)/,$1).");\n"} @urls]}

// -->

</script>

Opens
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.