Hi hopefully someone can help here. i am no expert in perl but have dabbled for a while. I wrote a script to sequentially go through a list of PC names, map to the c: drive then search for .pst files then report back their names and sizes as we are planning on doing a purge to stop users using .pst files. Now i wrote the following script and it worked a treat. However i had active perl 5.2.1 installed on PC. When i distributed the script to people in other offices they all have 5.6.1 and this is the company standard at the moment. My script does not work with 5.6.1 sadly. I dont know why or what to change. Were there changes to Find::File or 'find' in 5.6.1? Do i need to call or invoke differently? Please see below code snippets:
. . . if ($MapResult == 1){ find (\&pstFind, $dir); }elsif ($MapResult == 0){ push @missedEntry,$PCName; }#end if . . . sub pstFind{ print "\n** Test Line **\n"; if (/\.PST$/ || /\.pst$/){ my $entry = "$PCName"." $File::Find::dir"."/$_\n"; my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $theres +t) = stat($_) or die "Unable to stat $_\n"; chomp $entry; $entry = "$entry" . " = $size bytes\n"; $ByteCount += $size; print "$entry\n"; open (OUTFILE, ">> $outfile"); print OUTFILE $entry; close OUTFILE; }# end if }#end sub . . .
So from this whenever the result is 1 (succesfully mapped to target c: drive) then perform the find subroutine. If a .pst file is found stick it in a log file with its location and size. There are other parts but this is the main thing. Now this is sweet with 5.2.1 but with 5.6.1 It succesfully searches against the first PC but any subsequent PCs it only searches against the first 5 files in the target directory, then ends, and goes to the next PC and so on. I also had another issue that with 5.6.1 it does not populate the @ARGV array at all. Most annoying but can workaround that. Any ideas on that one. Maybe we have a duff install of 5.6.1 on our distribution server (not allowed to dload anything either).

In reply to Problem with Find by redhotchippyleper

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.