in reply to Re: How to specify a Null char in a match operation
in thread How to specify a Null char in a match operation
use strict; use warnings; binmode STDOUT; my @strs = ("filename1.txt\0", "filename2\0.txt", "filename3.txt"); /\0/ && ((print "Null char detected in >$_<"), print "\n") for @strs;
If you still see truncated strings, it might be the terminal's fault. On linux, piping the output to a pager, I see
Null char detected in >filename1.txt^@< Null char detected in >filename2^@.txt<
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to specify a Null char in a match operation
by swampyankee (Parson) on Oct 11, 2006 at 19:58 UTC |