Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does * before a Perl variable name mean?

Tags:

perl

What does the Perl statement below mean?

*INPUT_DATA                    =\ 0;

I checked some Perl documentation sites also like https://perldoc.perl.org/variables, but I couldn't find a similar example.

like image 252
Krishna Oza Avatar asked Mar 30 '26 04:03

Krishna Oza


1 Answers

In short, * denotes a "typeglob", which is an internal type holding the values of all global variables of the given name. It's still sometimes used for filehandles in older code or to create aliases.

See perldata for the explanation of typeglobs, and also see the links recommended at the end of the page, i.e. perlvar, perlref, perlsub, and perlmod.

like image 55
choroba Avatar answered Apr 02 '26 13:04

choroba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!