Example: Parse 123_456_789
so that variable1 = 123, variable2 = 456, variable3 = 789.
thanks for any input here.
If you know there are always going to be 3 "items" in your input string, you could do the following:
my $string = "123_456_789";
my ($variable1, $variable2, $variable1) = split(/_/,$string);
If there could be a variable number, then split it to an array, then loop thru the array:
my $string = "123_456_789";
my @vars = split(/_/,$string);
foreach (@vars) {
print "$_";
}
Cheers
Mike