Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 romping around the Monastery: (6)
As of 2014-08-28 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls