package Packagetest; BEGIN{ print"You are using Packagetest\n"; } sub ReadFile { use strict; use warnings; my ($fn) = @_; open(my $fh, '<', $fn) || die "cannot read the file: $!"; while (<$fh>) { chomp; my @tokens = split /\|/; print "Wrestlername: $tokens[0]\n"; print "Crowdreaction: $tokens[1]\n"; print "Specialmove: $tokens[2]\n\n"; } } return 1; END{ print"Thank you for using the package\n"; } #### #!/usr/bin/perl -w use strict; use warnings; require 'Packagetest.pl'; Packagetest::ReadFile("datafile");