Hi,Is there any way that Editions can be read in reverse order through Perl code? We are now reading the entire editions and reversing it to display the latest 10 editions. I am looking for minimising the time it is taking to display. So would like to read the Edition from the latest, so that the time taken to read the entire array is minimised. Thanks.
No. We are not using iwlist. Below is the perl snippet used currently to read the editions and reverse it.sub getEdition{ my ( $branch, $limit ) = @_; # $limit is the number of editions to be displayed(eg: 20) my $dirName = $branch . '/EDITION'; my $hasError = 0; my @allEditions = (); my @tmpArray = (); my @returnEditions = (); opendir (FILE, $dirName) or handle_error(4, "Failed to open directory: $dirName"), $hasError++; return ( $hasError ) if $hasError ;@allEditions = grep(!/^\./, readdir (FILE) );@returnEditions = reverse @allEditions; close FILE; if ( defined $limit && scalar(@returnEditions) > $limit ) { $limit--;@tmpArray = @returnEditions[0 .. $limit]; return ($hasError, \@tmpArray); } else { return ($hasError, \@returnEditions); }}Instead of reading all the editions and reversing it, I am looking for a way to read the last 20 editions.
According to the current code, @allEditions array has the complete edition list. And @returnEditions array has the complete reversed Editions list.Finally we display the number of editions we needed(20 or 30...).I need the same output as the one I am getting now. But the problem is, we have thousands of editions. So it takes very long time to load the output of just 20 Editions, since it is reading all the editions, reversing it and then displaying just 20. I need to minimise this time, by directly reading the latest 20 Editions, so that the complete reading and reversing of all the editions is avoided. Is there a way to do this?Thanks.
my @editions = map {chomp $_; $_;} qx(dir /B /AD /O-D $iwmount$branch\\EDITION);
We are using Windows XP. Teamsite version 6.7.1 SP1.how do I specify the limit using this?