I was pondering on the question of whether I could make an array ref in one line in Perl. Sort of like you would define an array. I would normally do the following:
#!/usr/bin/perl
# your code goes here
use warnings;
use strict;
use Data::Dumper;
my @array = qw(test if this works);
my $arrayref = \@array;
print Dumper($arrayref);
My thought was you should be able to just do:
my $arrayref = \(qw(test if this works);
This, however, does not work the way I expected. Is this even possible?