learingperl01
MIS
Hello, I was wondering how to push data into an array but at the same time when pushing to an array add a '.'
for example. Variable which holds numbers
The reason I am splitting the original number when entered is because I will be running tests/other code against each one of the numbers, but once I am done with each set/group of numbers...etc I want to print the results out in an dotted notation instead of 1 group of numbers per line.
Thanks,
What I would like to do is push/join each number back into an array but dotted(with .) so that the results are 232.226.658.3
thanks for the help in advance!!!
for example. Variable which holds numbers
The reason I am splitting the original number when entered is because I will be running tests/other code against each one of the numbers, but once I am done with each set/group of numbers...etc I want to print the results out in an dotted notation instead of 1 group of numbers per line.
Thanks,
Code:
my $INPUT = $ARGV[0];
@NUM = split(/\./,$INPUT);
foreach $DAT ( @NUM ) {
print "$DAT, "\n";
}
__RESULTS__
this is the printed result
232
226
658
3
What I would like to do is push/join each number back into an array but dotted(with .) so that the results are 232.226.658.3
thanks for the help in advance!!!