Apologies for the delay of code. My code is like

my $last_executed = $time_file . ".txt"; return 1 unless (-e $last_executed); open(IN, '<' . $last_executed); my $time = <IN>; close(IN); my $valid_time = $time; return 1 if ( $valid_time !~ m/(\d{4})-(\d{2})-(\d{2})(?:T)?(\d{2}):(\ +d{2})/gi ); my ($year, $month, $day, $hour, $min) = $time =~ m#(\d{4})-(\d{2})-(\d +{2})(?:T)?(\d{2}):(\d{2})#gi; my $dt1 = DateTime->new ( year => $year, month => $month, day => $day, +hour => $hour, minute => $min); my $time2 = localtime->datetime; my ($year2, $month2, $day2, $hour2, $min2) = $time2 =~ m#(\d{4})-(\d{2 +})-(\d{2})(?:T)?(\d{2}):(\d{2})#gi; my $dt2 = DateTime->new ( year => $year2, month => $month2, day => $da +y2,hour => $hour2, minute => $min2);

In reply to Re: garbage at end of string in strptime by manorhce
in thread garbage at end of string in strptime by manorhce

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.