package Foo; use strict; use Data::Dumper; use Exporter; our ($VERSION,@ISA,@EXPORT,@EXPORT_OK); $VERSION = 0.99; @ISA = qw(Exporter); @EXPORT = @EXPORT_OK; @EXPORT_OK = qw(new test); sub new(){ my $self = {}; $self->{data} = {}; $self->{data}->{start_url} = "https://www.w.com/home.html"; bless $self; } sub test(){ my $self = shift; # print $self->{data}->{start_url}; # print Dumper($self); print Dumper($self->{data}); }