Just got a quick query regarding a perl script.
basically I have this line and want to allow the user to enter multiple values
EDIT: worked it out it can be done like this:
but no idea how i can implement this into my script
basically I have this line and want to allow the user to enter multiple values
Code:
print "please type the service instance...\n";
my $servinst = <STDIN>;
EDIT: worked it out it can be done like this:
Code:
#!/usr/bin/perl
print "Enter service instances separated by comma\n";
my $servinst = <STDIN>;
chomp $servinst;
my @hosts = split(/\,/, $input);
foreach(@hosts) {
print "Anything"\n";
}
but no idea how i can implement this into my script
Last edited: