Subject:
|
Re: Strip surplus white space with Perl
|
Newsgroups:
|
lugnet.off-topic.geek
|
Date:
|
Sun, 29 Oct 2000 22:06:43 GMT
|
Viewed:
|
160 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
On Sun, Oct 29, 2000 at 10:00:13PM +0000, Christopher Lindsey wrote:
[snip]
> After reading that paragraph a while back I decided that I'd stick with
> while loops for most cases -- sometimes while debugging or modifying
> my code I don't think about this type of change, so I wouldn't necessarily
> have the presence of mind to switch from /g to a while loop. But if it's
> already in a while loop, I don't have to worry about it.
>
> Mind you, I only do this when I might access $& et al.
of course, if you're using $&, you don't care about efficiency anyway, so you might as well put your regexp in a while loop. But if you do care about speed, you'd go with the /g - otherwise, you're restarting the same regexp over a string over and over again, instead of running it once.
I love perl, btw :)
:)
--
Dan Boger / dan@peeron.com / www.peeron.com / ICQ: 1130750
<set:512_1>: Building Set (LEGO/DUPLO/LEGO PreSchool), '70
|
|
Message is in Reply To:
![](/news/x.gif) | | Re: Strip surplus white space with Perl
|
| (...) There are some days when I shouldn't touch a keyboard. I read and reread his initial posting and could have sworn that it said "It *does* matter to me which one..." I think you just went in and edited the message. ;) I guess it's one of those (...) (24 years ago, 29-Oct-00, to lugnet.off-topic.geek)
|
10 Messages in This Thread: ![Strip surplus white space with Perl -Fredrik Glöckner (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/246.gif) ![Re: Strip surplus white space with Perl -Christopher Lindsey (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: Strip surplus white space with Perl -David Eaton (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: Strip surplus white space with Perl -Christopher Lindsey (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: Strip surplus white space with Perl -Christopher Lindsey (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: Strip surplus white space with Perl -Todd Lehman (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/246.gif) ![Re: Strip surplus white space with Perl -Todd Lehman (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif)
![](/news/x.gif) ![](/news/28.gif) ![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: Strip surplus white space with Perl -Christopher Lindsey (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![You are here](/news/here.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: Strip surplus white space with Perl -Todd Lehman (29-Oct-00 to lugnet.off-topic.geek)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|