In article <[EMAIL PROTECTED]>, Thomas bätzler
wrote:

> Marcus Claesson [mailto:[EMAIL PROTECTED] asked:
>> I have a silly little list-parsing problem that I can't get my head
>> around, and I'm sure some of you have come across it before.
> 
> Sure. Looks like homework ;-)

No, the homework I've seen our students do is _much_ more difficult. ;-)

[...]
> foreach my $key ( sort keys %unique ){
>   print "$key: " . join( ", ", sort keys %{$unique{$key}} ) . "\n";
> }

I just noticed that:

print join ", ", @list, "\n";

produces output such as:

a,
a, b, c,

whereas:

print join(", ", @list), "\n";

produces:

a
a, b, c

(no trailing comma) -- strange... I think I remember reading somewhere that
without the parentheses 'join' doesn't really know exactly where to stop.
Sound right?

-- 
Kevin Pfeiffer
International University Bremen


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

Reply via email to