ossp-pkg/uuid/perl/uuid.pm 1.2 -> 1.3
--- uuid.pm 2004/11/03 18:35:26 1.2
+++ uuid.pm 2004/11/03 18:44:40 1.3
@@ -171,9 +171,14 @@
}
sub import {
+ # ATTENTION: The OSSP uuid API function "import" conflicts with
+ # the standardized "import" method the Perl world expects from
+ # their modules. In order to keep the Perl binding consist
+ # with the C API, we solve the conflict under run-time by
+ # distinguishing between the two types of "import" calls.
if (defined($_[0]) and ref($_[0]) =~ m/^OSSP::uuid/) {
# the regular OSSP::uuid "import" method
- croak("import method expects 3 or 4 arguments") if (@_ < 3 or @_ > 4);
+ croak("import method expects 3 or 4 arguments") if (@_ < 3 or @_ > 4); # emulate prototype
my ($self, $fmt, $data_ptr, $data_len) = @_;
if ($fmt eq 'bin') { $fmt = $self->UUID_FMT_BIN; }
elsif ($fmt eq 'str') { $fmt = $self->UUID_FMT_STR; }
@@ -192,9 +197,14 @@
}
sub export {
+ # ATTENTION: The OSSP uuid API function "export" conflicts with
+ # the standardized "export" method the Perl world expects from
+ # their modules. In order to keep the Perl binding consist
+ # with the C API, we solve the conflict under run-time by
+ # distinguishing between the two types of "export" calls.
if (defined($_[0]) and ref($_[0]) =~ m/^OSSP::uuid/) {
# the regular OSSP::uuid "export" method
- croak("export method expects 2 arguments") if (@_ != 2);
+ croak("export method expects 2 arguments") if (@_ != 2); # emulate prototype
my ($self, $fmt) = @_;
my $data_ptr;
if ($fmt eq 'bin') { $fmt = $self->UUID_FMT_BIN; }
|
|