Hello , I've having a mare trying to return multiple arrays of hashes from a sub routine into usable arrays for the HTML Template module.
I'm trying to dereference them before use with the following...
but the template module is erroring with..
But if I print either @init or @$init, it prints
is it possible to return multiple arrays from a sub and use in the manner i wish ?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
Code:
sub init_period {
my @chase = &getSQL("table","colums","where","order");
my @init= &getSQL("table","colums","where","order");
return (\@init, \@chase);
}
Code:
# Check for initial period records
my ($init,$chase) = &init_period($ADMIN,$STAFF,$user);
my @init = @$init;
my @chase = @$chase;
if(@init > 0){
$template->param( 'init' => \@init );
}
if(@chase > 0){
$template->param( 'chase' => \@chase );
}
but the template module is erroring with..
HTML::Template:aram() : attempt to set parameter 'init' with an array ref - parameter is not a TMPL_LOOP!
But if I print either @init or @$init, it prints
HASH(0x2c1b418)
is it possible to return multiple arrays from a sub and use in the manner i wish ?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!