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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 1. The Basics of Perl > Item 5. Know your variable namespaces

Item 5. Know your variable namespaces

There are seven separate kinds of package variables or variable-like elements in Perl: scalar variables, array variables, hash variables, subroutine names, format names, filehandles, and directory handles.

Each of these different kinds of package variables has its own namespace. Changing the value of one kind of variable does not in any way affect the value of another kind of variable with the same name. For example, the scalar variable $a is independent of the array variable @a:


  

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