JayBee has asked for the wisdom of the Perl Monks concerning the following question:
Basically I want the file that readsopen(FILE, "<file.htm") @file = <FILE>; close(FILE); @check_links = ('href="', 'src="'); @new_file = grep { foreach $item (@check_links) { map($_ . "../"; if ($item =~ /$_/, @page) } #end_foreach# } #end_grep# print @new_file;
to appear asfoo <a href="home.htm"><img src="image.gif"></a> foo
I know this may be way off, but that's why I would like your help. Is there a module to do this perhaps? Thank you very much in advance.foo <a href="../home.htm"><img src="../image.gif"></a> foo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Altering an array with grep & map
by gaal (Parson) on Jan 18, 2005 at 11:25 UTC | |
by JayBee (Scribe) on Jan 18, 2005 at 23:50 UTC | |
by gaal (Parson) on Jan 19, 2005 at 09:03 UTC | |
|
Re: Altering an array with grep & map
by Zaxo (Archbishop) on Jan 18, 2005 at 11:30 UTC | |
|
Re: Altering an array with grep & map
by holli (Abbot) on Jan 18, 2005 at 11:18 UTC | |
|
Re: Altering an array with grep & map
by TedPride (Priest) on Jan 18, 2005 at 14:29 UTC | |
|
Re: Altering an array with grep & map
by ysth (Canon) on Jan 18, 2005 at 12:56 UTC |