Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to parse the info and get this:http://riverserver/dir1/dir2/index.html http://riverserver/dir1/dir2/index.html http://perlmonks.org/index.pl http://webserver.company.serv/Adir/Bdir/thePage.cfm http://riverserver/dir1/dir2/index.html http://webserver.company.serv/Adir/Bdir/thePage.cfm
I think I have a problem with how to parse the links and add a hash but not sure if I am doing this right??riverserver = 3 perlmonks.org = 1 webserver.company.serv = 2
use strict; my $link1 = 'http://perlmonks.org/index.pl'; my $link2 = 'http://riverserver/dir1/dir2/index.html'; #more links etc... $link1 =~ s/http\:\/\///; $link2 =~ s/http\:\/\///; my @link1 = split /\//, $link1; my @link2 = split /\//, $link2; print "$link1[0]\n"; print "$link2[0]\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing to get server info
by ctilmes (Vicar) on Jul 15, 2003 at 13:18 UTC | |
by Anonymous Monk on Jul 15, 2003 at 16:02 UTC | |
|
Re: Parsing to get server info
by gjb (Vicar) on Jul 15, 2003 at 13:14 UTC | |
by l2kashe (Deacon) on Jul 15, 2003 at 14:29 UTC |