In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] writes:
> En op 15 oktober 2002 sprak Aaron Mackey:
>> @d = splice(split, -4); # I always know that the last 4 fields
> 
> This won't compile (first argument to splice must be an array).
> 
>> # this next line is the one to focus on:
>> $str = join("", (split(/(\s+)/, $_, scalar(@d) + 1))[0..2*$#d]);
>> method 2:
>> ($str) = m/^(\S+(?:\s+\S+){$#d})/;
> 
> @d = (split)[-4..-1];    # @d contains last 4 fields for later use
> s/(?:\s+\S+){4}\s*$//;   # $_ now contains required string
> 
> /-\
/\S+/g;//;//;//;// # $` now contains required string


Reply via email to