Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Cyber Angels

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 82 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here



       splain - filter to produce verbose descriptions of perl
       warning diagnostics


       As a pragma:

           use diagnostics;
           use diagnostics -verbose;

           enable  diagnostics;
           disable diagnostics;

       As a program:

           perl program 2>diag.out
           splain [-v] [-p] diag.out


       The "diagnostics" Pragma

       This module extends the terse diagnostics normally emitted
       by both the perl compiler and the perl interpreter, aug­
       menting them with the more explicative and endearing
       descriptions found in perldiag.  Like the other pragmata,
       it affects the compilation phase of your program rather
       than merely the execution phase.

       To use in your program as a pragma, merely invoke

           use diagnostics;

       at the start (or near the start) of your program.  (Note
       that this does enable perl's -w flag.)  Your whole compi­
       lation will then be subject(ed :-) to the enhanced diag­
       nostics.  These still go out STDERR.

       Due to the interaction between runtime and compiletime
       issues, and because it's probably not a very good idea
       anyway, you may not use "no diagnostics" to turn them off
       at compiletime.  However, you may control their behaviour
       at runtime using the disable() and enable() methods to
       turn them off and on respectively.

       The -verbose flag first prints out the perldiag introduc­
       tion before any other diagnostics.  The $diagnos­
       tics::PRETTY variable can generate nicer escape sequences
       for pagers.

       Warnings dispatched from perl itself (or more accurately,
       those that match descriptions found in perldiag) are only
       displayed once (no duplicate descriptions).  User code
       Output from splain is directed to STDOUT, unlike the


       The following file is certain to trigger a few errors at
       both runtime and compiletime:

           use diagnostics;
           print NOWHERE "nothing\n";
           print STDERR "\n\tThis message should be unadorned.\n";
           warn "\tThis is a user warning";
           print "\nDIAGNOSTIC TESTER: Please enter a <CR> here: ";
           my $a, $b = scalar <STDIN>;
           print "\n";
           print $x/$y;

       If you prefer to run your program first and look at its
       problem afterwards, do this:

           perl -w test.pl 2>test.out
           ./splain < test.out

       Note that this is not in general possible in shells of
       more dubious heritage, as the theoretical

           (perl -w test.pl >/dev/tty) >& test.out
           ./splain < test.out

       Because you just moved the existing stdout to somewhere

       If you don't want to modify your source code, but still
       have on-the-fly warnings, do this:

           exec 3>&1; perl -w test.pl 2>&1 1>&3 3>&- | splain 1>&2 3>&-

       Nifty, eh?

       If you want to control warnings on the fly, do something
       like this.  Make sure you do the "use" first, or you won't
       be able to get at the enable() or disable() methods.

           use diagnostics; # checks entire compilation phase
               print "\ntime for 1st bogus diags: SQUAWKINGS\n";
               print BOGUS1 'nada';
               print "done with 1st bogus\n";

           disable diagnostics; # only turns off runtime warnings
               print "\ntime for 2nd bogus: (squelched)\n";
               print BOGUS2 'nada';
               print "done with 2nd bogus\n";

       available at runtime.  Otherwise, they may be embedded in
       the file itself when the splain package is built.   See
       the Makefile for details.

       If an extant $SIG{__WARN__} handler is discovered, it will
       continue to be honored, but only after the diagnos­
       tics::splainthis() function (the module's $SIG{__WARN__}
       interceptor) has had its way with your warnings.

       There is a $diagnostics::DEBUG variable you may set if
       you're desperately curious what sorts of things are being

           BEGIN { $diagnostics::DEBUG = 1 }


       Not being able to say "no diagnostics" is annoying, but
       may not be insurmountable.

       The "-pretty" directive is called too late to affect mat­
       ters.  You have to do this instead, and before you load
       the module.

           BEGIN { $diagnostics::PRETTY = 1 }

       I could start up faster by delaying compilation until it
       should be needed, but this gets a "panic: top_level" when
       using the pragma form in Perl 5.001e.

       While it's true that this documentation is somewhat subse­
       rious, if you use a program named splain, you should
       expect a bit of whimsy.


       Tom Christiansen <tchrist@mox.perl.com>, 25 June 1995.

perl v5.8.1                 2003-09-23                  SPLAIN(1)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.11 Seconds