Doozer has asked for the wisdom of the Perl Monks concerning the following question:
I have scoured the Perl user guides and beginner tutorials and couldn't find an answer to my question (This is just a disclaimer in case anyone tells me to 'read the fine manual' ;).
I have a few scripts that interact with each other via system commands. One script passes a website url to another script using the following system command:
perl getrequest.pm http://www.google.comIn the 'getrequest.pm' script I have defined the following variable:
my $url = $ARGV[0];I have used $ARGV[0] because later on the script gets passed another argument as $ARGV[1]
I am trying to then split the $url variable further so that I can get the bare host name 'google.com' for example (I need both the bare host name and the full url for further processing). I have tried a number of ways using the split command but it doesn't seem to be working. I would really appreciate some advice and whether split is the right function to use or not?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to split $ARGV[0] variable. Can it be done?
by space_monk (Chaplain) on Dec 10, 2012 at 15:47 UTC | |
Re: Unable to split $ARGV[0] variable. Can it be done?
by McDarren (Abbot) on Dec 10, 2012 at 15:50 UTC | |
by Doozer (Scribe) on Dec 10, 2012 at 16:03 UTC | |
by McDarren (Abbot) on Dec 10, 2012 at 16:36 UTC | |
Re: Unable to split $ARGV[0] variable. Can it be done?
by Your Mother (Archbishop) on Dec 10, 2012 at 19:58 UTC | |
by Doozer (Scribe) on Dec 11, 2012 at 09:12 UTC | |
by Your Mother (Archbishop) on Dec 12, 2012 at 03:55 UTC | |
Re: Unable to split $ARGV[0] variable. Can it be done?
by Utilitarian (Vicar) on Dec 10, 2012 at 15:16 UTC | |
Re: Unable to split $ARGV[0] variable. Can it be done?
by Anonymous Monk on Dec 10, 2012 at 15:15 UTC |