Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: whitespaces replace with tabs - help needed...

by hagen (Friar)
on Aug 15, 2003 at 02:51 UTC ( #284079=note: print w/replies, xml ) Need Help??


in reply to Re: Re: whitespaces replace with tabs - help needed...
in thread whitespaces replace with tabs - help needed...

Hi,

you may want to take a look at tr// (`translate'), especially the `s' modifier. This will replace multiple duplicated characters with one instance of the required character.

For example, in your line

$_=~s/ +/\t/s;,

(the $_ isn't really necessary here) you could have

tr/ /\t/s;. I understand it's quite a bit more efficient.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284079]
help
Chatterbox?
[marioroy]: The nature of the Guitar
[Discipulus]: my best with guitar is to fingerpicking some De André songs
[karlgoethebier]: Listen to Glenn: https://www. youtube.com/watch? v=SiiVK3rMxxg
[karlgoethebier]: marioroy: If you provide an email address i'll send you the full script of TNOG...
[karlgoethebier]: marioroy: Checkout also "Linear Expressions" by the same author...
[marioroy]: thanks karlgoethebier.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-03-24 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (298 votes). Check out past polls.