Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; @_ = qw( hello world ); ### prints everything in @ARGV but nothing in @_ while(my $d = shift) { print "$d\n"; } ### prints nothing because @ARGV is empty ### doesn't even print @_ contents while(my $n = shift) { print "$n\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: @_ the default variable?
by arturo (Vicar) on Sep 14, 2001 at 22:26 UTC | |
by dga (Hermit) on Sep 14, 2001 at 23:12 UTC | |
Re: @_ the default variable?
by wog (Curate) on Sep 14, 2001 at 22:35 UTC | |
by Anonymous Monk on Sep 14, 2001 at 22:50 UTC | |
by wog (Curate) on Sep 14, 2001 at 23:04 UTC | |
by John M. Dlugosz (Monsignor) on Sep 15, 2001 at 02:41 UTC | |
by blakem (Monsignor) on Sep 15, 2001 at 02:50 UTC | |
by wog (Curate) on Sep 15, 2001 at 03:14 UTC | |
Re: @_ the default variable?
by chromatic (Archbishop) on Sep 14, 2001 at 22:32 UTC | |
Re: @_ the default variable?
by HamNRye (Monk) on Sep 15, 2001 at 00:18 UTC | |
Re: @_ the default variable?
by archen (Pilgrim) on Sep 15, 2001 at 01:54 UTC | |
Re: @_ the default variable?
by n0mad (Initiate) on Sep 16, 2001 at 17:12 UTC |