in reply to Abritrary multiple spaces as delimiter

What do you mean exactly by "arbitrary"? If it means a constant, known at run-time, number of spaces, then it's easy, just do a split on that number of spaces. If you mean random, unknown and different from line to line, then the answer is easy: with the information you give, you can't. In your example, there is no way to know where to split Genesis Chamber Mark Tedin in 2 strings.

Now all is not lost, you can try various heuristics to figure out what to do, but remember # 11953 Of course, this is a heuristic, which is a fancy way of saying that it doesn't work (from MJD):

#!/usr/bin/perl -w use strict; while( <DATA>) { if( m{^\d+ # initial digits (1rst field) \s+ # separating space(s) (.*?) # the 2cd and 3rd field \s+ # separating space(s) \S # 1 (non-space) character (4th field) \s+ # separating space(s) \S # 1 (non-space) character (5th field) \s* # you might or might not want to allow extra spaces + a the end of the line $}x ) { my $fields= $1; my @fields; # @fields= heuristic1( $fields) || heuristic2( $fields); # does not work as the || seems to put the first function call + in scalar mode, weird @fields= heuristic1( $fields); unless( @fields) { @fields= heuristic2( $fields); } if( @fields) { print "field 2: '$fields[0]' - field 3: '$fields[1]'\n"; } else { warn "cannot extract field 2/3 of line $. Fields are: '$fi +elds'\n"; } } else { warn "can't parse line $."; } } # only 2 words, that's easy sub heuristic1 { my $fields= shift; my @fields= split /\s+/, $fields; if( @fields == 2) { return @fields } else { return; } } # more than one space separates the 2 fields sub heuristic2 { my $fields= shift; my @fields= split /\s\s+/, $fields; if( @fields == 2) { return @fields } else { return; } } __DATA__ 122 Genesis Chamber Mark Tedin A U 123 f2w f3w 4 5 123 f2w1 f2w2 f3w 4 5 123 f2w1 f2w2 f3w1 f3w2 4 5 123 f2w f3w 4 99 123 f2w1 f2w2 f3w1 f3w2 4 5