Note hbm's use of strictures - always use strictures (use strict; use warnings;).
Also notice that hbm used the three parameter version of open and checked the result of the open by using very low precedence or rather than high precedence || which checks to see if the last parameter is true or not (not what you are wanting I suspect).
There are a couple of changes I'd make though. Use local to localize the effect of changing special variables ($/ in this case) and use a lexical file handle:
...
local $/="\n\n";
open my $inFile, "<", $file or die "Unable to open $file: $!";
while(<$inFile>){
...
Perl's payment curve coincides with its learning curve.
|