recentpopularlog in

therobyouknow : subroutine   16

How do I return multiple variables from a subroutine?
my ( $hashRef1, $hashRef2 ) = function1();

function2( $hashRef1, $hashRef2 );

sub function1
my %hash1 = ();
my %hash2 = ();
# ... some code ...
return( \%hash1, \%hash2 );

sub function2
my ( $paramHashRef1, $paramHashRef2 ) = @_;

# ... deref by %$paramHashRef1 and %$paramHashRef2 etc

perl  hash  return  argument  parameter  between  returning  function  multiple  subroutine  programming  language  computing  syntax  method  howto  advice  work  reference  dereference  passby 
march 2010 by therobyouknow
Perl's IO::Handle
how to handle perl file handles as parameters and pass them to subroutines functions
computing  programming  web  development  server  serverside  side  cgi  perl  cgibin  cgi-bin  function  file  handle  filehandle  parameter  passing  subroutine  solution  work 
august 2009 by therobyouknow

Copy this bookmark:

to read