Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$ perl -MData::Dump::Streamer -MYAML -le ' Data::Dump::Streamer::Dump( + \*Dump ) ' $GLOB1 = \*::Dump; *::Dump = sub { package YAML; use warnings; use strict 'refs'; my $yaml = 'YAML'->new; $yaml->dumper_class($DumperClass) if $DumperClass; return $yaml->dumper_object->dump(@_); }; $ perl -MData::Dump::Streamer -mYAML -le ' Data::Dump::Streamer::Dump( + \*Dump ) ' $GLOB1 = \*::Dump; *::Dump = sub { package Data::Dump::Streamer; use warnings; use strict 'refs'; my $obj; if (blessed($_[0]) and blessed($_[0]) eq 'Data::Dump::Stre +amer') { $obj = shift @_; } if (@_) { if (defined wantarray and not wantarray) { $obj ||= 'Data::Dump::Streamer'->new; $obj->_make_args(@_); return $obj; } else { $obj ||= 'Data::Dump::Streamer'; return $obj->Data(@_)->Out; } } else { if ($obj) { return $obj->Out; } else { return 'Data::Dump::Streamer'->new; } } }; $ pmvers Data::Dump::Streamer YAML Exporter Data::Dump::Streamer: 2.09 YAML: 0.70 Exporter: 5.63
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exporter collision detection
by ikegami (Patriarch) on Sep 28, 2009 at 15:17 UTC | |
by Anonymous Monk on Sep 28, 2009 at 22:39 UTC |