Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Converting multiple lines into single line.

by tybalt89 (Parson)
on Jan 09, 2018 at 15:44 UTC ( #1206988=note: print w/replies, xml ) Need Help??


in reply to Converting multiple lines into single line.

#!/usr/bin/perl # http://perlmonks.org/?node_id=1206966 use strict; use warnings; print join('', <DATA>) =~ s/^war \V* \K \{ .*? \}/ $& =~ tr|&\n||dr /e +gmsxr; __DATA__ some starting text war eligible, init =0*DEC0, ev (VARIABLE){1*BIN0,2*DEC3,6*BIN4, & 5*BIN43,6*DEC32, & 5*BIN43,7*DEC32} some other text war wear, init =1*DEC1, ev (VARIABLE) { & 1*BIN0,2*DEC3,6*BIN4, & 5*BIN43,6*DEC32, & 5*BIN43,7*DEC32,6*DEC32,6*DEC3, & 8*BIN3,6*DEC34 } some final text

Outputs:

some starting text war eligible, init =0*DEC0, ev (VARIABLE){1*BIN0,2*DEC3,6*BIN4, 5*BIN4 +3,6*DEC32, 5*BIN43,7*DEC32} some other text war wear, init =1*DEC1, ev (VARIABLE) { 1*BIN0,2*DEC3,6*BIN4, 5*BIN43, +6*DEC32, 5*BIN43,7*DEC32,6*DEC32,6*DEC3, 8*BIN3,6*DEC34} some final text

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2019-08-25 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?