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
- correctly rebuilding a whitespace-split string Aaron J Mackey
- Re: correctly rebuilding a whitespace-split s... Yitzchak Scott-Thoennes
- RE: correctly rebuilding a whitespace-split s... Patrick Connolly
- Re: correctly rebuilding a whitespace-split s... Bart Lateur
- Re: correctly rebuilding a whitespace-spl... Bart Lateur
- Re: correctly rebuilding a whitespace-spl... Jasper McCrea
- Re: correctly rebuilding a whitespace... Bart Lateur
- Re: correctly rebuilding a whites... Jasper McCrea
- Re: correctly rebuilding a whitespace-split s... Andrew . Savige
- Re: correctly rebuilding a whitespace-spl... Ton Hospel
- Re: correctly rebuilding a whitespace... Ronald J Kimball
- Re: correctly rebuilding a whitespace-split s... Andrew . Savige
- Re: correctly rebuilding a whitespace-spl... Yitzchak Scott-Thoennes
- Re: correctly rebuilding a whitespace-split s... Andrew . Savige
- Re: correctly rebuilding a whitespace-split s... Andrew . Savige
