Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# CPANPLUS::Error

Perl 5 version 16.0 documentation
Go to top
Show page index • Show recent pages
Recently read

# CPANPLUS::Error

- NAME
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
  - cp_msg("message string" [,VERBOSE])
  - msg()
  - cp_error("error string" [,VERBOSE])
  - error()
- CLASS METHODS
  - CPANPLUS::Error->stack()
  - CPANPLUS::Error->stack_as_string([TRACE])
  - CPANPLUS::Error->flush()
- GLOBAL VARIABLES

# NAME

CPANPLUS::Error - error handling for CPANPLUS

# SYNOPSIS

        use CPANPLUS::Error qw[cp_msg cp_error];

# DESCRIPTION

This module provides the error handling code for the CPANPLUS libraries, and is mainly intended for internal use.

# FUNCTIONS

## cp_msg("message string" [,VERBOSE])

Records a message on the stack, and prints it to `STDOUT` (or actually `$MSG_FH` , see the `GLOBAL VARIABLES` section below), if the `VERBOSE` option is true. The `VERBOSE` option defaults to false.

## msg()

An alias for `cp_msg` .

## cp_error("error string" [,VERBOSE])

Records an error on the stack, and prints it to `STDERR` (or actually `$ERROR_FH` , see the `GLOBAL VARIABLES` sections below), if the `VERBOSE` option is true. The `VERBOSE` options defaults to true.

## error()

An alias for `cp_error` .

# CLASS METHODS

## CPANPLUS::Error->stack()

Retrieves all the items on the stack. Since `CPANPLUS::Error` is implemented using `Log::Message` , consult its manpage for the function `retrieve` to see what is returned and how to use the items.

## CPANPLUS::Error->stack_as_string([TRACE])

Returns the whole stack as a printable string. If the `TRACE` option is true all items are returned with `Carp::longmess` output, rather than just the message. `TRACE` defaults to false.

## CPANPLUS::Error->flush()

Removes all the items from the stack and returns them. Since `CPANPLUS::Error` is implemented using `Log::Message` , consult its manpage for the function `retrieve` to see what is returned and how to use the items.

# GLOBAL VARIABLES

- $ERROR_FH

  This is the filehandle all the messages sent to `error()` are being printed. This defaults to `*STDERR` .

- $MSG_FH

  This is the filehandle all the messages sent to `msg()` are being printed. This default to `*STDOUT` .

Page index

- NAME
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
  - cp_msg("message string" [,VERBOSE])
  - msg()
  - cp_error("error string" [,VERBOSE])
  - error()
- CLASS METHODS
  - CPANPLUS::Error->stack()
  - CPANPLUS::Error->stack_as_string([TRACE])
  - CPANPLUS::Error->flush()
- GLOBAL VARIABLES