in reply to Re: •Re: perl 1-liner to join a list?
in thread perl 1-liner to join a list?

This is how I try to remember this.  push takes a list as argument and hence  $_ cannot be taken as a default argument for this.

Update But then as Smylers pointed out  print also takes a list of arguments but still takes $_ as default argument when there is none. puzzling ??

-T

use perl; use strict;

Replies are listed 'Best First'.
Re: • perl 1-liner to join a list?
by Smylers (Pilgrim) on Nov 12, 2003 at 16:04 UTC
    This is how I try to remember this. push takes a list as argument and hence $_ cannot be taken as a default argument for this.

    But print takes a list of things too (and prints them, joined by $,) yet uses $_ as the default, so that doesn't work as a distinguishing feature.

    Smylers