Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Pathologically Eclectic Rubbish Lister

Comment on

Hi, When writing subroutines, I notice in the docs that usually a "my $var = shift;" idiom is used if the sub only expects one input, and a "my ($v1,$v2,$v3) = @_;" kind of idiom for multiple inputs. Why use shift, though? Or, put another way, why not always use @_?

In reply to shift vs @_ by Zadeh

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (8)
    As of 2014-03-15 19:29 GMT
    Find Nodes?
      Voting Booth?

      Have you used a cryptocurrency?

      Results (321 votes), past polls