Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
String::Dump::DebugginUser Contributed Perl DocumentString::Dump::Debugging(3)

NAME
       String::Dump::Debugging - String	debugging tips with String::Dump

VERSION
       This document describes String::Dump version 0.09.

DESCRIPTION
       This document is	a collection of	tips for debugging Unicode strings or
       byte strings using String::Dump.

   Literal strings
       When dumping literal strings in your code, use the utf8 pragma when
       Unicode strings are desired and donXt use it or disable it when byte
       strings are desired.  The pragma	may also be lexically enabled or
       disabled.

	   use utf8;

	   {
	       no utf8;
	       say dump_hex('Xis! X');	# C4 9C	69 73 21 20 E2 98 BA
	   }

	   say dump_hex('Xis! X');  # 11C 69 73	21 20 263A

   Command-line	input and filehandles
       The simplest way	to ensure that youXre working with Unicode strings
       from all	of your	basic sources of input is to use the utf8::all pragma.
       This extends the	utf8 pragma to automatically convert command-line
       arguments provided by @ARGV, user-defined filehandles, as well as
       standard	filehandles like "STDIN", among	others.

   Other sources of input
       To handle strings provided by other sources of input, such as from
       network protocols or web	requests, decode the byte string to a Unicode
       string via Encode::decode using the source encoding name	as the first
       argument.

	   use Encode qw( decode );

	   say dump_hex( decode('UTF-8', $string) );

AUTHOR
       Nick Patch <patch@cpan.org>

COPYRIGHT AND LICENSE
       X 2011X2013 Nick	Patch

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.32.0			  2020-08-10	    String::Dump::Debugging(3)

NAME | VERSION | DESCRIPTION | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=String::Dump::Debugging&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help