d

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.

15 St Margarets, NY 10033
(+381) 11 123 4567
ouroffice@aware.com

 

KMF

Localizing Dates in A Perl Web Application

When we’re writing software for a global audience, it’s nice if we can provide it according to their native languages and conventions. Translating all of the text can be a huge undertaking, but we can start small by making sure that when we show the day and date it appears as the user expects. For example, to me it’s Tuesday, April 20, 2021; to my friend Paul in the UK, it’s Tuesday, 20 April 2021 (note the difference in order); and to my other friend Gabór in Israel, it’s יום שלישי, 20 באפריל 2021 (note the different direction of the text, different language, and character set).

Thankfully, we have a number of tools to assist us:

  • The DateTime::Locale library, which enables our Perl software to represent dates and times globally and contains a catalog of locales. It works with the DateTime library for storing our dates as objects that can be easily manipulated and formatted.
  • The HTTP Accept-Language header, which lets a web browser communicate to the server what natural languages and locale variants the user understands.
  • The HTTP::AcceptLanguage module, which helps us parse the Accept-Language header and select a compatible locale.

Our sample code uses the Mojolicious framework and is very simple; almost half of it is just HTML web page templates. You could easily adapt it to other frameworks or templating systems.

sub ($c) { $c->render( template => ‘index’, date => DateTime->today ) };

helper localize_date => sub ( $c, $date = DateTime->today, $format=”full” )
{
my $locale = $locales{ HTTP::AcceptLanguage->new(
$c->req->headers->accept_language )->match( keys %locales ) };
my $dt = DateTime->from_object( object => $date, locale => $locale );

my $method_name = “date_format_$format”;
return $dt->format_cldr( $locale->$method_name );
};

app->start;
__DATA__
@@ index.html.ep
% layout ‘default’;
% title ‘Today’;

  • % for my $format ( qw(long medium short) ) {

  • % }

@@ layouts/default.html.ep

