M
mmccaws2
Hi
I'm learning to use Class::Std and I am trying to figure out the
Attributes options. I've successfullly used function statements
in :default<int(rand(5))>. but I was trying to insert a phrase
in :default<'phrase'>; that was generated and saved in a variable.
However it doesn't seem to work
package Site::Text;
use strict:
use Class::Std;
my @phrase_choices = qw( "Top of the Morn" "Gid-ay" "Hang in there"
"Keep Trucking");
my $phrase = $phrase_choices[int(rand($phrase_choices))];
%greeting_of:
ATTRinit_arg<phrase>, :get<phrase>, :set<phrase>, :default<"$phrase">);
am I going to have to use START or BUILD or am I missing something in
the coding?
Mike
I'm learning to use Class::Std and I am trying to figure out the
Attributes options. I've successfullly used function statements
in :default<int(rand(5))>. but I was trying to insert a phrase
in :default<'phrase'>; that was generated and saved in a variable.
However it doesn't seem to work
package Site::Text;
use strict:
use Class::Std;
my @phrase_choices = qw( "Top of the Morn" "Gid-ay" "Hang in there"
"Keep Trucking");
my $phrase = $phrase_choices[int(rand($phrase_choices))];
%greeting_of:
ATTRinit_arg<phrase>, :get<phrase>, :set<phrase>, :default<"$phrase">);
am I going to have to use START or BUILD or am I missing something in
the coding?
Mike