WC -Sx- Jones wrote:

> R. Joseph Newton wrote:
>
> > Although it is not necessary the meaning might be better expressed:
> > my $n = (@$a > @$b ? @$a : @$b)
>
> Sorry for jumping in -

No problem.  That's why this is a group.

> You cannot compare two arrays that way and expect them to be numerically
> different - if they are it may be a coincidence; consider for discussion:

Well, actually, you can.  Without the line-noise--and with some difference
between the sizes to work on:

Greetings! E:\d_drive\perlStuff>perl -w
use strict;

my $aarray = ['Start test', 'Mid test', 'Stop test'];
my $barray = ['ABCDE 1234','T123 S456'];

my $greater_count =  (@$barray > @$aarray ? @$barray : @$aarray);
my $lesser_count =  (@$barray < @$aarray ? @$barray : @$aarray);

print "Greater count was $greater_count\n";
print "Lesser count was $lesser_count\n";

^Z
Greater count was 3
Lesser count was 2

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to