You know what would be nice? A built in log/trace option, something like
#!/usr/bin/perl -- use strict; use warnings; use autodie 2.01; use autodie 'log'; # default logger use autodie log => sub { # custom logger no warnings 'uninitialized'; use POSIX(); use Carp(); use Scalar::Quote(); my ( $func, @args ) = @_; (@_) = ( POSIX::strftime( '%Y-%m-%d %H:%M:%S ', localtime ), "$func( ", join( ', ', map { Scalar::Quote::quote($_) } @args +), " )" ); goto &Carp::carp; }; open my($in), '<', __FILE__; close $in; system $^X, qw[ -le print(66) ]; systemx $^X, qw[ -le die(66) ]; __END__ 2009-07-02 01:45:45 main::open( undef, '<', 'test.pl' ) at test.pl lin +e 23 2009-07-02 01:45:45 main::close( 'GLOB(0x182f970)' ) at test.pl line 2 +4 2009-07-02 01:45:45 main::system( "C:\\Perl\\bin\\perl.exe", '-le', 'p +rint(66)' ) at test.pl line 25 2009-07-02 01:45:45 main::system( "C:\\Perl\\bin\\perl.exe", '-le', 'd +ie(66)' ) at test.pl line 26 66 at -e line 1. "C:\Perl\bin\perl.exe" unexpectedly returned exit value 255 at test.pl + line 26
For now I'm getting by with
use Devel::TraceMethods ( main => sub ... );
but would really love use autodie 'log';
C:\perl\.cpanplus\5.8.9\build\autodie-2.03>perl -Mblib t\hints.t # Sub::Identify is loaded ok 1 - Id: copy ok 2 - Id: cp ok 3 - Id: move ok 4 - Id: mv ok 5 - Copying in scalar context should throw an error. ok 6 - The object isa autodie::exception ok 7 - Function should be original name not ok 8 - File::Copy returns zero on failure # Failed test 'File::Copy returns zero on failure' # at t\hints.t line 64. # got: '' # expected: '0' ok 9 - File::Copy called in scalar context ok 10 - Copying in list context should throw an error. ok 11 - The object isa autodie::exception ok 12 - Function should be original name not ok 13 - File::Copy returns zero on failure # Failed test 'File::Copy returns zero on failure' # at t\hints.t line 79. # Structures begin differing at: # $got->[0] = '' # $expected->[0] = '0' ok 14 - File::Copy called in list context ok 15 - fail_on_undef(1) ok 16 - fail_on_empty(undef) ok 17 - fail_on_empty() ok 18 - fail_on_false(1) ok 19 - fail_on_false(0) ok 20 - fail_on_empty(0) ok 21 - fail_on_undef(undef) ok 22 - fail_on_undef(0) ok 23 - fail_on_undef() ok 24 - fail_on_empty(1) ok 25 - fail_on_false(undef) ok 26 - fail_on_false() 1..26 # Looks like you failed 2 tests of 26.

In reply to Re: RFC: User subroutine hinting interface for autodie by Anonymous Monk
in thread RFC: User subroutine hinting interface for autodie by pjf

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.