First comment is style. This is not very readable as you've posted it. Some judicious use of whitespace would make this much easier for a human to parse, without making it any more difficult for the computer.
Second, you should read the documentation on each. It has an example that shows pretty much the same idea:
You need to loop through "each" key/value rather than just the first.while (($key,$value) = each %ENV) { print "$key=$value\n"; }
Third - your info function is going to overwrite the same global time after time. Is that really what you want? Your %inf will only hold the last file found.
And finally, that last elsif will match anything. So I'm not sure why you have the "info ($phile)" outside of the if-elsif-elsif section.
In reply to Re: Assigning keys and values to a hash using arrays
by Tanktalus
in thread Assigning keys and values to a hash using arrays
by dReKurCe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |