Also, how can I make this hash accessible outside of the while loop I had it created in? Is there a way to create global variables from local ones?
At a guess, you're looking for something like this: declare the hash variable outside your loop.
my %hash; while (<>) { $hash{$_}++; } # %hash is accessible outside the while() loop print join ', ' keys %hash;
If that's not what you're looking for, post a short excerpt of your code so we can see what you mean.
--
Any sufficiently interesting Perl project will depend upon at least one module that doesn't run on Windows.
In reply to Re: Hash Question
by misterwhipple
in thread Hash Question
by perl_n00b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |