http://www.perlmonks.org?node_id=1008114

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.com

In 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?