"Jamie Risk" <[EMAIL PROTECTED]> writes:

> It's been my experience that readers of this group relish a demonstration of
> their persnicketiness.  For this I give the following; it works, but doesn't
> appeal to me:
> 
>    my @tmp_list;
>    my @list;
>    my $description;
>    push @tmp_list, split(/\t/,$_,6);
>    push @list, $tmp_list[0],
> $tmp_list[1],$tmp_list[2],$tmp_list[3],$tmp_list[5];
>    $description = $tmp_list[4];
> 
> There are six sub-strings separated by tab stops.  Sub-strings zero through
> three and five are extracted to a list.  Sub-string four is extracted to its
> own variable.
> 
> Suggestions?

Well, a slice instead of pushing individual elements helps a little bit:

@list = (@tmp_list[0 .. 3], $tmp_list[5]);

-RN

-- 
Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to