go ahead... be a heretic PerlMonks

### Re^4: P2P Golf: MoleSter

by dragonchild (Archbishop)
 on Dec 20, 2004 at 15:06 UTC ( #416199=note: print w/replies, xml ) Need Help??

in reply to Re^3: P2P Golf: MoleSter

>> You cannot use open F,pop; because there are 3 args coming in, not 2.

Huh?!?

The function in question is

```sub g{
open(F,'<',\$_[1])&&&s(\$_[0],\$a,"e\$_[1]",<F>);
close F
}

On first glance, it looks like you can replace \$_[1] with pop for a 2-character savings. However, look at where g() is called - &\$3(\$2,\$4,\$'). There are three scalars in @_, not two. The fact that g() only uses two is irrelevant.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^5: P2P Golf: MoleSter
by blazar (Canon) on Dec 21, 2004 at 14:39 UTC
>> You cannot use open F,pop; because there are 3 args coming in, not 2.

Huh?!?

The function in question is

```sub g{
open(F,'<',\$_[1])&&&s(\$_[0],\$a,"e\$_[1]",<F>);
close F
}

On first glance, it looks like you can replace \$_1 with pop for a 2-character savings. However, look at where g() is called - &\$3(\$2,\$4,\$'). There are three scalars in @_, not two. The fact that g() only uses two is irrelevant.

Again, in my OP it was implicit that one should change (if possible/convenient) the way subs are actually called... it was meant to be a very generic cmt.

Create A New User
Node Status?
node history
Node Type: note [id://416199]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2018-06-22 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should cpanminus be part of the standard Perl release?

Results (121 votes). Check out past polls.

Notices?