Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
XP is just a number
 
PerlMonks  

Re: Split and empty strings

by davorg (Chancellor)
on Apr 10, 2001 at 15:27 UTC ( [id://71370]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Split and empty strings

Can you post some code. I don't think I understand what you're saying. I tried the following:

#!/usr/bin/perl -w use strict; $_ = 'This is a string with newlines and blank lines'; my @arr = split /\n/; print map { "|$_|\n" } @arr;

a nd it gave this output:

|This is| |a string| || |with| |newlines| || |and| || |blank lines|

which looks right to me. What were you hoping for?

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://71370]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.