Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use qx[] with a variable? 5

Status
Not open for further replies.

john99999

Instructor
Apr 29, 2005
73
0
0
US
$do="wget -O so.txt cnn.com/index.html";
$http=qx[$do];

This does not insert anything in so.txt.
 
It looks OK. I'm assuming wget -O so.txt cnn.com/index.html works OK from the command line, and it's not a proxy or firewall problem?
 
Really?

qx executed the $do string in your perl script?

Can you paste the full code? Mine is not working.
 
Hi John

Can you post EXACTLY what you have?


Kind Regards
Duncan
 
I copied and pasted exactly what you have there and it downloaded a copy of the cnn page into `so.txt'. As steve suggested, does the `wget' command work from the command line? That'd be the first thing to check.
 
Can someone tell me what qx means i searched the web and it just seems to me as though it's something to do with quotes, q, qq, qw, qx.

I'm confused why qx executed anything except a quotation mark function, doesn't the wget do the executing.

Also can this wget function/command be used for RSS services or is there a specific perl command to get the feed.

Also can i create an RSS file for others or do i need to be running some form of RSS service on the server.

Regards,
1DMF
 
Code:
my @lines = qx[cmd];
qx[cmd] returns an array consisting of one entry for each line of standard output produced by cmd. So in the example above, if we just did
Code:
my @html = qx[wget cnn.com/index.html];
we'd get the output of the wget directly into our array, instead of using an intermediary file.
 
Cool, thanx for explaining.

I take it this will only grab text files and place each line into an array.

Can wget be used in PHP, the reason i ask is I run a top 40 charts, one of my radio associates has a link to my site, but we want to develope it so they can have like a notice on their site with details of the tunes as they change position, like a news buletin.

They asked me if i could supply an RSS feed (what ever that is) and I'm trying to understand possible ways to create an information file that they can use for this purpose.

It seems possible that I could create a text file with the current details and they could use wget to obtain the file.

Or can someone point me in the right direction on this RSS thing or if my idea is possible using wget, but their site is written in PHP so the wget function needs to work in PHP if I go down this route.

All help greatly appreciated.
1DMF
 
RSS-"Really Simple Syndication", an XML feed from your site to all your affiliates.

They could use LWP, or to make requests off your site with a username/password

--Paul

cigless ...
 
cheers paul,

So would I write a script which they call using LWP or or do i just create an XML file (which is just a flat text file so why make it XML) and they then obtain the XML with those commands.

What do I need to use (module wise) to create and RSS XML feed?

So many questions, isn't programing fun!

1DMF
 
Top man - thanks - have another star!
 
damn - it won't let me!

**********************************************************************************************************************

There have some of those instead!
 
Thanks ishnid, very hospitable of you, have one yourself!
 
a veritable star fest soitis, cheers
--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top