X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FAudio%2FOpusfile.pm;fp=lib%2FAudio%2FOpusfile.pm;h=bfd4a138b7b990ad8fd586394eaf13a3262c1034;hb=a3133f6075d6fb174113c939ac5ee15ea19a4dba;hp=5d1e80e89188a819fa941976d4800e584dd736b3;hpb=36bdc9418b4dce76ce41f3141a3053cccf204545;p=audio-opusfile.git diff --git a/lib/Audio/Opusfile.pm b/lib/Audio/Opusfile.pm index 5d1e80e..bfd4a13 100644 --- a/lib/Audio/Opusfile.pm +++ b/lib/Audio/Opusfile.pm @@ -46,29 +46,20 @@ my @constants = our @EXPORT_OK = @constants; our @EXPORT = @constants; -our $VERSION = '0.005001'; - -sub AUTOLOAD { - # This AUTOLOAD is used to 'autoload' constants from the constant() - # XS function. - - my $constname; - our $AUTOLOAD; - ($constname = $AUTOLOAD) =~ s/.*:://; - croak "&Audio::Opusfile::constant not defined" if $constname eq 'constant'; - my ($error, $val) = constant($constname); - if ($error) { croak $error; } - { - no strict 'refs'; - # Fixed between 5.005_53 and 5.005_61 -#XXX if ($] >= 5.00561) { -#XXX *$AUTOLOAD = sub () { $val }; -#XXX } -#XXX else { - *$AUTOLOAD = sub { $val }; -#XXX } - } - goto &$AUTOLOAD; +our $VERSION = '1.000'; + +sub AUTOLOAD { ## no critic (ProhibitAutoloading) + my $constname; + our $AUTOLOAD; + ($constname = $AUTOLOAD) =~ s/.*:://s; + croak '&Audio::Opusfile::constant not defined' if $constname eq 'constant'; + my ($error, $val) = constant($constname); + if ($error) { croak $error; } + { + no strict 'refs'; ## no critic (ProhibitNoStrict) + *$AUTOLOAD = sub { $val }; + } + goto &$AUTOLOAD; } require XSLoader; @@ -77,8 +68,6 @@ require Audio::Opusfile::Head; require Audio::Opusfile::Tags; require Audio::Opusfile::PictureTag; -# Preloaded methods go here. - sub new_from_file { my ($class, $file) = @_; open_file($file)