Re: Convert any date format to ISO

2013-07-25 Thread Michael Brader
On 07/25/2013 03:26 PM, Jim Gibson wrote: You don't need a module to recognize a date in the form DD-MM- and change it into the form -MM-DD (untested): if( $date =~ /^(\d\d)-(\d\d)-(\d\d\d\d)$/ ) { $date = $3-$2-$1; }else{ # try other conversions } Jim's right, but be aware

url_encode for LWP POST

2013-07-25 Thread Feng He
Hi Would LWP::UserAgent call the url_encode() method from URL::Encode automatically for the posted content? use LWP::UserAgent; $ua = LWP::UserAgent-new; my $req = HTTP::Request-new( POST = 'http://rt.cpan.org/Public/Dist/Display.html');

Re: url_encode for LWP POST

2013-07-25 Thread Charles DeRykus
On 7/25/2013 12:57 AM, Feng He wrote: Would LWP::UserAgent call the url_encode() method from URL::Encode automatically for the posted content? use LWP::UserAgent; $ua = LWP::UserAgent-new; my $req = HTTP::Request-new( POST = 'http://rt.cpan.org/Public/Dist/Display.html');

Re: Convert any date format to ISO

2013-07-25 Thread Charles DeRykus
On Wed, Jul 24, 2013 at 10:56 PM, Michael Brader mbra...@internode.com.auwrote: On 07/25/2013 10:14 AM, mimic...@gmail.com wrote: I was trying to use Date::Simple to convert date from DD-MM- to ISO standard -MM-DD, but it produced error below because it returned undef when the

Re: url_encode for LWP POST

2013-07-25 Thread Feng He
Do you mean HTTP::Request::Common will do the url_encode stuff automatically? Thanks Charles. On 2013-7-25 18:30, Charles DeRykus wrote: On 7/25/2013 12:57 AM, Feng He wrote: Would LWP::UserAgent call the url_encode() method from URL::Encode automatically for the posted content? use

Re: module installation dir, site_perl, and perl -V:sitelib

2013-07-25 Thread Christophe Martin
Hello, Le 24/07/13 20:29, Luca Ferrari a écrit : On Wed, Jul 24, 2013 at 2:28 PM, Christophe Martin christophe.mar...@gmx.com wrote: Do all (or 95%) of perl installation have a site_perl dir ? I'll bet the answer is not. However, what would make sitelib so much important with regard to

Re: url_encode for LWP POST

2013-07-25 Thread Feng He
Now I got it, from lwpcook it's this way: Lazy people use the HTTP::Request::Common module to set up a suitable POST request message (it handles all the escaping issues) and has a suitable default for the content_type: use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua =