Very nice. Some two-penny suggestions:
  1. I would suggest to use constant for variables such like $version etc. If it is something should not be modified, specify 'use constant', so its value will not be accidentally changed.
  2. You used quite a lot of 'global' variables. For example, sub ftp_file uses $ftp_file, $ftp_user, $ftp_pass etc, but none of them are passed in as parameters. Try to use variables with a smaller scope.
  3. Things like $ftp_pass should not be stored with the source code, it is a little bit too dangerous. Promopt for password, even can be a GUI interface. (I know, to hard code the password, you could save yourself a little bit time, each time you use this script, but it is not worth compare to the security issue.)
  4. Package it as a class, so other people may reuse your code easily.

In reply to Re: Compress and FTP files by pg
in thread Compress and FTP files by gnu@perl

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.