Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What does `*` before a variable name means in Perl?

Working on some Perl and encountered the below statement however, could not gather what does the below statement means. Checked at some Perl documentation sites also like https://perldoc.perl.org/variables but couldn’t find a similar example.

*INPUT_DATA                    =\ 0;

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading