#! perl -slw use strict; package fred; sub new { my $class = shift; return bless { @_ }, $class; } sub method { my $self = shift; return keys %{ $self }; } return 1 if caller; package main; our $MAX //= 10; print 'Max: ', $MAX; my $o = fred->new( 'a' .. 'z' ); print for $o->method; __END__ C:\test>perl -s fred.pm -MAX=123 Max: 123 w e a m s y u c k q g i o