Hi, I'm working with template loops today and I was thinking I would write a function to pass an array of hashes to the template loop a bit like:

$template->param(pos_colours =>colours());


sub colours{

my @colours =(
                                          { id => '',        is_selected => 
'selected', name='none'},
                    { id => '#123456', is_selected => '', name='Red' },
                    { id => '#122312', is_selected => '', name='Blue' },
                    { id => '#826313', is_selected => '', name='Green' }
    );

        return [EMAIL PROTECTED];
}



Is there a better way to do this, will this work? I can't test it at the moment as the server is down :(


Cheers

G :)


Public Sub House()

On Error Resume drink

        If Pint.empty = True Then
                Pint.refill
  Else
                Pint.drink
        End if

stomach.add Pint

MsgBox " I've had .... " & stomach.count & " Pints"
MsgBox "VERY DRUNK"

End Sub



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to