Because chomp operates on whatever the input record separator is, so that it does the right thing when you do perl -Osomething_else.
Unfortunately, $/ doesn't take a regexp, so you can't say "local $/ = qr/\r?\n/" or something like that. This is where the funny comment about awk is in perlvar. On Jan 21, 2008 4:45 PM, Peter Gordon <[EMAIL PROTECTED]> wrote: > And since I started, I have another suggestion. > > I normally work on Linux, and have to process files from from Other > Operating Systems (tm), where the line ending is \r\n. > > Why can't chomp do what I want. Which is to say, delete either \r\n or > \n - whatever happens to be at the end of the line. I know I can use a > regex, but for something as simple as just removing line endings, one > would have thought there would be a nicer way to do it. > > Peter > > > > _______________________________________________ > Perl mailing list > [email protected] > http://perl.org.il/mailman/listinfo/perl > -- Gaal Yahas <[EMAIL PROTECTED]> http://gaal.livejournal.com/ _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
