Answer the question
In order to leave comments, you need to log in
Problem with split (perl)?
I'm trying to use split to split a string ($myline) of the form: +1,-2,+5
into substrings separated by commas, but everything fails with an error:
Code:
if ($myline ne '.') {
@tmp_users = split(/\,/, $myline);
foreach $tmp_user (@tmp_users) {
switch (split($tmp_user, 0, 1)) {
case '+' {
print '+++', $tmp_user,'\n';
}
case '-' {
print '-', $tmp_user,'\n';
}
else {
if (isdigit $tmp_user) {
print '_', $tmp_user,'\n';
@users = (@users, $username[$tmp_user]);
} else {
# print 'else else cond_';
}
}
}
}
} else {
#изменений в составе команды проекта нет
print 'ok';
}
.
or 1,9
then everything works fine.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question