Yes ++

updated: minidb dumper, thx marioroy

From a bundle I use a lot:

use strict; use warnings; package My::Bundle { use Data::Dumper::AutoEncode (); use Data::Rmap 'rmap_ref'; use Import::Into; use parent 'Exporter'; our @EXPORT = 'Dumper'; sub import { shift->export_to_level(1); strict ->import::into(1); warnings ->import::into(1); strictures ->import::into(1, 2 => 1); feature ->import::into(1, 'say', 'state'); utf8 ->import::into(1); autodie ->import::into(1); Encode->import::into(1); List::Util->import::into(1, qw/ any all first max maxstr min m +instr sum sum0 pairkeys pairvalues pairgrep pairmap shuffle uniq /); Method::Signatures->import::into(1); Path::Tiny->import::into(1); Time::Piece->import::into(1); Time::Seconds->import::into(1); Try::Tiny->import::into(1); } # These are global vars; localize them unless # you want *everything* to be changed $Data::Dumper::Deepcopy = 1; $Data::Dumper::Indent = 1; $Data::Dumper::Purity = 1; $Data::Dumper::Quotekeys = 0; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Terse = 1; sub Dumper { rmap_ref { if ( my $class = ref($_) ) { $class = $_->blessed if $class eq 'MCE::Shared::Object +'; if ( $class->isa('MCE::Shared::Array') ) { $_ = [ $_->can('export') ? @{ $_->export } : $_->v +alues ]; } elsif ( $class->isa('MCE::Shared::Hash') ) { $_ = { $_->can('export') ? %{ $_->export } : $_->p +airs }; } elsif ( $class->isa('MCE::Shared::Minidb') ) { my $db = $_; $_ = $db->lkeys ? [ { $db->hpairs }, { $db->lpairs + } ] : [ { $db->hpairs } ]; } elsif ( $class->isa('MCE::Shared::Ordhash') ) { $_ = $_->clone; } elsif ( $class->isa('MCE::Shared::Scalar') ) { $_ = $_->get; } } } @_; return Data::Dumper::AutoEncode::eDumper(@_); } }; 1; # return true

Hope this helps!


The way forward always starts with a minimal test.

In reply to Re^2: Exporting use strict/warnings into main:: by 1nickt
in thread Exporting use strict/warnings into main:: by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.