#!/usr/bin/perl
my @devices = qw (
3
DHS_FCPort
DHS_DiskDrive
DHS_StorageVolume
);
sub arraytest
{
my @devs;
my $assName;
$count = 0;
$pCount = 0;
my @params = @_;
foreach my $para (@params)
{
if (0 == $count)
{
$pCount = $para;
}
else
{
if ($count <= $pCount)
{
push @devs, $para;
}
else
{
$assName = $para;
}
}
$count++;
}
print("assName = ", $assName, "\n");
print("count = ", $count, "\n");
print("pCount = ", $pCount, "\n");
foreach my $dev (@devs)
{
print("dev = ", $dev, "\n");
}
}
sub main
{
arraytest(@devices, "wdb test");
}
exit main;
main();
阅读(1884) | 评论(0) | 转发(0) |