Since it's not documented in perlvar, I don't think it's for particular use. I think that FunkyMonk's reply is making sense. I also got the same impression upon reading about symbol table in perlmod and perlref.
If there is no current use, would anyone care to suggest what %_ might be used for?
Well, you can use it as you will normally use hash. Initialize it, assign elements to it, get a value from a key. Since it's sort, it's also perfect for golf. And it can also be confusing so one may use it in obfucasted code. You can use it to alias a hash variable with some lengthy you'd be tried to type it over and over.
Additionally, with the aliasing, you can alias other sigils at once. But, by using _ you're likely to get into problem.my %hash_variable_with_not_actually_that_long_name = (one => 1); print $hash_variable_with_not_actually_that_long_name{one}, "\n"; *_ = \%hash_variable_with_not_actually_that_long_name; print $_{one}, "\n"; # output 1 1
$_ = 2; print $_, "\n"; *_ = *hash_variable_with_no_actually_that_long_name; print $_{one}, "\n"; print $_, "\n"; # output 2 1 (empty, with 'uninit' warnings under -w)
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
In reply to Re: Does %_ have a function or is it just for fun?
by naikonta
in thread Does %_ have a function or is it just for fun?
by larard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |