package Foo; use strict; my $Bar = "Baz"; sub new { return bless { BAR => $Bar }; } package main; my $Foo = new Foo(); print $Foo->{'BAR'};