use strict; use warnings; use File::Basename qw(dirname); use Cwd qw(abs_path); use lib dirname(dirname abs_path $0); use Library; print STDOUT $hash{"key"} . "\n"; exit 0; #### package Library; use strict; use warnings; use Exporter qw(import); our @EXPORT = qw( %hash ); our %hash = ( "key" => "Hello world!" ); 1; #### package Library2; use strict; use warnings; our @EXPORT = qw( return_string ); sub return_string { return "Hello embedded library"; } #### package Library; use strict; use warnings; use Exporter qw(import); our @EXPORT = qw( %hash ); use File::Basename qw(dirname); use Cwd qw(abs_path); use lib dirname(dirname abs_path $0); use Library2; package Library2; our %hash = ( "key" => return_string() ); 1;