Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Idiomatic Perl > Item 16. Know Perl’s other default arguments

Item 16. Know Perl’s other default arguments

$_ is not the one-and-only default argument in Perl. There are several others. Just as with $_, reading and referring to the documentation is always your best guide.

@_ as a default

Inside a subroutine, shift uses @_ as a default argument. When you shift with no arguments in your subroutine, you are really pulling the left-most element from @_:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint