The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Acme::JavaTrace - Module for using Java-like stack traces


Version 0.08


On the command-line:

    perl -wMAcme::JavaTrace

Inside a module:

    use Acme::JavaTrace;
    warn "some kind of non-fatal exception occured";
    die "some kind of fatal exception occured";


<buzzword>This module tries to improves the Perl programmer experience by porting the Java paradigm to print stack traces, which is more professional than Perl's way. </buzzword>

This is achieved by modifying the functions warn() and die() in order to replace the standard messages by complete stack traces that precisely indicates how and where the error or warning occurred. Other than this, their use should stay unchanged, even when using die() inside eval().

For a explanation of why I wrote this module, you can read the slides of my lightning talk Entreprise Perl, available here:


Options can be set at import time using:

    perl -wMDevel::SimpleTrace=option1,option2


    use Devel::SimpleTrace qw(option1 option2);

Available options are:


Using this option will tell Devel::SimpleTrace to stringify objects and references passed in argument to die(). This option is disabled by default in order to leave objects and references untouched.


Here is an example of stack trace produced by Acme::JavaTrace using a fictional Perl program:

    Exception: event not implemented
            at MyEvents::generic_event_handler(workshop/
            at MyEvents::__ANON__(workshop/
            at MyEvents::dispatch_event(workshop/
            at MyEvents::call_event(workshop/
            at main::(workshop/

Please note that even the professionnal indentation present in the Java environment is included in the trace.


Unknown option: %s

(W) This warning occurs if you try to set an unknown option.


This module is currently not compatible with other modules that also work by overriding die() and warn(), like CGI::Carp.


Java, for its unhelpful kilometre-long stack traces.


Sébastien Aperghis-Tramoni <>


Please report any bugs or feature requests to, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


Acme::JavaTrace is Copyright (C)2004-2011 Sébastien Aperghis-Tramoni.

This program is free software. You can redistribute it and/or modify it under the same terms as Perl itself.