On Jul 22, Steffen Mueller said:
>"Aaron J Mackey" <[EMAIL PROTECTED]> schrieb...
>
>> I can't seem to get this any shorter: I want the second through the
>> next-to-last elements of @F joined by " ", and then the last item of @F.
>>
>perl -ae 'print"@F[1..$#F-1]
>$F[$#F]"'
Uh...
perl -ae 'prin
On Mon, Jul 22, 2002 at 02:41:25PM -0400, Aaron J Mackey wrote:
>
> I can't seem to get this any shorter: I want the second through the
> next-to-last elements of @F joined by " ", and then the last item of @F.
>
> perl -ape '$,=" ";s//>@F[1..$#F-1]\n$F[$#F]/'
>
> or (no join, but same general
Hello Ala!
[EMAIL PROTECTED] (Ala Qumsieh) wrote:
>> perl -pe 's/\s+(\S+)$/\n$1/;s/^\S+\s+/>/;'
>
> perl -alpe '$_=">@F[1..$#F-1]\n$F[-1]"'
$#F-1 -> @F-2:
-alp $_=">@F[1..@F-2]\n$F[-1]"
---
Mtv Europe
[
Crossposted to perl.fwp and perl.golf. Reply to set to perl.golf. Hope the
newsreader won't fsck it up. :)
]
"Aaron J Mackey" <[EMAIL PROTECTED]> schrieb...
> I can't seem to get this any shorter: I want the second through the
> next-to-last elements of @F joined by " ", and then the last item
> -Original Message-
> From: Aaron J Mackey [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 2:41 PM
> To: [EMAIL PROTECTED]
> Subject: a little shorter please?
>
>
>
> I can't seem to get this any shorter: I want the second through the
> ne
I can't seem to get this any shorter: I want the second through the
next-to-last elements of @F joined by " ", and then the last item of @F.
perl -ape '$,=" ";s//>@F[1..$#F-1]\n$F[$#F]/'
or (no join, but same general idea):
perl -pe 's/\s+(\S+)$/\n$1/;s/^\S+\s+/>/;'
What trick am I missing?