[EMAIL PROTECTED] wrote:
> ---INTERNET EMAIL NOTIFICATION---
>    This email originates from the Internet and therefore may
> not be from the apparent sender. Please check any attachments
> carefully before opening them as they may not be as they appear.
> If you have any doubts about the origin or content of the
> email please contact PC Support on x2288.
> ---
> 
> hmm.. suggestions on the best way to go through the directory
> was discussed, maybe you can help me figure out the initializatoin
> issue.... 
> 
> purpose of script: test RAIDCore during transformations and other
> issues 
> 
> problem line: 111 ;
> 
>     system "cta verify "[EMAIL PROTECTED]($#dirents *1)]." >> $log";
> 
> problems is that the @dirents[rand($#dirents *1)] ....
> doesn't show, somehow it's not getting the filename in context:
> 
>     # else open drive; read files in to array
>     # ignoring possible folders; randomly choose a file
>     # verify contents of file using cta
> 
>     open DDRV, $dir;
>     while($file = readdir DDRV){
>       if(-d "$dir\\$file") { next; }
>       else{ push @dirents, "$dir\\$file"; }
>     }
>     close DDRV;

Aside from tha fact that you should be using opendir/closedir, and
checking the result, would globbing not work? for example

my @dirents = grep {-f} <$dir/*>;

> 
>     system "cta verify "[EMAIL PROTECTED]($#dirents *1)]." >> $log";    
> $done++; 

Your '@dirents[rand($#dirents *1)]' is just so wrong. Getting a random
element from an array is a FAQ. See 'perldoc -q "random element"'.

HTH

-- 
Brian Raven
 



-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary 
companies.
-----------------------------------------------------------------------


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to