in reply to Re: •Re: Editing Files In Place
in thread Editing Files In Place

the whole ARGV/STDIN
Excuse me? There's no use of STDIN in that program. An empty diamond is the same as <ARGV>, not <STDIN>.

And beginning Perl hackers who confuse the two will eventually get burned. My rule is to never use <> (aka <ARGV>) if you ever print some kind of prompt, and I flunk any use to the contrary in code review. Work it out for yourself to see why. The proper use for interaction where you prompt and read input is <STDIN>.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: &bull;Re: Re: •Re: Editing Files In Place
by belg4mit (Prior) on Jun 13, 2002 at 00:21 UTC
    Well yes, I new it was the ARGV filehandle, but I tend to think of waka waka as STDIN. If @ARGV is empty waka waka reads from STDIN.

    (I'd even contemplated writing magic ARGV but decided against it ;-)

    --
    perl -pew "s/\b;([mnst])/'$1/g"

      but I tend to think of waka waka as STDIN
      And that's exactly the kind of thinking I'm arguing against.

      The empty angle-brackets have precisely one function: to be used to process the files specified on the command line to create a filter written in Perl. That it happens to read standard input if no filenames are specified or if a lone dash is included, is merely a special case, not the typical case. So, I'm working everywhere to kill the bad memes, and yours is an example of that.

      -- Randal L. Schwartz, Perl hacker