system : windows 7

i search for file::tiny in ppm but not found

my logic:

open both dir and take list of filename in array so one contain 2 and other 3 then in for loop i run index of array to capture individual file and apply copy() from File::Copy but when i m using $test1$x one dir contain one less file so i got an err so my copy statement not executed.. please help....
use strict; use warnings; use File::Copy; my @test1; my @test2; print "Enter the file path form where you want to copy file:\n"; chomp(my $path1 = <STDIN>); opendir DH, "$path1" || die "$!"; @test1 = readdir (DH); print "@test1\n"; print "Enter the file path form where you want to copy file:\n"; chomp(my $path2 = <STDIN>); opendir DH, "$path2" || die "$!"; @test2 = readdir (DH); print "@test2\n"; my $count = @test1; my $count2 = @test2; my $x = 0; for ($x = 0; $x<$count2; $x++) { if($test1[$x] ne $test2[$x]) { print "$test1[$x] : $test2[$x]\n"; # copy("$test1[$x]", "$path2") or warn "cannot copy $test1[$x]" +; # copy("$test2[$x]", "$path1")or warn "cannot copy $test2[$x]"; +; } }

In reply to Re^6: dir handle by Mjpaddy
in thread dir handle by Mjpaddy

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.