Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w + package blah; sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } + sub print_dumb_question { my $self = shift; my $blat = $self->blat; print <<HERE I want blat to be the $blat not $self->blat() \n HERE ; } + sub blat { return ('correct value'); } + package main; my $dumb_problem = blah->new; $dumb_problem->print_dumb_question;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing accessor methods in here documents
by dragonchild (Archbishop) on May 06, 2005 at 18:47 UTC | |
|
Re: Printing accessor methods in here documents
by davidrw (Prior) on May 06, 2005 at 20:00 UTC | |
|
Re: Printing accessor methods in here documents
by bart (Canon) on May 06, 2005 at 19:44 UTC | |
|
Re: Printing accessor methods in here documents
by cog (Parson) on May 06, 2005 at 18:49 UTC | |
by Anonymous Monk on May 06, 2005 at 19:04 UTC | |
by Zaxo (Archbishop) on May 06, 2005 at 19:17 UTC | |
by !1 (Hermit) on May 06, 2005 at 21:37 UTC | |
by cog (Parson) on May 06, 2005 at 19:09 UTC |