29 Jun 2007 22:01:11 UTC
- Distribution: Debug-StrDump
- Module version: 1.00
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (72 / 0 / 0)
- License: unknown
- Activity24 month
- Download (9.07KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
Debug::StrDump - Provides a byte representation of a string.
use Debug::StrDump; my $str = "This is a test string to be dumped with StrDump."; $str .= "\nHere are some control characters: \a\r\n\0"; str_dump ($str);
Debug::StrDump dumps a string into an array of bytes, similar to what you see in a stack dump. The string printed is formatted like this.
54 68 69 73 20 69 73 This is 20 61 20 74 65 73 74 a test
(Without monospaced formatting, this may look different)
By default, this function dumps the text as a hex string, but this is changable to decimal format
The main function used to dump a string. The function dumps to the filehandle currently selected.
Changes the current dump format to hex. Returns
undefif hex is already selected.
Changes the current dump format to decimal. Returns
undefif decimal is already selected.
Returns either 'hex' or 'dec' depending on what dump format is selected.
Add octal, sexagesimal, and floating-point representations of numbers.
Copyright (c) 2007, Noah Rankins All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution. 3. Neither the name of Noah Rankins nor the names of its contributors may be used to endorse or promote products derived from this softwarewithout specific prior written permission. THIS SOFTWARE IS PROVIDED BY NOAH RANKINS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NOAH RANKINS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Module Install Instructions
To install Debug::StrDump, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Debug::StrDump
For more information on module installation, please visit the detailed CPAN module installation guide.