Re: baby perl to get the right date

2014-01-27 Thread marcos rebelo
hi If you would like to work with a cleaner perl, try: http://search.cpan.org/~mschwern/perl5i-v2.12.0/lib/perl5i.pm it is slower but it is beautiful. other way is to use Classes like DateTime directly Best Regards MArcos On Tue, Jan 28, 2014 at 8:32 AM, Luca Ferrari wrote: > Hi all, > ofte

Re: baby perl to get the right date

2014-01-27 Thread Chankey Pathak
Hi Luca, Check this: http://stackoverflow.com/questions/11020812/todays-date-in-perl-in-mm-dd--format On 28 January 2014 13:02, Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3

baby perl to get the right date

2014-01-27 Thread Luca Ferrari
Hi all, often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there's a smarter pattern to get the right value in one single line.

Re: Using Files in Chronological Order

2014-01-27 Thread Paul Johnson
On Fri, Jan 24, 2014 at 06:26:58AM -0600, Martin G. McCormick wrote: > This is a perl philosophy question. I need to look for > some files, newest first. If I use the glob directive in perl, I > can fill an array with all the file names that match the pattern > but they aren't sorted in to ch

Re: Using Files in Chronological Order

2014-01-27 Thread Shawn H Corey
On Fri, 24 Jan 2014 06:26:58 -0600 "Martin G. McCormick" wrote: > I have read perl instructional documentation that warns > about using system("commands") and shell commands so my question > is, what is wrong with that? > > The only thing I can see is that it is not portable and > th

Using Files in Chronological Order

2014-01-27 Thread Martin G. McCormick
This is a perl philosophy question. I need to look for some files, newest first. If I use the glob directive in perl, I can fill an array with all the file names that match the pattern but they aren't sorted in to chronological order. I found a perlmonks posting in which the same question w