L~R - thanks for time & patience: I take your point about indentation. I will use <code> tags in future to preserve my code layout.

You are almost right in your assumption that $timeThen is an epoch time stamp (in fact time-(14*24*60*60) to give time in seconds 14 days ago). Also $connect is the same as $ftp in your code. I am using warnings and strictures.

Unfortunately, even using your modified code my program still dies on the first .stm file it finds with the 'cannot get mdtm' message.

However, if I comment out the 'die "cannot get mdtm ..."' line, I get this error message displayed (for every .stm file in the directory): "Use of uninitialized value in localtime at mdtm_test.pl at line 36."

(Line 36 is the 'print "$file last modified ... "' line). Then it prints the time last modified as "file name last modified : Thu Jan 1 00:00:00 1970"! The epoch if not much mistaken. Obviously my .stm files have been modified since then.

Not entirely sure what that error message is telling me but it's a start. I realise I will have to convert either the modified time into secs or the $stamp time into an epoch time stamp (possibly using POSIX strftime).

Thanks again for your time
Stewartski


In reply to Re: Re: Re: Re: using $ftp->mdtm($file) by stewartski
in thread using $ftp->mdtm($file) by stewartski

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.