Perl's quote-like operator qw() creates a word list from barewords, while square brackets [] can be used to create references to anonymous arrays. Now, I was wondering if Perl provides a way to somehow abbreviate this:
my $aref = [qw( a b c )];
using something like a non-existent qa() operator:
my $aref = qa( a b c );
I've been using qw() and [] together quite a lot recently, and all I want is to reduce cluttering.
Note: This is not what I'm looking for:
my @a = \( qw( a b c ) );
Not core Perl, but check out Syntax::Feature::Qwa
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With