Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

RE: Extract and modify IMG SRC tags in an HTML document.

by johncoswell (Acolyte)
on Apr 27, 2000 at 18:01 UTC ( #9399=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open FILE,"filename";
    read FILE,$file,100000;
    close FILE;
    
  2. or download this
    @lines = split(/\<IMG/,$file);
    
  3. or download this
    $newfile = shift @lines;
    
  4. or download this
    foreach $line (@lines) {
      $pos = index($line,'>');
    ...
      $tag =~ s/SRC\=\"(.*?)\"/SRC\=\"$newurls{$1}\"/gi;
      $newfile .= $tag . $restofline . "\n";
    }
    
  5. or download this
    print $newfile;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://9399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-09-20 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (155 votes), past polls