title: Perl built in functions as a subroutine reference
body: <p>I am trying to a set of operations to be performed as an array. For this, I have to pass sub routine references. (There may be other ways to perform this without using an array. But, I feel this is best for now, due to certain other constraints).</p>
  
  <p>Basic sample code for what I am trying to do:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  use Data::Dumper;
  sub test()
  {
     print "Tested\n";
  }
  
  my $test;
  my  @temp = (1, 2, 3);
  my $operations = [ 
             [\&amp;test, undef, undef],
             [\&amp;shift, \$test, \@temp], 
             ];
  
  foreach(@$operations){
     my $func = shift $_;
     my $out = shift $_;
     $$out = $func-&gt;(@$_);
  }
  
  print Dumper $test;
  </code></pre>
  
  <p>Output observed is:</p>
  
  <pre><code>Tested
  Undefined subroutine &amp;main::shift called at temp2.pl line 22.
  </code></pre>
  
  <p>Query - Is it possible to pass built in sub routines as a reference?</p>
  
  <p>There are earlier queries already, reg built in functions as a sub routine reference in <a href="https://stackoverflow.com/questions/1585560/can-you-take-a-reference-of-a-builtin-function-in-perl">here</a>.</p>
  
  <p>As the question was asked about 3 years ealier, was wondering if there is any alternative for it now.
  Would appreciate if some one explains why there is a distinction between built in functions and user defined sub routines in this scenario?</p>