XP is just a number | |
PerlMonks |
Re: hash arrayby liverpole (Monsignor) |
on Nov 03, 2010 at 18:01 UTC ( [id://869285]=note: print w/replies, xml ) | Need Help?? |
Hi roadtest,
You have a number of issues, all of which are very minor. For one thing, note that @owner and %owner are separate things (the first is an array, the second a hash), and you don't ever declare the hash: You should also (though you didn't ask about this) check the return value from open, otherwise (as I did) you could get a confusing error message like "readline() on closed filehandle FILE at C:\test\x.pl line 10". Here's a simple fix for that: but even better than that is to use the 3-arg open statement instead of the 2-arg version, which (along with lexical filehandles) is considered better programming practice:
It might be better to break next if (split /[ ]+/)[1] !~ /oracle|sybase/ ; into multiple lines:
so that when your input file doesn't contain what you expect, or something else goes wrong, you can debug the values in @split, or the value of $split1 (which might be undefined; hence my converting it to ""). You don't need to do (keys %{$owner} (which you've done in two or three places), it suffices to do (keys %owner) to get the keys of the hash. Here's a version that runs without warnings:
Now you can focus on whether the program is working as you wish... s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|