I am trying to get that Perl split working for more than 2 hours. I don’t see an error. Maybe some other eyes can look at it and see the issue. I am sure its a silly one:
@versionsplit=split('.',"15.0.3");
print $versionsplit[0];
print $versionsplit[1];
print $versionsplit[2];
I just get an empty array. Any idea why?
You need:
The first argument to
splitis a regular expression, not a string. And.is the regex symbol which means ‘match any character’. So all the characters in your input string were being treated as separators, andsplitwasn’t finding anything between them to return.