Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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".

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://685371]
[1nickt]: MKE?
[MidLifeXis]: MKE
[marto]: Milwaukee
[1nickt]: thx marto
[LanX]: Canada?
[MidLifeXis]: :-)
[MidLifeXis]: Not for a few years yet. Kids in school :-)
[LanX]: NQC
[MidLifeXis]: Is there internet access up there on the lakes? If I moved there I would like to be able to fish :-D
[LanX]: Not Quite Canada

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-03-23 12:37 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (286 votes). Check out past polls.