in reply to Re: Creating variables while using 'strict'
in thread Creating variables while using 'strict'

Just want to expand a little bit on what pfaut said about $$fieldname.

First let's look at a piece of correct code:
use strict; $$a = 1;# you cannot say my $$a ;-) print $$a; #this print out 1; print $a; #this print out SCALAR(0xnnnnnnnn)
This is perfectly correct, as I just created a hard reference, which is allowed. The next piece is wrong.
use strict("refs"); my $a = "abc"; my $abc = 1; print $$a;
This is wrong, as I attempted to create symbolic reference, which is disallowed when you have strict("refs") turned. As a best practice, symbolic reference should be generally disallowed, as it is the source of many bugs in Perl scripts.