Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: remove spaces after join operation

by Loops (Curate)
on Jul 26, 2013 at 11:37 UTC ( #1046492=note: print w/replies, xml ) Need Help??

in reply to Re^2: remove spaces after join operation
in thread remove spaces after join operation

Ah, is your version of Perl too old to support the /r modifier? It wont work without it. I Suppose:
my $txt = join ' ',@first_sentence; $txt =~ s/\s*([.()])\s*/$1/g; print $txt;
Updated to simplify regex as suggested by hdb

Replies are listed 'Best First'.
Re^4: remove spaces after join operation
by lakssreedhar (Acolyte) on Jul 27, 2013 at 04:38 UTC

    ya its working now

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046492]
and a log crumbles through the grate...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2017-11-25 08:00 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (355 votes). Check out past polls.