automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl Bug?


From: Russ Allbery
Subject: Re: Perl Bug?
Date: 01 Feb 2001 15:23:05 -0800
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

akim <address@hidden> writes:

>  sub scan_autoconf_config_files
>  {
> +    print STDERR "=>> @_\n";
> +    print STDERR "==>> $_\n";

Why do you expect $_ to contain anything in particular at this point?
You've not assigned anything to it in this sub.  $_ is a completely
separate variable from @_; they're utterly unrelated.

The arguments to a sub appear in @_.

Perhaps the point of confusion is that accessing a particular argument in
@_ uses the syntax $_[0]?  But $_[0] is completely separate from $_.
Scalar variables and array variables are in separate namespaces in Perl,
just like struct tags and variable names are in separate namespaces in C.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]