stupid perl question

John Machin sjmachin at lexicon.net
Fri May 26 20:20:40 EDT 2006


On 27/05/2006 9:15 AM, M.N.A.Smadi wrote:
> hi guys;
> 
> sorry for sending a perl question here, but python guy "HAD TO" look at 
> perl code;
> 
> how can i split a string that contains white spaces and '_'
> 
> any clue?
> 
> thanks
> moe smadi

Well the screamingly obvious way to do in Python what I think your 
imprecise question is asking is:

 >>> "foo_bar zot plugh _ xyzzy".replace("_", " ").split()
['foo', 'bar', 'zot', 'plugh', 'xyzzy']
 >>>

Talking about screaming, I fled screaming from perl at about the perl 3 
stage -- I can't help you any further; I don't want to turn into a 
pillar of salt.

Why don't you ask stupid perl questions on comp.lang.perl??

Cheers,
John



More information about the Python-list mailing list