Mega Code Archive

 
Categories / Perl / Language Basics
 

The $_ Scalar Variable

#The $_ is used as the default pattern space for searches and to hold the current line.  #functions such as chomp, split, and print use $_ as an argument.  $_ = "Donald Duck"; print;   # The value of $_ is printed