Syntactic Confectionery Delight | |
PerlMonks |
Re: need an array ref from grepby orderamidchaos (Initiate) |
on May 29, 2013 at 00:41 UTC ( [id://1035754]=note: print w/replies, xml ) | Need Help?? |
I know this is super old at this point, but for anyone else who references such things in their searches, here's another (IMHO cleaner) way to write greps... my $arr_ref = [ grep {/[[:alpha:]]/} keys(%h) ];You can also assign the result to a dereferenced variable: my $arr_ref; @$arr_ref = grep {/[[:alpha:]]/} keys(%h);
In Section
Seekers of Perl Wisdom
|
|