Well, you could just use qx():
qx(wget -q -nv -U "sonicbox/imtuner_build81 ($2)" 'http://mail.sonicbox.com:'$1'/tuner/SetZBand?UserID=testuser;StationNumber='$3')
Or back-quotes (``):
`wget -q -nv -U "sonicbox/imtuner_build81 ($2)" 'http://mail.sonicbox.com:'$1'/tuner/SetZBand?UserID=testuser;StationNumber='$3'`
Both of those will execute the external command and return the output as an array (1 line/index) or a scalar (all in one line with embeded newlines). See here for more information on qx() and ``.
However, if you're interested in portability (not everyone may have wget installed on their system or have access to it) and this is for more than just a quick-and-dirty, one-use script, you might consider using the LWP module. LWP::Simple should do what you're looking to do with wget, or you can use LWP::UserAgent for more control.
Your call. =)
bbfu
| [reply] [d/l] [select] |
If you're doing this in Perl anyway, why not do it the "correct" way and retrieve your URL via LWP:
use LWP::Simple
my $data = get("http://www.example.com/");
It looks like you're going through a lot of headache getting things quoted on the command-line, when it's reasonably unnecessary. | [reply] [d/l] |
#!/usr/bin/perl -w
use strict;
my $result = `your shell command here`;
parseResult ($result);
sub parseResult {
#do your magic here
}
NoteThose are supposed to be backticks around "your shell command here", but for some reason today's mozilla build doesn't seem to display them as such. Are they showing up correctly for anyone?
BlueLines
Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary. | [reply] [d/l] |