File: RW.pm

package info (click to toggle)
liblist-objects-withutils-perl 2.028003-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,276 kB
  • sloc: perl: 1,957; makefile: 17; sh: 6
file content (30 lines) | stat: -rw-r--r-- 691 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package List::Objects::WithUtils::Hash::Inflated::RW;
$List::Objects::WithUtils::Hash::Inflated::RW::VERSION = '2.028003';
use strictures 2;
use Carp ();
use Scalar::Util ();

use parent 'List::Objects::WithUtils::Hash::Inflated';

our $AUTOLOAD;
sub AUTOLOAD {
  my $self = shift;
  ( my $method = $AUTOLOAD ) =~ s/.*:://;
  Scalar::Util::blessed($self)
    or Carp::confess "Not a class method: '$method'";

  Carp::confess "Can't locate object method '$method'"
    unless exists $self->{$method};
  return $self->{$method} unless @_;
  Carp::confess "Multiple arguments passed to setter '$method'"
    if @_ > 1;
  $self->{$method} = $_[0]
}

1;

=pod

=for Pod::Coverage AUTOLOAD

=cut