home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _a63b51a76c93382fd18abc83eaea3526 < prev    next >
Encoding:
Text File  |  2000-03-23  |  3.1 KB  |  94 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>carp    - warn of errors</TITLE>
  5. <LINK REL="stylesheet" HREF="../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> carp    - warn of errors</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <UL>
  26.  
  27.         <LI><A HREF="#forcing a stack trace">Forcing a Stack Trace</A></LI>
  28.     </UL>
  29.  
  30.     <LI><A HREF="#bugs">BUGS</A></LI>
  31. </UL>
  32. <!-- INDEX END -->
  33.  
  34. <HR>
  35. <P>
  36. <H1><A NAME="name">NAME</A></H1>
  37. <P>carp    - warn of errors (from perspective of caller)</P>
  38. <P>cluck   - warn of errors with stack backtrace
  39.           (not exported by default)</P>
  40. <P>croak   - die of errors (from perspective of caller)</P>
  41. <P>confess - die of errors with stack backtrace</P>
  42. <P>
  43. <HR>
  44. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  45. <UL>
  46. <LI>Linux</LI>
  47. <LI>Solaris</LI>
  48. <LI>Windows</LI>
  49. </UL>
  50. <HR>
  51. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  52. <PRE>
  53.     use Carp;
  54.     croak "We're outta here!";</PRE>
  55. <PRE>
  56.     use Carp qw(cluck);
  57.     cluck "This is how we got here!";</PRE>
  58. <P>
  59. <HR>
  60. <H1><A NAME="description">DESCRIPTION</A></H1>
  61. <P>The Carp routines are useful in your own modules because
  62. they act like <A HREF="../lib/Pod/perlfunc.html#item_die"><CODE>die()</CODE></A> or warn(), but report where the error
  63. was in the code they were called from.  Thus if you have a 
  64. routine <CODE>Foo()</CODE> that has a <CODE>carp()</CODE> in it, then the <CODE>carp()</CODE> 
  65. will report the error as occurring where <CODE>Foo()</CODE> was called, 
  66. not where <CODE>carp()</CODE> was called.</P>
  67. <P>
  68. <H2><A NAME="forcing a stack trace">Forcing a Stack Trace</A></H2>
  69. <P>As a debugging aid, you can force Carp to treat a croak as a confess
  70. and a carp as a cluck across <EM>all</EM> modules. In other words, force a
  71. detailed stack trace to be given.  This can be very helpful when trying
  72. to understand why, or from where, a warning or error is being generated.</P>
  73. <P>This feature is enabled by 'importing' the non-existent symbol
  74. 'verbose'. You would typically enable it by saying</P>
  75. <PRE>
  76.     perl -MCarp=verbose script.pl</PRE>
  77. <P>or by including the string <CODE>MCarp=verbose</CODE> in the <A HREF="../lib/Pod/perlrun.html#item_PERL5OPT">PERL5OPT</A>
  78. environment variable.</P>
  79. <P>
  80. <HR>
  81. <H1><A NAME="bugs">BUGS</A></H1>
  82. <P>The Carp routines don't handle exception objects currently.
  83. If called with a first argument that is a reference, they simply
  84. call <A HREF="../lib/Pod/perlfunc.html#item_die"><CODE>die()</CODE></A> or warn(), as appropriate.</P>
  85. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  86. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  87. <STRONG><P CLASS=block> carp    - warn of errors</P></STRONG>
  88. </TD></TR>
  89. </TABLE>
  90.  
  91. </BODY>
  92.  
  93. </HTML>
  94.