in reply to Having difficulties with "split"

General rule: when you know what you don't want, use split. When you know what you WANT, use regex.

push (@NewCoordinates, $C =~ /\d{7,8}/g);

Replies are listed 'Best First'.
Re^2: Having difficulties with "split"
by Anonymous Monk on Apr 26, 2015 at 22:12 UTC
    # then again, even the "map" is not needed @NewCoordinates = "@Coordinates" =~ /\d+/g;
Re^2: Having difficulties with "split"
by Anonymous Monk on Apr 26, 2015 at 22:06 UTC
    # no need for a "for" loop @NewCoordinates = map /\d+/g, @Coordinates;
Re^2: Having difficulties with "split"
by Anonymous Monk on Apr 26, 2015 at 21:49 UTC
    Oops, I misread as 7 or 8 digit numbers. just use /\d+/g for the regex.