F
fishfry
If I have
$text = 'abc - def - ghi - jkl";
then
@tokens = split(/-/, $text, 3);
splits the line into abc, def, ghi - jkl (ignoring leading and trailing
spaces).
I have an application where there may be 3 or 4 items separated by '-'
but if there are 4, I want them returned as abc - def, ghi, and jkl.
Is there a one-liner for that?
$text = 'abc - def - ghi - jkl";
then
@tokens = split(/-/, $text, 3);
splits the line into abc, def, ghi - jkl (ignoring leading and trailing
spaces).
I have an application where there may be 3 or 4 items separated by '-'
but if there are 4, I want them returned as abc - def, ghi, and jkl.
Is there a one-liner for that?