#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Ftp tool help a rookie!


    I'm kind of new to perl and am working through a ftp tool written in perl and trying to replicate it in C#. I have a few questions and hope you guys can help me. A lot of the syntax is just unintuitive to me and it's taking me a long time to find these in a book (learning perl by oreilly

    for ex.

    where src_file and tmp_file are 2 directory paths

    $success = $src_ftp->get( $src_file, $tmp_file );

    for something like this what is being returned to success? I've also seen it with just the RHS of the equal sign so it's confusing to me. Does a function like ftp->get return 1 or true by default if the operation is successful. Also most of the ones I've seen have one parameter for ftp->get, here there are 2. Is it trying to get both files and what does it do with them?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    828
    Rep Power
    496
    $src_file and $tmp_file are most probably file names (with possib ly a directory path), not directory path.

    Whether you are using Net::FTP in your program or some other module, get is quite obviously a method to transfer a file from the remote location to the local one, just as the get FTP command.

    If the module used is Net::FTP, then only the first parameter (distant filename) is mandatory. If the second parameter is specified, it will be the name given to the local file; if the second parameter is omitted, the local file is created in the current default directory and takes the name of the distant dile). The get method returns a true value (the local file name) if successful, a false value (undef) otherwise.

IMN logo majestic logo threadwatch logo seochat tools logo