Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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
Domain Nodelet?
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 pondering the Monastery: (1)
As of 2023-10-01 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?