in reply to Quickie code question

The pattern would probably be easier to understand at a glance (and less dependent on the host's character set) if it were written:

$line =~ s/[ \t]*\r$//;

Make sense to you now?

Replies are listed 'Best First'.
Re: Re: Quickie code question
by arhuman (Vicar) on Mar 28, 2001 at 21:55 UTC
    or even

    $line =~ s/\s*\r$//;


    "Only Bad Coders Badly Code In Perl" (OBC2IP)

      Right. But the author didn't say he wanted to remove formfeeds. <g>

        He did say "whitespace" though =)

        Philosophy can be made out of anything. Or less -- Jerry A. Fodor