You can pass a regex or a string
Just keep in mind that using single quotes around the pattern (instead of /.../) does not make it a plain string — it's still a regex. Although this is not relevant here, it might make a difference in other cases:
#!/usr/bin/perl -l my $s = 'xABCxACxABBCxAB*Cx'; print join(' - ', split('AB*C', $s)); # x - x - x - xAB*Cx
In reply to Re^2: split based upon string
by almut
in thread split based upon string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |