package Packagetest; BEGIN{ print"You are using Packagetest\n"; } sub ReadFile { $file = @_; open(DATA,"$file") || die "cannot read the file: $!"; while () { chomp; @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 require 'Packagetest.pl'; Packagetest::ReadFile("datafile");