my $get = "get_$group";
# eval for faster fastiness
- return eval "sub {
+ my $code = eval "sub {
if(\@_ > 1) {
return shift->$set('$field', \@_);
}
else {
return shift->$get('$field');
}
- };"
+ };";
+ Carp::croak $@ if $@;
+
+ return $code;
}
=head2 make_group_ro_accessor
my $get = "get_$group";
- return eval "sub {
+ my $code = eval "sub {
if(\@_ > 1) {
my \$caller = caller;
Carp::croak(\"'\$caller' cannot alter the value of '$field' on \".
else {
return shift->$get('$field');
}
- };"
+ };";
+ Carp::croak $@ if $@;
+
+ return $code;
}
=head2 make_group_wo_accessor
my $set = "set_$group";
- return eval "sub {
+ my $code = eval "sub {
unless (\@_ > 1) {
my \$caller = caller;
Carp::croak(\"'\$caller' cannot access the value of '$field' on \".
else {
return shift->$set('$field', \@_);
}
- };"
+ };";
+ Carp::croak $@ if $@;
+
+ return $code;
}
=head2 get_simple
--- /dev/null
+#!perl -w
+# $Id: pod_spelling.t 7003 2009-07-08 02:24:06Z claco $
+use strict;
+use warnings;
+
+BEGIN {
+ use lib 't/lib';
+ use Test::More;
+
+ plan skip_all => 'set TEST_AUTHOR to enable this test' unless $ENV{TEST_AUTHOR};
+
+ eval 'use Test::Spelling 0.11';
+ plan skip_all => 'Test::Spelling 0.11 not installed' if $@;
+};
+
+set_spell_cmd('aspell list');
+
+add_stopwords(<DATA>);
+
+all_pod_files_spelling_ok();
+
+__DATA__
+Bowden
+Raygun
+Roditi
+isa
+mst
+behaviour
+further
+overridable
+Laco
+Pauley
+claco
+stylings
+fieldspec
+listref
+getters