Re: what "shift" does, if not "$_ = shift;" ?
- From: Peter Makholm <peter@xxxxxxxxxxx>
- Date: Thu, 29 Nov 2007 18:35:00 +0000
devphylosoff <devphyl@xxxxxxxxx> writes:
the first line in one of my subroutine is
shift;
This will just discard the first argument from @_. Not really usefull
in you functions as you don't use @_ later on.
but in this case i cannot use $_ and think $_ = shift;
why ?
If you think that 'shift' in void context is equal to '$_ = shift'
then you thinking is wrong. Why you think that I'm not able to tell,
the documentation for the shift function doesn't seem to imply this.
The documentation says that shift works on the @_ array if the
argument to shift is omitted. But it doesn't say anything about shift
doing other special things.
entire code:
If this is you entire code, then I have no idea what you expect. You
define some variables and two functions, but use neiter.
//Makholm
.
- Follow-Ups:
- Re: what "shift" does, if not "$_ = shift;" ?
- From: devphylosoff
- Re: what "shift" does, if not "$_ = shift;" ?
- References:
- what "shift" does, if not "$_ = shift;" ?
- From: devphylosoff
- what "shift" does, if not "$_ = shift;" ?
- Prev by Date: Errors using installing perl modules
- Next by Date: Re: what "shift" does, if not "$_ = shift;" ?
- Previous by thread: what "shift" does, if not "$_ = shift;" ?
- Next by thread: Re: what "shift" does, if not "$_ = shift;" ?
- Index(es):
Relevant Pages
|