in reply to Re: Newbie: parentheses, map, etc.
in thread Newbie: parentheses, map, etc.

Otherwise, it thinks that you were going to say something like -s <STDIN> but forgot the closing >.

Ah, okay, that makes sense.

I also understand where I was in error with the regex solution. Funny that I could have just put "    $_\n" :) I guess I didn't think of it because when I think map, I think some sort of function call or active statement should be going on, so the basic string literal eluded me.

So not explicitly writing the $_ is generally bad? :(

Thanks everyone!

Replies are listed 'Best First'.
Re^3: Newbie: parentheses, map, etc.
by kyle (Abbot) on Mar 04, 2008 at 05:10 UTC

    I more or less agree with a rule of thumb for $_ in Perl. If you have to use $_ explicitly, it might be better to use something else. I make exceptions for map and grep, though. I pretty much always expect $_ to appear there. In this specific case, I don't think it hurts anything to stick in an explicit $_ (but I'd probably like it better without). You could achieve that, if you really want, by reversing the test: grep 10_000 > -s, @ARGV.

    All just my opinions, of course.