Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: doubt in storing a data of 2 lines in an array.

by johngg (Canon)
on Oct 30, 2006 at 15:09 UTC ( #581310=note: print w/replies, xml ) Need Help??


in reply to Re^2: doubt in storing a data of 2 lines in an array.
in thread doubt in storing a data of 2 lines in an array.

You could either do a global substitution something like $field =~ s{\n}{ }g to replace any newline with a space or you could achieve the same thing with split and join, something like $field = join q{ }, split m{\n}, $field;. In each case you are going to have to handle a big gap in your line because of the indentation of the second line of the title. However, this post should give you enough clues about s{this}{the other} to solve that for yourself. Big hint, \s+ means one or more white-space characters.

Best of luck,

JohnGG

Replies are listed 'Best First'.
Re^4: doubt in storing a data of 2 lines in an array.
by Anonymous Monk on Oct 31, 2006 at 10:22 UTC
    hey john, i got it..thanks.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2023-10-03 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?