Recommend this page to Google

Perl $_ vs. $_[]

For a beginner, Perl can be a frightening language. This is largely due the numerous special variable used in perl. Once a programmer understands the special variables, he begins to appreciate the beauty and strength of Perl.

The special variable $_

$_ functions as a default variable. $_ needs to be initialized implicitly or explicitly before it can used.

$_ = "default value";

print;  # this will print the value of $_


Syndicate content