diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-21 11:56:34 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-21 11:56:34 +0200 |
commit | f40e07a9b046de0e27df617992bb042d5d5ce0c0 (patch) | |
tree | 5c616c6afc8f382c370f16d24dff07dd64dfdf4c /lib | |
parent | 4b99f488f3eda64522861b8e8d1c0ff7fe9311bc (diff) |
Further App::Dthumb::Data improvements
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/Dthumb/Data.pm.PL | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/App/Dthumb/Data.pm.PL b/lib/App/Dthumb/Data.pm.PL index 168397a..3c74b9c 100644 --- a/lib/App/Dthumb/Data.pm.PL +++ b/lib/App/Dthumb/Data.pm.PL @@ -48,7 +48,9 @@ our $VERSION = '0.2'; sub new { my ($obj) = @_; + my $ref = {}; + return bless($ref, $obj); } @@ -58,11 +60,14 @@ sub set_vars { while (my ($key, $value) = each(%vars)) { $self->{replace}->{$key} = $value; } + + return; } sub list_archived { my ($self) = @_; - return grep { ! /\.dthumb$/ } $self->section_data_names(); + + return grep { ! m{ [.] dthumb $ }x } $self->section_data_names(); } sub get { @@ -70,14 +75,14 @@ sub get { my $data = $self->section_data($name); if (not $data) { - return undef; + return; } $data = ${$data}; chomp($data); - if ($name =~ qr{ \. (png | gif) $ }ox) { + if ($name =~ m{ [.] (png | gif) $ }ox) { return decode_base64($data); } @@ -92,6 +97,10 @@ sub get { return $data; } +# * Included files in __DATA__ may use other newlines than we do +# * Since we have __DATA__ below the POD, we cannot put it after __END__ +## no critic (RequireConsistentNewlines, RequirePodAtEnd) + 1; =head1 NAME |