</p> <p>” data-lang=”text/x-perl”></p></div></div></div> <p><strong>Lines 1 through 6</strong> tell our code to use the Perl interpreter in our execution <code>PATH</code> and load our prerequisite modules. Note we’re using the micro version of Mojolicious, Mojolicious::Lite; later you can grow your application into a well-structured Mojolicious app. We’re also using Perl subroutine signatures, which requires Perl 5.20 or later (released in 2014).</p> <p><strong>Lines 8 and 9</strong> preload all of the available DateTime::Locale objects so that we can serve requests faster without having to load a new locale every time. We create a hash where the keys are the locale identifiers (for example, <code>en-US</code> for United States English), and the values are the locale objects.</p> <p><strong>Lines 11 and 12</strong> begin our route handler for HTTP GET requests on the default <code>/</code> route in our web application. When a browser hits the home page of our app, it will execute the code in the anonymous sub in line 11, which is passed the controller object as <code>$c</code>. It’s a very simple handler that renders a template called <code>index</code> (described below), passing it a <code>date</code> object with today’s date.</p> <p><strong>Lines 14 through 22</strong> are where the smarts of our application lie. It’s a helper that we’ll call from our template to localize a date object, and it’s another anonymous sub. This time it’s passed a Mojolicious controller as <code>$c</code>, a <code>$date</code> parameter that defaults to today, and a <code>$format</code> parameter that defaults to ‘full’.</p> <p><strong>Lines 16 and 17</strong> in the helper get our locale. Working from the inside out, we get the HTTP Accept-Language header from the request on line 17, create a new HTTP::AcceptLanguage object in line 16 for parsing that header, and then match it against the keys in our global <code>%locales</code> hash in line 17. That matched key then looks up the appropriate DateTime::Locale object from the hash.</p> <p>DateTime only allows you to set a locale at object construction time, so in <strong>line 18</strong> we create a new object from the old one, setting its locale to our newly-discovered <code>$locale</code> object. Finally, in <strong>lines 20 and 21</strong> we determine what method to call on that object to retrieve the CLDR (Common Locale Data Repository) formatting pattern for the requested format and then return the formatted date.</p> <p>At last, <strong>line 24</strong> starts the application. To run it using the development server included with Mojolicious, do this at the command line:</p> <p>There are other options for deploying your application, including Mojolicious’ built-in web server, inside a container, using other web servers, etc.</p> <p>The rest of the above script is in the <code>__DATA__</code> portion and contains two pseudo-files that Mojolicious knows how to read in the absence of actual templates and layouts. <strong>First on line 27</strong> is the actual <code>index.html.ep</code> HTML page, which uses Mojolicious’ Embedded Perl (ep) templating system to select a layout of shared HTML to use (the <code>layouts/default.html.ep</code> file <strong>starting on line 38</strong>).</p> <p><strong>Lines 31 through 36</strong> render an HTML unordered list that runs through the various formatting options available to our <code>localize_date</code> helper, first with the default ‘full’ formatting, and then a loop through ‘long,’ ‘medium,’ and ‘short.’ Note that we call our helper as an expression, with an equals (<code>=</code>) sign after the percent (<code>%</code>) sign.</p> <p>If you want to test different locales without changing your browser or operating system settings, you can invoke the script from the command line along with the HTTP request and headers to pass along. Here’s an example using German:</p> <pre>$ perl perl_date_locale.pl get -H 'Accept-Language: de' /<br data-rich-text-line-break="true"/><em>[2021-04-17 16:39:57.81379] [5425] [debug] [LcCSBKMVd90t] GET "https://dzone.com/"<br data-rich-text-line-break="true"/>[2021-04-17 16:39:57.81408] [5425] [debug] [LcCSBKMVd90t] Routing to a callback<br data-rich-text-line-break="true"/>[2021-04-17 16:39:57.81610] [5425] [debug] [LcCSBKMVd90t] Rendering template "index.html.ep" from DATA section<br data-rich-text-line-break="true"/>[2021-04-17 16:39:57.81714] [5425] [debug] [LcCSBKMVd90t] Rendering template "layouts/default.html.ep" from DATA section<br data-rich-text-line-break="true"/>[2021-04-17 16:39:57.81792] [5425] [debug] [LcCSBKMVd90t] 200 OK (0.004118s, 242.836/s)</em><br data-rich-text-line-break="true"/><!DOCTYPE html><br data-rich-text-line-break="true"/><html><br data-rich-text-line-break="true"/>    <head><title>Today</title></head><br data-rich-text-line-break="true"/>    <body><br data-rich-text-line-break="true"/><ul><br data-rich-text-line-break="true"/>    <li><strong>Dienstag, 20. April 2021</strong></li><br data-rich-text-line-break="true"/>    <li><strong>20. April 2021</strong></li><br data-rich-text-line-break="true"/>    <li><strong>20.04.2021</strong></li><br data-rich-text-line-break="true"/>    <li><strong>20.04.21</strong></li><br data-rich-text-line-break="true"/></ul><br data-rich-text-line-break="true"/></body><br data-rich-text-line-break="true"/></html></pre> <p>And here’s Japanese:</p> <pre>$ perl perl_date_locale.pl get -H 'Accept-Language: ja' /<br data-rich-text-line-break="true"/><em>[2021-04-17 16:40:56.10840] [5478] [debug] [Wmr6cN5KUJlP] GET "https://dzone.com/"<br data-rich-text-line-break="true"/>[2021-04-17 16:40:56.10874] [5478] [debug] [Wmr6cN5KUJlP] Routing to a callback<br data-rich-text-line-break="true"/>[2021-04-17 16:40:56.11101] [5478] [debug] [Wmr6cN5KUJlP] Rendering template "index.html.ep" from DATA section<br data-rich-text-line-break="true"/>[2021-04-17 16:40:56.11255] [5478] [debug] [Wmr6cN5KUJlP] Rendering template "layouts/default.html.ep" from DATA section<br data-rich-text-line-break="true"/>[2021-04-17 16:40:56.11360] [5478] [debug] [Wmr6cN5KUJlP] 200 OK (0.005164s, 193.648/s)</em><br data-rich-text-line-break="true"/><!DOCTYPE html><br data-rich-text-line-break="true"/><html><br data-rich-text-line-break="true"/>    <head><title>Today</title></head><br data-rich-text-line-break="true"/>    <body><br data-rich-text-line-break="true"/><ul><br data-rich-text-line-break="true"/>    <li><strong>2021年4月20日火曜日</strong></li><br data-rich-text-line-break="true"/>    <li><strong>2021年4月20日</strong></li><br data-rich-text-line-break="true"/>    <li><strong>2021/04/20</strong></li><br data-rich-text-line-break="true"/>    <li><strong>2021/04/20</strong></li><br data-rich-text-line-break="true"/></ul><br data-rich-text-line-break="true"/></body><br data-rich-text-line-break="true"/></html></pre> <p>A full list of supported locales is provided in the DateTime::Locale::Catalog documentation.</p> <p>I hope this article has helped demonstrate that it’s not too hard to make your Perl web applications <strong>respect global audiences</strong>, if only with dates. For more on localization and Perl, start with the Locale::Maketext framework.</p> </div> <p>Credit: <a href="https://dzone.com/articles/localizing-dates-in-a-perl-web-application"target="_blank">Source link</a></p> </div> </div> </div> <div class="mkdf-post-info-bottom clearfix"> <div class="mkdf-post-info-bottom-left"> </div> <div class="mkdf-post-info-bottom-right"> <div class="mkdf-blog-share"> <div class="mkdf-social-share-holder mkdf-dropdown"> <a class="mkdf-social-share-dropdown-opener" href="javascript:void(0)"> <i class="fa fa-share-alt"></i> </a> <div class="mkdf-social-share-dropdown"> <ul> <li class="mkdf-facebook-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="window.open('http://www.facebook.com/sharer.php?u=https%3A%2F%2Fkmfinfotech.com%2F2021%2F04%2F22%2Flocalizing-dates-in-a-perl-web-application%2F', 'sharer', 'toolbar=0,status=0,width=620,height=280');"> <span class="mkdf-social-network-icon fa fa-facebook"></span> </a> </li><li class="mkdf-twitter-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="window.open('https://twitter.com/share?text=When+we%26%238217%3Bre+writing+software+for+a+global+audience%2C+it%26%238217%3Bs+nice+if+we+can+provide+it+according+to+their+&url=https://kmfinfotech.com/2021/04/22/localizing-dates-in-a-perl-web-application/', 'popupwindow', 'scrollbars=yes,width=800,height=400');"> <span class="mkdf-social-network-icon fa fa-twitter"></span> </a> </li><li class="mkdf-google_plus-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="popUp=window.open('https://plus.google.com/share?url=https%3A%2F%2Fkmfinfotech.com%2F2021%2F04%2F22%2Flocalizing-dates-in-a-perl-web-application%2F', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false;"> <span class="mkdf-social-network-icon fa fa-google-plus"></span> </a> </li><li class="mkdf-linkedin-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="popUp=window.open('http://linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fkmfinfotech.com%2F2021%2F04%2F22%2Flocalizing-dates-in-a-perl-web-application%2F&title=Localizing+Dates+in+A+Perl+Web+Application', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false;"> <span class="mkdf-social-network-icon fa fa-linkedin"></span> </a> </li><li class="mkdf-tumblr-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="popUp=window.open('http://www.tumblr.com/share/link?url=https%3A%2F%2Fkmfinfotech.com%2F2021%2F04%2F22%2Flocalizing-dates-in-a-perl-web-application%2F&name=Localizing+Dates+in+A+Perl+Web+Application&description=When+we%26%238217%3Bre+writing+software+for+a+global+audience%2C+it%26%238217%3Bs+nice+if+we+can+provide+it+according+to+their+native+languages+and+conventions.+Translating+all+of+the+text+can+be+a+huge+undertaking%2C+but+we+can+start+small+by+making+sure+%5B%26hellip%3B%5D', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false;"> <span class="mkdf-social-network-icon fa fa-tumblr"></span> </a> </li><li class="mkdf-pinterest-share"> <a itemprop="url" class="mkdf-share-link" href="#" onclick="popUp=window.open('http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fkmfinfotech.com%2F2021%2F04%2F22%2Flocalizing-dates-in-a-perl-web-application%2F&description=Localizing+Dates+in+A+Perl+Web+Application&media=https%3A%2F%2Fkmfinfotech.com%2Fwp-content%2Fuploads%2F2021%2F04%2F14646390-thumb.jpg', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false;"> <span class="mkdf-social-network-icon fa fa-pinterest"></span> </a> </li> </ul> </div> </div> </div> </div> </div> </div> </article> <div class="mkdf-blog-single-navigation"> <div class="mkdf-blog-single-navigation-inner clearfix"> <a itemprop="url" class="mkdf-blog-single-prev" href="https://kmfinfotech.com/2021/04/22/mobile-game-testing-industry-leaders-challenges-and-strategies/"> <span class="mkdf-blog-single-nav-mark fa fa-arrow-left"></span> <span class="mkdf-blog-single-nav-label">Mobile Game Testing: Industry Leaders’ Challenges and Strategies</span> </a> <a itemprop="url" class="mkdf-blog-single-next" href="https://kmfinfotech.com/2021/04/22/uncover-powerful-insights-with-conductors-innovative-seo-chrome-extension-next-generation-platform/"> <span class="mkdf-blog-single-nav-mark fa fa-arrow-right"></span> <span class="mkdf-blog-single-nav-label">Uncover Powerful Insights with Conductor’s Innovative SEO Chrome Extension & Next Generation Platform</span> </a> </div> </div> <div id="disqus_thread"></div> </div> </div> <div class="mkdf-sidebar-holder mkdf-grid-col-3"> <aside class="mkdf-sidebar"> <div class="widget widget_search"><form role="search" method="get" class="searchform" id="searchform-547" action="https://kmfinfotech.com/"> <label class="screen-reader-text">Search for:</label> <div class="input-holder clearfix"> <input type="search" class="search-field" placeholder="Search..." value="" name="s" title="Search for:"/> <button type="submit" class="mkdf-search-submit"><i class="mkdf-icon-font-awesome fa fa-search" ></i></button> </div> </form></div><div class="widget mkdf-recent-post-widget"><div class="mkdf-widget-title-holder"><h5 class="mkdf-widget-title">Latest Blogs</h5></div><ul class="mkdf-recent-posts"><li class="mkdf-rp-item"><a href="https://kmfinfotech.com/2021/12/05/are-h1-tags-a-google-ranking-factor/"><div class="mkdf-rp-image"><img width="82" height="82" src="https://kmfinfotech.com/wp-content/uploads/2021/12/chapter-40-61a9e52f084ce-sej-150x150.png" class="attachment-82x82 size-82x82 wp-post-image" alt="" loading="lazy" srcset="https://kmfinfotech.com/wp-content/uploads/2021/12/chapter-40-61a9e52f084ce-sej-150x150.png 150w, https://kmfinfotech.com/wp-content/uploads/2021/12/chapter-40-61a9e52f084ce-sej-700x700.png 700w, https://kmfinfotech.com/wp-content/uploads/2021/12/chapter-40-61a9e52f084ce-sej-300x300.png 300w, https://kmfinfotech.com/wp-content/uploads/2021/12/chapter-40-61a9e52f084ce-sej-550x550.png 550w" sizes="(max-width: 82px) 100vw, 82px" /></div><p class="mkdf-rp-title"><span class="mkdf-rp-title-text">Are H1 Tags A Google Ranking Factor?</span><span class="mkdf-rp-date">December 5, 2021</span></p></a></li><li class="mkdf-rp-item"><a href="https://kmfinfotech.com/2021/12/05/revisiting-switch-and-if-then-else-dzone-web-dev/"><div class="mkdf-rp-image"><img width="82" height="82" src="https://kmfinfotech.com/wp-content/uploads/2021/12/15426902-thumb-150x150.jpg" class="attachment-82x82 size-82x82 wp-post-image" alt="" loading="lazy" /></div><p class="mkdf-rp-title"><span class="mkdf-rp-title-text">Revisiting Switch and If-then-else – DZone Web Dev</span><span class="mkdf-rp-date">December 5, 2021</span></p></a></li><li class="mkdf-rp-item"><a href="https://kmfinfotech.com/2021/12/05/building-a-better-notification-system/"><div class="mkdf-rp-image"><img width="82" height="82" src="https://kmfinfotech.com/wp-content/uploads/2021/12/15425674-thumb-150x150.jpg" class="attachment-82x82 size-82x82 wp-post-image" alt="" loading="lazy" srcset="https://kmfinfotech.com/wp-content/uploads/2021/12/15425674-thumb-150x150.jpg 150w, https://kmfinfotech.com/wp-content/uploads/2021/12/15425674-thumb-300x300.jpg 300w" sizes="(max-width: 82px) 100vw, 82px" /></div><p class="mkdf-rp-title"><span class="mkdf-rp-title-text">Building a Better Notification System</span><span class="mkdf-rp-date">December 5, 2021</span></p></a></li></ul></div><div class="widget mkdf-separator-widget"><div class="mkdf-separator-holder clearfix mkdf-separator-center mkdf-separator-normal"> <div class="mkdf-separator" style="border-style: solid;border-bottom-width: 1px;margin-top: -7px"></div> </div> </div><div class="widget mkdf-separator-widget"><div class="mkdf-separator-holder clearfix mkdf-separator-center mkdf-separator-normal"> <div class="mkdf-separator" style="border-style: solid;border-bottom-width: 1px;margin-top: -7px"></div> </div> </div><div class="widget mkdf-social-icons-group-widget text-align-left"><div class="mkdf-widget-title-holder"><h5 class="mkdf-widget-title">Follow Us</h5></div> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://www.facebook.com/KMF-Infotech-841640932901967/" target="_blank"> <span class="mkdf-social-icon-widget fa fa-facebook"></span> </a> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://twitter.com/kmfinfotech" target="_blank"> <span class="mkdf-social-icon-widget fa fa-twitter"></span> </a> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://www.linkedin.com/company/kmf-infotech" target="_blank"> <span class="mkdf-social-icon-widget fa fa-linkedin"></span> </a> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://www.instagram.com/kmfinfotech/" target="_blank"> <span class="mkdf-social-icon-widget fa fa-instagram"></span> </a> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://in.pinterest.com/4a3699b8ebada198f3c980b2a31c5f/kmf-infotech/" target="_blank"> <span class="mkdf-social-icon-widget fa fa-pinterest"></span> </a> <a class="mkdf-social-icon-widget-holder mkdf-icon-has-hover" style="color: #6f6f6f;;font-size: 18px;margin: -12px 13px 0px 0px;" href="https://kmfinfotech.tumblr.com/" target="_blank"> <span class="mkdf-social-icon-widget fa fa-tumblr"></span> </a> </div></aside> </div> </div> </div> </div> </div> <!-- close div.content_inner --> </div> <!-- close div.content --> <footer class="mkdf-page-footer"> <div class="mkdf-footer-top-holder"> <div class="mkdf-footer-top-inner mkdf-grid"> <div class="mkdf-grid-row mkdf-footer-top-alignment-left"> <div class="mkdf-column-content mkdf-grid-col-5 footer-box"> <img src="https://kmfinfotech.com/wp-content/uploads/2021/07/kmf-footer-logo.png" alt=""> <p>KMF is a powerful combination of profound tech expertise, and proven experience in a variety of business domains to turn your business idea into reality.</p> <p>Mail us at <b><a class="mail-to" href="mailto:hello@kmfinfotech.com">hello@kmfinfotech.com</a></b></p> <p>Connect with Us</p> <div class="social-media"> <a href="https://www.facebook.com/KMF-Infotech-841640932901967/"><i class="fa fa-facebook"></i></a> <a href="https://twitter.com/kmfinfotech"><i class="fa fa-twitter"></i></a> <a href="https://www.linkedin.com/company/kmf-infotech"><i class="fa fa-linkedin"></i></a> <a href="https://www.instagram.com/kmfinfotech/"><i class="fa fa-instagram"></i></a> <a href="https://in.pinterest.com/4a3699b8ebada198f3c980b2a31c5f/kmf-infotech/"><i class="fa fa-pinterest-p"></i></a> <a href="https://kmfinfotech.tumblr.com/"><i class="fa fa-tumblr"></i></a> </div> </div> <div class="mkdf-column-content mkdf-grid-col-7 footer-right"> <div class="footer-col"> <h6>Services</h6> <ul> <li><a href="https://kmfinfotech.com/web_design/">Web Designing</a></li> <li><a href="https://kmfinfotech.com/our-servicesweb-technology/">Web Development</a></li> <li><a href="https://kmfinfotech.com/mobile_application/">Mobile Application</a></li> <li><a href="https://kmfinfotech.com/our-servicesonline-marketing/">Online Marketing</a></li> <li><a href="https://kmfinfotech.com/our-servicesbranding/">Branding</a></li> <li><a href="https://kmfinfotech.com/our-servicesvideo-animation-production/">Video Animation Production</a></li> </ul> </div> <div class="footer-col"> <ul> <li><a href="#"></a></li> <li><a href="https://kmfinfotech.com/portfolio/"></a></li> <li><a href="#"></a></li> <li><a href="https://www.kmfinfotech.com/blog/"></a></li> </ul> </div> <div class="footer-col"> <h6>Latest Blogs</h6> <ul> <li><a href="https://kmfinfotech.com/2021/12/05/are-h1-tags-a-google-ranking-factor/">Are H1 Tags A Google Ranking Factor?</a></li> <li><a href="https://kmfinfotech.com/2021/12/05/revisiting-switch-and-if-then-else-dzone-web-dev/">Revisiting Switch and If-then-else – DZone Web Dev</a></li> <li><a href="https://kmfinfotech.com/2021/12/05/building-a-better-notification-system/">Building a Better Notification System</a></li> </ul> </div> <div class="address-section"> <address> <strong>UNITED STATES</strong> <span>201 St Charles Ave Suite 2500,<br> New Orleans, LA 70170<br> <a href="tel:+1-504-446-7169">+1 504-446-7169</a> </span> </address> <address> <strong>CANADA</strong> <span>210 Richmond St W<br> Toronto,ON M5V 1V6<br> <a href="tel:+1-437-537-5167">+1 437-537-5167</a> </span> </address> <address> <strong>INDIA</strong> <span>33/29, GALI NO 10, Bhikam Singh Colony,<br> Vishwas Nagar, Shahdara, Delhi-110032<br> <a href="tel:+91-9818988070">+91 9818988070</a> </span> </address> </div> </div> </div> </div> </div> <div class="footer-bottom"> <div class="copyright"> <p>Copyright © 2012 - 2022 KMF INFOTECH. All Rights Reserved.</p> </div> </div> </footer> </div> <!-- close div.mkdf-wrapper-inner --> </div> <!-- close div.mkdf-wrapper --> <script type="text/javascript"> window.RS_MODULES = window.RS_MODULES || {}; window.RS_MODULES.modules = window.RS_MODULES.modules || {}; window.RS_MODULES.waiting = window.RS_MODULES.waiting || []; window.RS_MODULES.defered = false; window.RS_MODULES.moduleWaiting = window.RS_MODULES.moduleWaiting || {}; window.RS_MODULES.type = 'compiled'; </script> <div class="eg-everest-lightbox-overlay"> <div class="eg-everest-lightbox-controls"> <span class="eg-everest-lightbox-previous">Previous</span> <span class="eg-everest-lightbox-next">Next</span> </div> <div class="eg-close-pop-up"> <span class="eg-everest-lightbox-close">Close</span> </div> <div class="eg-everest-lightbox-inner-overlay"></div> <div class="eg-everest-lightbox-wrap"> <div class="eg-everest-lightbox-source-holder"> <img src=""/> </div> <div class="eg-everest-lightbox-details-wrap"> <div class="eg-everest-lightbox-caption">Test Caption</div> <div class="eg-everest-lightbox-description">Test Description goes like this</div> </div> </div> </div> <div id='fb-root'></div> <script data-type="lazy" data-src="data:text/javascript;base64,KGZ1bmN0aW9uKGQsIHMsIGlkKSB7CiAgICAgICAgICAgIHZhciBqcywgZmpzID0gZC5nZXRFbGVtZW50c0J5VGFnTmFtZShzKVswXTsKICAgICAgICAgICAganMgPSBkLmNyZWF0ZUVsZW1lbnQocyk7IGpzLmlkID0gaWQ7CiAgICAgICAgICAgIGpzLnNyYyA9ICdodHRwczovL2Nvbm5lY3QuZmFjZWJvb2submV0L2VuX1VTL3Nkay94ZmJtbC5jdXN0b21lcmNoYXQuanMjeGZibWw9MSZ2ZXJzaW9uPXY2LjAmYXV0b0xvZ0FwcEV2ZW50cz0xJzsKICAgICAgICAgICAgZmpzLnBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlKGpzLCBmanMpOwogICAgICAgICAgfShkb2N1bWVudCwgJ3NjcmlwdCcsICdmYWNlYm9vay1qc3NkaycpKTs="></script> <div class='fb-customerchat' attribution='wordpress' attribution_version='2.2' page_id=841640932901967 > </div> <link rel='stylesheet' id='rs-plugin-settings-css' href='https://kmfinfotech.com/wp-content/plugins/revslider/public/assets/css/rs6.css?ver=6.5.8' type='text/css' media='all' /> <style id='rs-plugin-settings-inline-css' type='text/css'> #rs-demo-id {} </style> <script type='text/javascript' id='disqus_count-js-extra'> /* <![CDATA[ */ var countVars = {"disqusShortname":"kmfinfotech"}; /* ]]> */ </script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/disqus-comment-system/public/js/comment_count.js?ver=3.0.22' id='disqus_count-js'></script> <script type='text/javascript' id='disqus_embed-js-extra'> /* <![CDATA[ */ var embedVars = {"disqusConfig":{"integration":"wordpress 3.0.22"},"disqusIdentifier":"5574 https:\/\/kmfinfotech.com\/blog\/localizing-dates-in-a-perl-web-application\/","disqusShortname":"kmfinfotech","disqusTitle":"Localizing Dates in A Perl Web Application","disqusUrl":"https:\/\/kmfinfotech.com\/2021\/04\/22\/localizing-dates-in-a-perl-web-application\/","postId":"5574"}; /* ]]> */ </script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/disqus-comment-system/public/js/comment_embed.js?ver=3.0.22' id='disqus_embed-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/revslider/public/assets/js/rbtools.min.js?ver=6.5.8' async id='tp-tools-js'></script> <script type='text/javascript' async id='revmin-js' data-type="lazy" data-src="https://kmfinfotech.com/wp-content/plugins/revslider/public/assets/js/rs6.min.js?ver=6.5.8"></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/jquery/ui/core.js?ver=1.12.1' id='jquery-ui-core-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/jquery/ui/tabs.js?ver=1.12.1' id='jquery-ui-tabs-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/jquery/ui/accordion.js?ver=1.12.1' id='jquery-ui-accordion-js'></script> <script type='text/javascript' id='mediaelement-core-js-before'> var mejsL10n = {"language":"en","strings":{"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https:\/\/get.adobe.com\/flashplayer\/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left\/Right Arrow keys to advance one second, Up\/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up\/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions\/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}}; </script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/mediaelement/mediaelement-and-player.js?ver=4.2.16' id='mediaelement-core-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/mediaelement/mediaelement-migrate.js?ver=5.8.2' id='mediaelement-migrate-js'></script> <script type='text/javascript' id='mediaelement-js-extra'> /* <![CDATA[ */ var _wpmejsSettings = {"pluginPath":"\/wp-includes\/js\/mediaelement\/","classPrefix":"mejs-","stretching":"responsive"}; /* ]]> */ </script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/mediaelement/wp-mediaelement.js?ver=5.8.2' id='wp-mediaelement-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.appear.js?ver=5.8.2' id='appear-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/modernizr.min.js?ver=5.8.2' id='modernizr-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/hoverIntent.js?ver=1.10.1' id='hoverIntent-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.plugin.js?ver=5.8.2' id='jquery-plugin-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/owl.carousel.min.js?ver=5.8.2' id='owl-carousel-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.waypoints.min.js?ver=5.8.2' id='waypoints-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/fluidvids.min.js?ver=5.8.2' id='fluidvids-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/js_composer/assets/lib/prettyphoto/js/jquery.prettyPhoto.min.js?ver=6.4.2' id='prettyphoto-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/perfect-scrollbar.jquery.min.js?ver=5.8.2' id='perfect-scrollbar-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/ScrollToPlugin.min.js?ver=5.8.2' id='ScrollToPlugin-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/parallax.min.js?ver=5.8.2' id='parallax-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.waitforimages.js?ver=5.8.2' id='waitforimages-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.easing.1.3.js?ver=5.8.2' id='jquery-easing-1.3-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/js_composer/assets/lib/bower/isotope/dist/isotope.pkgd.min.js?ver=6.4.2' id='isotope-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/packery-mode.pkgd.min.js?ver=5.8.2' id='packery-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.geocomplete.min.js?ver=5.8.2' id='geocomplete-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.mousewheel.min.js?ver=5.8.2' id='mousewheel-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules/plugins/jquery.parallax-scroll.js?ver=5.8.2' id='parallax-item-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/countdown/assets/js/plugins/jquery.countdown.min.js?ver=5.8.2' id='countdown-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/counter/assets/js/plugins/counter.js?ver=5.8.2' id='counter-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/counter/assets/js/plugins/absoluteCounter.min.js?ver=5.8.2' id='absoluteCounter-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/custom-font/assets/js/plugins/typed.js?ver=5.8.2' id='typed-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/full-screen-sections/assets/js/plugins/jquery.fullPage.min.js?ver=5.8.2' id='fullPage-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/pie-chart/assets/js/plugins/easypiechart.js?ver=5.8.2' id='easypiechart-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/plugins/gluck-core/shortcodes/vertical-split-slider/assets/js/plugins/jquery.multiscroll.min.js?ver=5.8.2' id='multiscroll-js'></script> <script type='text/javascript' id='gluck-mikado-modules-js-extra'> /* <![CDATA[ */ var mkdfGlobalVars = {"vars":{"mkdfAddForAdminBar":0,"mkdfElementAppearAmount":-100,"mkdfAjaxUrl":"https:\/\/kmfinfotech.com\/wp-admin\/admin-ajax.php","mkdfStickyHeaderHeight":0,"mkdfStickyHeaderTransparencyHeight":70,"mkdfTopBarHeight":35,"mkdfLogoAreaHeight":0,"mkdfMenuAreaHeight":125,"mkdfMobileHeaderHeight":100}}; var mkdfPerPageVars = {"vars":{"mkdfMobileHeaderHeight":100,"mkdfStickyScrollAmount":0,"mkdfHeaderTransparencyHeight":0,"mkdfHeaderVerticalWidth":0}}; /* ]]> */ </script> <script type='text/javascript' src='https://kmfinfotech.com/wp-content/themes/gluck/assets/js/modules.js?ver=5.8.2' id='gluck-mikado-modules-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/comment-reply.js?ver=5.8.2' id='comment-reply-js'></script> <script type='text/javascript' src='https://kmfinfotech.com/wp-includes/js/wp-embed.js?ver=5.8.2' id='wp-embed-js'></script> <script type="text/javascript" id="flying-scripts">const loadScriptsTimer=setTimeout(loadScripts,5*1000);const userInteractionEvents=["mouseover","keydown","touchstart","touchmove","wheel"];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})} function loadScripts(){document.querySelectorAll("script[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}</script> <script type="text/javascript" src='//kmfinfotech.com/wp-content/uploads/custom-css-js/4072.js?v=2429'></script> <script type="text/javascript"> jQuery(document).ready(function ($) { for (let i = 0; i < document.forms.length; ++i) { let form = document.forms[i]; if ($(form).attr("method") != "get") { $(form).append('<input type="hidden" name="YrCzJjSTqcgfEsa" value="mZxb_7eklRz" />'); } if ($(form).attr("method") != "get") { $(form).append('<input type="hidden" name="FtONfDUwRpyKBxmJ" value="k9RMOo" />'); } if ($(form).attr("method") != "get") { $(form).append('<input type="hidden" name="YCpfWK" value="trlfh.342G" />'); } } $(document).on('submit', 'form', function () { if ($(this).attr("method") != "get") { $(this).append('<input type="hidden" name="YrCzJjSTqcgfEsa" value="mZxb_7eklRz" />'); } if ($(this).attr("method") != "get") { $(this).append('<input type="hidden" name="FtONfDUwRpyKBxmJ" value="k9RMOo" />'); } if ($(this).attr("method") != "get") { $(this).append('<input type="hidden" name="YCpfWK" value="trlfh.342G" />'); } return true; }); jQuery.ajaxSetup({ beforeSend: function (e, data) { if (data.type !== 'POST') return; if (typeof data.data === 'object' && data.data !== null) { data.data.append("YrCzJjSTqcgfEsa", "mZxb_7eklRz"); data.data.append("FtONfDUwRpyKBxmJ", "k9RMOo"); data.data.append("YCpfWK", "trlfh.342G"); } else { data.data = data.data + '&YrCzJjSTqcgfEsa=mZxb_7eklRz&FtONfDUwRpyKBxmJ=k9RMOo&YCpfWK=trlfh.342G'; } } }); }); </script> </body> </html>