Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: how to append 2 lines

by aitap (Deacon)
on Aug 31, 2012 at 10:32 UTC ( #990974=note: print w/ replies, xml ) Need Help??


in reply to Re^2: how to append 2 lines
in thread how to append 2 lines

And your Perl code to join the lines is...

Hint: use three-argument form of substr to check the 72nd symbol of the line and use it again to replace the text. For example:

my $one = ("_"x9)."*__\n"; my $two = ("-"x15)."\n"; print "$one$two"; substr($one,9)="" if substr($one,9,1) eq "*"; print "$one$two";

Sorry if my advice was wrong.


Comment on Re^3: how to append 2 lines
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-31 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls