Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: How does Perl handle strings with embedded NULLs?

( #27641=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > How does Perl handle strings with embedded NULLs? contributed by Corion

There are places where embedded \000 characters will get you into trouble, but Perl can read and write such files without problems, since Perl uses counted strings.

Be warned though that passing such strings to anything like a system routine (like open() or -x), that take null-terminated strings as arguments, you will have problems or security holes.

Comment on Answer: How does Perl handle strings with embedded NULLs?
RE: Answer: How does Perl handle strings with embedded NULLs?
by strredwolf (Chaplain) on Aug 13, 2000 at 11:39 UTC
    That answers it nicely. As is, I'm planning to slurp it all in and then do a
    @msgid=split /\000/, $data; foreach $j (@msgid) { $mid($j}++; }

    (reason? I wanna filter my POP account by already-dl'ed message-id's)

    --
    Perl is intergalactic! WolfSkunks use it!

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-01-29 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (228 votes), past polls