in reply to "Can't locate object method" error
Consider Class::Tiny:
#!/usr/bin/env perl use strict; use warnings; use feature qw(say); { package Employee; use Class::Tiny { name => 'Karl', empid => 311, pay => 200 }; say __PACKAGE__; } say __PACKAGE__; say for Class::Tiny->get_all_attributes_for("Employee"); my $wk = Employee->new(); say for ( $wk->name, $wk->empid, $wk->pay ); $wk->pay(3000); say $wk->pay; __END__
See also Role::Tiny for further inspiration.
Minor Update: Added __PACKAGE__
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
Furthermore I consider that Donald Trump must be impeached as soon as possible
|
|---|
| Replies are listed 'Best First'. |
|---|