On Tue, Aug 08, 2000 at 08:53:30PM -0400, Dan Sugalski wrote:
> On Tue, 8 Aug 2000, Michael Mathews wrote:
> 
> > Dan Sugalski said:
> > > > > * Do we even want to allow after-the-fact chomps, or do it
> > automagically
> > > >at read time?
> > > "Yes" is rather ambiguous.
> > 
> > To clarify: "Yes", we (I) want to allow after-the-fact chomps. As you
> > alluded to yourself there are times when you may want to chomp strings that
> > were not read from files, therefore there would be no "read time".
> 
> Just because we can do it now doesn't necessarily mean it's the right
> thing to do. Arguably anything you use chomp on that didn't come from a
> filehandle really ought to be run through a regex.

Unless you set $\, calling chomp is bad news anyway (in a module) because
it may not do what you want. And if you are going to write

 { local $\ = "\n"; chomp($str); }


you may as well write

  $str =~ s/\n$/s;

Graham.

Reply via email to