Howdy Perl Monks, I'm trying to use the Perl Module Net::MirrorDir to compare local and remote directories. But in some cases I have file names with spaces between them and i can't get it compare the dir's. Is it possible to do compare directories when there are file names with spaces between them? Here is what i've got now:

sub compare_dirs { my ($host, $login, $password, $dir, $rmt_dir) = @_; my $md = Net::MirrorDir->new( ftpserver => $host, user => $login, pass => $password, localdir => $dir, remotedir => $rmt_dir, debug => 0, # 1 for yes, 0 for no timeout => 60 # default 30 ); $md->Connect(); my ($ref_h_local_files, $ref_h_local_dirs) = $md->ReadLocalDir(); my ($ref_h_remote_files, $ref_h_remote_dirs) = $md->ReadRemoteDir( +); my $ref_a_local_files_not_in_remote = $md->LocalNotInRemote( $ref_h_local_files, $ref_h_remote_files ); my $ref_a_remote_files_not_in_local = $md->RemoteNotInLocal( $ref_h_local_files, $ref_h_remote_files ); #transfer remote files which are not on local system foreach my $new_remote_file_not_in_local (@{$ref_a_remote_files_no +t_in_local}) { #transfer the files from remote site to local print "$new_remote_file_not_in_local... \n"; } #transfer local files not on remote system foreach my $new_local_file_not_in_remote (@{$ref_a_local_files_not +_in_remote}) { #transfer files from local site to remote site print "$new_local_file_not_in_remote... \n"; } }

any help is appreciated. Cheers


In reply to Net::MirrorDir help by sunnyfedora99

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.