Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: remove spaces after join operation

by lakssreedhar (Acolyte)
on Jul 26, 2013 at 11:27 UTC ( #1046488=note: print w/ replies, xml ) Need Help??


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

This error Can't modify join or string in substitution (s///) at out.pl line 5, near "s/\s*(\.\(\))\s*/$1/g;" is being shown


Comment on Re^2: remove spaces after join operation
Re^3: remove spaces after join operation
by Loops (Hermit) on Jul 26, 2013 at 11:37 UTC
    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

      ya its working now

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-07-30 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (231 votes), past polls