in reply to Re: Perl Packages Issue in a script.
in thread Perl Packages Issue in a script.
Here is the script that calls this packagepackage 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");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Packages Issue in a script.
by ikegami (Patriarch) on Oct 02, 2009 at 04:16 UTC |