|
From: Paul Lalli on 2 Nov 2005 09:05 Dr.Ruud wrote: > Gunnar Hjalmarsson schreef: > > Note that the /s modifier is redundant (see "perldoc perlre"). > > I don't consider the /s modifier redundant. It was not needed in my > example, so maybe you meant "redundant here"? Redundant would be if you had something in your pattern match like: /stuff(?:.|\n)stuff/s Here, I think /s is simply extraneous. Paul Lalli
From: Gunnar Hjalmarsson on 2 Nov 2005 10:45 Dr.Ruud wrote: > Gunnar Hjalmarsson schreef: >>Note that the /s modifier is redundant (see "perldoc perlre"). > > I don't consider the /s modifier redundant. It was not needed in my > example, so maybe you meant "redundant here"? Okay, redundant (or extraneous...) here. I mentioned it because people misunderstand the meaning of it all the time, and I believe one reason for that is that "perldoc perlre" - unlike e.g. "perldoc perlop" - is the only place in the docs (to my knowledge) where its meaning is properly explained. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
From: Abigail on 2 Nov 2005 16:45 Gunnar Hjalmarsson (noreply(a)gunnar.cc) wrote on MMMMCDXLVI September MCMXCIII in <URL:news:3ss54cFpe3koU1(a)individual.net>: ** Dr.Ruud wrote: ** > Gunnar Hjalmarsson schreef: ** >>Note that the /s modifier is redundant (see "perldoc perlre"). ** > ** > I don't consider the /s modifier redundant. It was not needed in my ** > example, so maybe you meant "redundant here"? ** ** Okay, redundant (or extraneous...) here. I mentioned it because people ** misunderstand the meaning of it all the time, and I believe one reason ** for that is that "perldoc perlre" - unlike e.g. "perldoc perlop" - is ** the only place in the docs (to my knowledge) where its meaning is ** properly explained. Damian makes a good argument in PBP to always use /s and /m. I don't think it's worth raising your finger if someone uses /s or /m on a regex where it doesn't matter. It's like complaining someone uses 'use warnings' on a piece of code where it didn't matter. Abigail -- perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
From: Dr.Ruud on 2 Nov 2005 18:26 Anno Siegel schreef: > The changes by /x only affect the regex proper. The replacement part > is still an ordinary double-quotish string. OK. I am still trying to think up why it was chosen to not affect the replacement part. I have no doubt that there is a simple explanation why it is not feasible, but I just can't think it up (tired of working some very long days, but very satisfied with the results and very happy with Perl). -- Affijn, Ruud "Gewoon is een tijger."
From: Gunnar Hjalmarsson on 2 Nov 2005 20:46
Abigail wrote: > Gunnar Hjalmarsson (noreply(a)gunnar.cc) wrote on MMMMCDXLVI September > MCMXCIII in <URL:news:3ss54cFpe3koU1(a)individual.net>: > ** Dr.Ruud wrote: > ** > I don't consider the /s modifier redundant. It was not needed in my > ** > example, so maybe you meant "redundant here"? > ** > ** Okay, redundant (or extraneous...) here. I mentioned it because people > ** misunderstand the meaning of it all the time, and I believe one reason > ** for that is that "perldoc perlre" - unlike e.g. "perldoc perlop" - is > ** the only place in the docs (to my knowledge) where its meaning is > ** properly explained. > > Damian makes a good argument in PBP to always use /s and /m. What's PBP? > I don't think it's worth raising your finger if someone uses /s or /m > on a regex where it doesn't matter. It's like complaining someone uses > 'use warnings' on a piece of code where it didn't matter. A better parallel IMO is that it's like complaining when someone calls a function using '&' without knowing the implications of doing so. It 'works' most of the time, but not always... (Not saying that Dr. Ruud doesn't know the implications of using the /s modifier. It's now obvious that he does.) -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |