From:                   david wright <[EMAIL PROTECTED]>

> I have seen Ex #1 "corrected" (as being more well written) to Ex #2.
> In this case it is just being passed a $ but the data being passed was
> irrelevant. (though not a ref) I still don't see why, i guess i don't
> fully understand "shift". Any light shedder's appreciated, thanks : -)
> 
> EX #1:
> sub makeArray{
> my @array = @_;
>          foreach(@array){
>          print $_  . "\n";
>           }
>    }
> 
> 
> Ex #2
> sub makeArray{
> my @array = shift @_;
>          foreach(@array){
>          print $_  . "\n";
>           }
>    }
> 

The second example is nonsense. The

        my @array = shift @_;

will pull the first parameter and store it in ONE ELEMENT array 
@array. The other parameters will stay in @_.

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to