On Fri, 2006-05-26 at 09:45 +1000, Keenan, Greg John (Greg)** CTR **
wrote:

> --start--
> use strict;
> use warnings;
>  
> my $cfgDir = '/amanda/admin/etc/amanda';
> my @cfgs = qw(Toaster MFG-UNIX SYS-UNIX Amanda-Daily);
> my %numTapes = (
>   "$cfgs[0]" => 6,
>   "$cfgs[1]" => 5,
>   "$cfgs[2]" => 5,
>   "$cfgs[3]" => 1,
>   );
>  
> my $cfg;
> foreach $cfg (@cfgs) {
>     my $fileIn="$cfgDir/$cfg/tapelist";
>     open (FILEIN, "<$fileIn") or die ("Could not open $fileIn: $!");
>     my @lines = reverse <FILEIN>;
>     my $line;
> #    foreach $line (@lines) {
> #        print "$line\n";
> #    }
        print (@lines)[0 .. $numTapes{"$cfg"}];
> }
> --end--


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to