Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Plack
/
Util
Upload
3 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
Accessor.pm
940 B
-rw-r--r--
2018-02-10 09:23:44
Edit
Del
Editing: Accessor.pm
(940 B)
Path: /usr/share/perl5/vendor_perl/Plack/Util/Accessor.pm
Back
package Plack::Util::Accessor; use strict; use warnings; sub import { shift; return unless @_; my $package = caller(); mk_accessors( $package, @_ ); } sub mk_accessors { my $package = shift; no strict 'refs'; foreach my $field ( @_ ) { *{ $package . '::' . $field } = sub { return $_[0]->{ $field } if scalar( @_ ) == 1; return $_[0]->{ $field } = scalar( @_ ) == 2 ? $_[1] : [ @_[1..$#_] ]; }; } } 1; __END__ =head1 NAME Plack::Util::Accessor - Accessor generation utility for Plack =head1 DESCRIPTION This module is just a simple accessor generator for Plack to replace the Class::Accessor::Fast usage and so our classes don't have to inherit from their accessor generator. =head1 SEE ALSO L<PSGI> L<http://plackperl.org/> =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut