How is Perl’s @INC constructed? (aka What are all the ways of affecting where Perl modules are searched for?)

What are all the ways of affecting where Perl modules are searched for? or, How is Perl’s @INC constructed? As we know, Perl uses @INC array containing directory names to determine where to search for Perl module files. There does not seem to be a comprehensive “@INC” FAQ-type post on StackOverflow, so this question is … Read more

Find size of an array in Perl

I seem to have come across several different ways to find the size of an array. What is the difference between these three methods? my @arr = (2); print scalar @arr; # First way to print array size print $#arr; # Second way to print array size my $arrSize = @arr; print $arrSize; # Third … Read more