http://www.perlmonks.org?node_id=11108263


in reply to Unusual variable declaration

The first line declares an alias $var for the global variable $var in the current package. The second line makes it an alias of the $var variable in the main package.

Therefore, it only makes sense to use this in a package different to main. For example:

#!/usr/bin/perl use warnings; use strict; our $var; $var = 42; { package My; our $var; *var = \$main::var; print $var, "\n"; $var = 84; } print $var, "\n";

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]