Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's good practice for Perl special variables?

Tags:

perl

First off, does anyone have a comprehensive list of the Perl special variables?

Second, are there any tasks that are much easier using them? I always unset $/ to read in files all at once, and $| to automatically flush buffers, but I'm not sure of any others.

And third, should one use the Perl special variables, or be more explicit in their coding. Personally I'm a fan of using the special variables to manipulate the way code behaves, but I've heard others argue that it just confuses things.

like image 663
Justin Avatar asked Nov 28 '22 01:11

Justin


1 Answers

They are all documented in perlvar.

Note that the long names are only usable if you use English qw( -no_match_vars ); first.

like image 109
Powerlord Avatar answered Nov 30 '22 23:11

Powerlord