On Fri, Apr 21, 2006 at 02:54:29PM -0700, Adam W wrote:
> 
> The following does about 95% of the job:
> 
>     if (/<(.*?)>/g && !/<\!/g) {       # if it's an HTML and not a
>                                       # <!DOCTYPE or comment line...
>       s/^(.*?)"(.*?)"/\L$1\E"$2"/g;
>     }

Y'know, I was playing around with this to see if I could come up with a
reasonably elegant solution, and I noticed a problem:

Your code doesn't seem to actually work.  Am I missing something?

To test it, I stuck the substitution regex in a while loop, added a
print $_; statement, and stuck a shebang line at the top, then created a
dummy HTML file which I fed to the script.  The output looked exactly
like the input, and I didn't even use your conditional to exclude any
lines from the file.

-- 
Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]
"A script is what you give the actors.  A program
is what you give the audience." - Larry Wall

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