in reply to Perl code generation with PerlBean (continued)
If you use <<'EOF' you don't have to escape the scalars, which might be handy.# Make the Circle area() method add it to the Circle PerlBean use PerlBean::Method; my $area_circle = PerlBean::Method->new( { method_name => 'area', body => <<EOF, my \$self = shift; return( 2 * 3.1415926 * \$self->get_radius() ); EOF } ); $circle->add_method( $area_circle );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl code generation with PerlBean (continued)
by zoccav (Sexton) on Nov 04, 2003 at 12:53 UTC | |
|
Re: Perl code generation with PerlBean (continued)
by zoccav (Sexton) on Nov 04, 2003 at 13:38 UTC |