Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

by YuckFoo (Abbot)
on Dec 13, 2006 at 18:42 UTC ( #589648=note: print w/replies, xml ) Need Help??


in reply to Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

#!/usr/local/bin/lua function reverseWords(str) list = {} for word in string.gfind(str, "(%w+)") do table.insert(list, 1, word) end return (table.concat(list, " ")) end print(reverseWords(" one two three four "))
or maybe
#!/usr/local/bin/lua function reverseWords(str) list = {} string.gsub(str, "(%w+)", function(word) table.insert(list, 1, word) end) return (table.concat(list, " ")) end print(reverseWords(" one two three four "))
YuckFoo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589648]
help
Chatterbox?
[usemodperl]: yea but http only has tar.gz, i wanna download modules with core perl, but http seems to make it impossible, that's my only question, how to find http mirrors like meta, or how to do it with core perl, but options now seem totally broken (on purpose :-(
marto wanders off
[usemodperl]: Corion it's really not misguided, it's the only way, to do something... wonderful IMHO
[Corion]: usemodperl: Why don't you set up your own (http-only) CPAN mirror? Or just fatpack your scripts? I wonder what problem you're trying to solve here.
[usemodperl]: don't worry about that, it's really cool, i promise!
[Corion]: usemodperl: Well, if the world changes and makes your "wonderful" approach not work anymore, you can either change your approach, or change the world. You seem to want to change others instead.
[usemodperl]: no dude i'm just asking how to access meta via http and you are getting defensive for some reason (did you turn off http at meta? :-)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2018-06-24 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?