Hello Zeus,

At 11:55 AM 1/29/2003 -0500, Zeus Odin wrote:
>An even shorter version of yours is:
>-------------------------
>my @a;
>while(<DATA>){
>   next unless /=/ && chomp;
>   push @a, split /=/, $_, 2;
>}
>print "$_\n" for @a;
>-------------------------

This is even shorter, eliminates all uses of variables, and slurps in the
data all at once:

#!/usr/bin/perl -w0
print join("\n", map({split(/=/,$_,2)} grep(/=/, split(/\n/, <DATA>))));

The only thing it does not do is use the regex.  Is the regex a requirement?

Regards,
- Robert


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

Reply via email to