Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: String manipulation

by AnomalousMonk (Canon)
on Dec 15, 2012 at 13:42 UTC ( #1008983=note: print w/replies, xml ) Need Help??

in reply to String manipulation

What the heck. Another approach:

>perl -wMstrict -le "my @dates = ( 'December 1st 2012', 'December 2nd 2012', 'December 23rd 2012', 'December 24th 2012', 'December 765th 2012', 'an 8th note', ); ;; for my $date (@dates) { printf qq{'$date' -> }; $date =~ s{ \d \K (?: st | nd | rd | th) \b }{}xms; print qq{'$date'} } " 'December 1st 2012' -> 'December 1 2012' 'December 2nd 2012' -> 'December 2 2012' 'December 23rd 2012' -> 'December 23 2012' 'December 24th 2012' -> 'December 24 2012' 'December 765th 2012' -> 'December 765 2012' 'an 8th note' -> 'an 8 note'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008983]
[karlgoethebier]: http://www. aliens.htm
[Lady_Aleena]: marioroy, I can't decide whether or not to move my RolePlaying:: Random:: modules to just Random::. I'm not as sophisticated as most here.
[marioroy]: Naming things can be difficult, sometimes more so that the actual code :)
[karlgoethebier]: Lady_Aleena: You need to jump to some conclusion
[Lady_Aleena]: And what would I rename RolePlaying/Random .pm to if I move all the RolePlaying/Random modules to just Random? Random/ Random/, maybe lowercase the file name to indicate it is a bit different? I don't know yet.
[marioroy]: What does Random do?
[karlgoethebier]: https://www. v=42WNHGr1jGI
[Lady_Aleena]: karlgoethebeir, I finished another project tonight, making a module which printed stop printing. It was a headache and a half.
[karlgoethebier]: Lady_Aleena: Try it!
[Lady_Aleena]: marioroy, it has 3 subroutines which can be fed data to generate random things. See here.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2017-05-29 08:58 GMT
Find Nodes?
    Voting Booth?