By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,189 Members | 2,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,189 IT Pros & Developers. It's quick & easy.

stupid perl question

P: n/a
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
May 26 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
May 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.