Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Passing array of references to Template

by packetstormer (Monk)
on Aug 23, 2011 at 20:01 UTC ( #921985=note: print w/replies, xml ) Need Help??

in reply to Re: Passing array of references to Template
in thread Passing array of references to Template

Is it FOR or FOREACH? I had been trying (and having some success with FOREACH) Regardless, neither of them work!
  • Comment on Re^2: Passing array of references to Template

Replies are listed 'Best First'.
Re^3: Passing array of references to Template
by philipbailey (Chaplain) on Aug 23, 2011 at 20:06 UTC

    FOR and FOREACH are completely interchangeable. I prefer the former, but either is fine.

    I would suggest that you convince us (or yourself, at least) that $results contains what you expect, e.g. using Data::Dumper.

    Update: it occurs to me that @sendoff is never defined. Did you really run this using strict? You don't seem to need $sendoff or @sendoff at all: just write

    $template->param('results' => $results);
      Yeah - printing the \@sendoff via Dumper displays what I need. I actually have a typo in what I posted, the actual code is
      my $results = &return_values; my @sendoff = @$results;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921985]
holli writes MonkLinks 2.0
[holli]: Just to have a look what all the fuzz about the new JS features is about
[holli]: tag auch. wir sind ja unter uns :)
[Corion]: Hi holli ;)
[Corion]: In a way, it's sad that Firefox kills off the add-on functionality... But, as n-gate usually writes, "Firefox tries to be more like Chrome"
[holli]: it's not always possible to do a complete rewrite without cutting off some pigtails
[Discipulus]: indeed! new firefox seems poorer: many tab crash, and you open this link in FF?
[Discipulus]: problem scrolling even main page..;=(

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-11-20 19:02 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (291 votes). Check out past polls.