U
usaims
Hi,
I'm trying to get this little script to print:
10.230.0.14
10.230.0.15
10.230.0.16
but its printing:
1
10.230.0.ARRAY(0x8105294)
###################################
Below is the script, what am I doing wrong?
#!/usr/bin/perl
use warnings;
use strict;
my @range_one = (14, 15, 16);
my @range_two = (23, 24, 25);
my %roxiecluster = (
"1" => \@range_one,
"2" => \@range_two
);
print "What range do you want to check on?\n";
print "Press (1) and <ENTER> for Range 1
[10.230.0.14-23]\n";
print "Press (2) and <ENTER> for Range 2
[10.230.0.23-25]\n";
my $choice = <STDIN>;
chomp($choice);
my @roxie = $roxiecluster{$choice};
foreach my $x (@roxie) {
print "10.230.0.$x\n";
}
I'm trying to get this little script to print:
10.230.0.14
10.230.0.15
10.230.0.16
but its printing:
1
10.230.0.ARRAY(0x8105294)
###################################
Below is the script, what am I doing wrong?
#!/usr/bin/perl
use warnings;
use strict;
my @range_one = (14, 15, 16);
my @range_two = (23, 24, 25);
my %roxiecluster = (
"1" => \@range_one,
"2" => \@range_two
);
print "What range do you want to check on?\n";
print "Press (1) and <ENTER> for Range 1
[10.230.0.14-23]\n";
print "Press (2) and <ENTER> for Range 2
[10.230.0.23-25]\n";
my $choice = <STDIN>;
chomp($choice);
my @roxie = $roxiecluster{$choice};
foreach my $x (@roxie) {
print "10.230.0.$x\n";
}