In Perl, reference to anything is a simple scalar, and has the $ sigil. It's sometimes hard to say what kind of reference it is.

I personally prefix variable names for references with a letter, which indicates ref type. Examples:

my $aValues = [];                # arrayref
my $hValue  = {};                # hashref
my $oValue  = bless {};          # object
my $sValue  = \(my $s = 'foo');  # scalarref
...

I've seen both supporters and opponents to such notation. Do you use it? Does it have any disadvantages?

Edit
Report