>> > #!/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\//
>>
>> $line =~ s/images\//\.\.\/\.\.\/images/g;
>
> Leaning toothpicks! You don't need to escape the '.' on the
> replacement
> string side because they are literal '.' characters there. Changing
> the
> delimiter to something other than '/' will eliminate the need to
> escape
> the '/' characters as well.

Yes, as I saw in your post. As you say though, if one does not need to
escape the '.'s on the replacement side, because they are literal,
should the '\' not be literal as well?

Note that remembering the delimiter change is much better, but I did
not post until I verified the string working. I find it nice to post,
then have someone correct you into using a much cleaner, less noisy
type syntax.

Tks ;o)

Steve

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



-- 
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