CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
regular expr question

 



menchen
User

Feb 6, 2001, 12:16 AM

Post #1 of 3 (195 views)
regular expr question Can't Post

please see the attachment for the question.

i am using some html code in my question,
and it can not be properly viewed with this html
forum.

-jason



japhy
Enthusiast

Feb 6, 2001, 12:27 AM

Post #2 of 3 (193 views)
Re: regular expr question [In reply to] Can't Post

You want to be using (.*), instead of (.)*.

And there's NO reason to test for a regex before doing a substitution. It slows the program down needlessly.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author


menchen
User

Feb 6, 2001, 1:54 PM

Post #3 of 3 (182 views)
Re: regular expr question [In reply to] Can't Post

thanks so much japhy,

so are you saying that i don't have to test it: if ($temp =~ /something/)
before i actually do the replacement?

if i want to replace, i just have to do $temp =~ s/something/otherthing/; to every line of the file?

-jason



 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives