Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Rogue Null (ordinate 0) characters in text files

by Thelonius (Priest)
on May 08, 2008 at 01:14 UTC ( #685371=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Rogue Null (ordinate 0) characters in text files
in thread Rogue Null (ordinate 0) characters in text files

> as long as there are no periods, /\.*/ does split up individual characters just like //. No, it doesn't.

@c = split /\.+/, "abcdefg"; @d = split /\.+/, "ab.c.....defg";
results in @c having one element, "abcdefg", and @d having 3 elemnts, "ab", "c", and "defg".


Comment on Re^3: Rogue Null (ordinate 0) characters in text files
Download Code
Re^4: Rogue Null (ordinate 0) characters in text files
by almut (Canon) on May 08, 2008 at 01:48 UTC

    Well, you're using /\.+/, not /\.*/  :)

    my $s = "abcdefg"; my @c = split /\.*/, $s; print '/\.*/: ', join("-", @c), "\n"; my @d = split //, $s; print '//: ', join("-", @d), "\n"; __END__ /\.*/: a-b-c-d-e-f-g //: a-b-c-d-e-f-g

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://685371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-10-23 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (126 votes), past polls