Bob MacLean wrote:
>
> Trying to do string replacement inside html files. E.g., 68yrbkpg10.htm is
> to be replaced with 68yrbkpg10sr.htm. This doesn't work quite right. Also,
> where did the $t1 come from in the s// line? It is not defined earlier.
> thanks ahead of time.
>
> while (m/(\w*68yrbkpg(\d+)\.htm)/) {
> ($t2 = $t = $1) =~ tr/$1/68yrbkpg$2sr\.htm/;
> s/$t1/$t2/;
> }
don't you mean to use a s/// operator (which does string substitution),
rather than a tr/// operator (which does character substitution)?
And what's the second s/// operator for?
Wouldn't it make more sense to do this:
s/(\w*68yrbkpg)(\d+)\.htm/$1$2sr.htm/g;
rather than the whole loop above?
--
Ned Konz
currently: Stanwood, WA
email: [EMAIL PROTECTED]
homepage: http://bike-nomad.com, Perl homepage:
http://bike-nomad.com/perl
---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]