title: How to pass parameter to a referenced subroutine called from some other subroutine
body: <pre><code>use strict;
  use warnings;
  sub test1 {
  my $arg = shift;
  print "$arg";
  }
  my $rs = \&amp;test1;
  sub test2 {
  my $value = shift;
  print "$value \n";
  return $rs;
  }
  
  
  
  &amp;test2("hello")-&gt;("Bye");
  </code></pre>
  
  <p>It is working fine as expected. But if in test1 sub we want to pass parameter from test2 sub. Something like</p>
  
  <pre><code>use strict;
  use warnings;
  sub test1 {
  my $arg = shift;
  print "$arg";
  }
  my $rs = \&amp;test1;
  sub test2 {
  my $value = shift;
  print "$value \n";
  return $rs($value);
  }
  
  &amp;test2("hello")-&gt;();
  </code></pre>
  
  <p>I know it is wrong syntax but dont know how to do that. I hope question is clear.</p>
  
  <p>I want the output as 
      hello
      hello</p>
  
  <p>Not sure how to do that</p>