Brute force is always used.
#!/usr/bin/perl use strict; use warnings; use 5.010; use POSIX 'strftime'; my $ONE_DAY = 24 * 60 * 60;
But if you are working in a Perl environment where you cannot install modules from CPAN, then it is always worth working to remove this restriction. Modern Perl programming is often an example of combining the right series of CPAN modules. If you don’t have access to CPAN, you just make your life a lot harder than it should be.
If you really cannot remove the restriction, then find another job. It is not worth dealing with people who impose such meaningless restrictions.
Update: Just noticed that you are also using a prehistoric version of Perl. You need to remove use 5.010 and replace say with print . And update your resume: - /
Update 2: choroba solution is better. It deals with any date in the correct format. Mine only deals with the current date. Advice on how to fix your work environment is still there.
source share