I was wondering about the "shift" inside a subroutine.

I have never used it.  What is the purpose of it been there?

Thanks in advance,

Nestor :-)


----- Original Message -----
From: "Stephen.Hurley" <[EMAIL PROTECTED]>
To: "'Bruce Ambraal'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 20, 2002 6:58 AM
Subject: RE: What is the value of @_4_[0], and $return_me? (see below)


> Well, for a start, you have a spelling mistake in there...
>
> my $retun_me = shift; - probably should be - my $return_me = shift;
>
> Secondly, what exactly are you trying to do with this code ? I don't know
> too much about perl, but I think the assignment:
> @_ = @arr;
> ....might be a little suspicious. I normally grab the arguments passed to
my
> sub routine from @_ , I don't usually assign *to* it.
> In the end, it seems like this subroutine should return the first value in
> @arr, which is 0.
>
> Does any of this help ?
>
> -----Original Message-----
> From: Bruce Ambraal [mailto:[EMAIL PROTECTED]]
> Sent: 20 February 2002 14:38
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: What is the value of @_4_[0], and $return_me? (see below)
>
>
> Hi
>
> 1. (see subject)
> 2. Explain  lines 3 , 4
> 3.Why does'nt this coding return anything2
>
> sub routine {
> my @arr = (0, 'a' 1, 'b');
> @_ = @arr;
> my $retun_me = shift;
> return( $return_me )
> };
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to