title: Create an Array Ref in one line in Perl
body: <p>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:</p>
  
  <pre><code>#!/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);
  </code></pre>
  
  <p>My thought was you should be able to just do:</p>
  
  <pre><code>my $arrayref = \(qw(test if this works);
  </code></pre>
  
  <p>This, however, does not work the way I expected. Is this even possible?</p>