How To Enable Variable References in Perl While Using Strict

Author: , August 4th, 2019

I wanted to call a sub-routine based on a variable in Perl, like this:

but it failed because of use strict:

To enable using a variable as a reference, simply specify that to Perl:

How To Declare DOCTYPE And Encoding Using CGI.pm And PERL

Author: , May 31st, 2011

I found myself needing a specific doctype the other day and this is what I found… First, get the correct doctype string from the W3C website list. Then, simply use -dtd to specify it to CGI.pm during the call to start_html:

In addition, use -encoding to specify the character set for XHTML. It defaults […]

How To Use Tie::IxHash In Perl Strict Mode

Author: , October 17th, 2010

The following syntax FAILS: [code] use strict; my %hash; use Tie::IxHash; tie %hash, Tie::IxHash; [/code] The SOLUTION is to wrap the Tie::IxHash declaration in single quotes. Parentheses added for better syntax: [code] tie (%hash, ‘Tie::IxHash’); [/code]