> Hi all,
> I wonder if someone can help me. What I want to do sounds so 
> simple but I
> just cant crack it.
> I am reading in an html page and i want to change 'images/' to
> '../../images' but i am going round and round in circles.
> my code so far is this:
> 
> #!/usr/bin/perl
> ## set up for output to be sent to browser
> print "Content-type: text/html\n\n";
> ## read in mp3store.html
> if (open (INFILE, "<../../mp3store.htm"))
> {
>  foreach $line (<INFILE>)
>  {
>   $line =~ tr/images\//..\/..\/images\//
>   print $line;
>  }
> } else {
>  print "could not open mp3store.htm";
> }
> exit(0);
> 
> the line: $line =~ tr/images\//..\/..\/images\// is where I 
> am getting stuck
> everything else is working fine

$line =~ s#images/#../../images/#;

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to