Skip to content

Don`t know how to pass array or hash to template #34

@deemytch

Description

@deemytch

That code

#!/usr/bin/perl
use Text::Haml;
%eth0 = ( mac => '10:fe:ed:f9:c4:b8', ip => 'dhcp' );
$haml = Text::Haml->new;
$haml->format('html5');
$page = $haml->render('%p= $eth0{mac}', eth0 => '%eth0') || die $haml->error;
print $page,"\n"; 

shows me

Global symbol "%eth0" requires explicit package name at (eval 10) line 1.

changing the eth0 => '%eth0' to %eth0 or 'eth0' in $haml->render() call doesn't resolve issue.
also can`t find anything about that case in the doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions