package xyz; use strict; use warnings; require 5.008; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(sub1); our @EXPORT_OK = qw(@array); open my $fh, '<', "qwerty.txt" or die "Cannot open file: ($!)"; our @array = <$fh>; sub sub1 { my $text = shift; print "Text: $text\n"; }