In a message dated 3/2/2004 9:21:57 AM Eastern Standard Time,
[EMAIL PROTECTED] writes:
>$#array + 1 still is the size of the array and it won't modify the
>array. That's not what we were talking about. We were talking about
>++$#array, which expands to $#array = $#array + 1. Note the equal s
On Mar 2, 2004, at 12:41 AM, WC -Sx- Jones wrote:
Once upon a time $#array + 1 was the size of the array; obviously
(scalar @array) now has the right size.
$#array + 1 still is the size of the array and it won't modify the
array. That's not what we were talking about. We were talking about
++
John W. Krahn wrote:
You do realise that ++$#array modifies @array?
$ perl -le'
@array = 90 .. 99;
print scalar @array;
++$#array;
print scalar @array;
++$#array;
print scalar @array;
'
10
11
12
D'Oh! Yep, it does...
Once upon a time $#array + 1 was the size of the array; obviously
(scalar @ar
Wc -Sx- Jones wrote:
>
> R. Joseph Newton wrote:
>
> > print "Greater count was $greater_count\n";
> > print "Lesser count was $lesser_count\n";
>
> But that was my point - you could just use ++$#array; because you are
> only testing sizeOf array - a true test would be to see if they are
> ident
--As of Monday, March 1, 2004 8:54 PM -0500, WC -Sx- Jones is alleged to
have said:
But that was my point - you could just use ++$#array; because you are
only testing sizeOf array - a true test would be to see if they are
identical in what each array holds.
--As for the rest, it is mine.
Only if
R. Joseph Newton wrote:
print "Greater count was $greater_count\n";
print "Lesser count was $lesser_count\n";
But that was my point - you could just use ++$#array; because you are
only testing sizeOf array - a true test would be to see if they are
identical in what each array holds.
-Bill-
__
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 numerica
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 -
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:
Andrew Gaffney wrote:
> Perl wrote:
> > I am trying to understand how this works. For example:
> >
> > my $n = @$a > @$b ? @$a : @$b;
> >
> >
> > I understand this is a conditional statement I am just not sure what is
> > being compared with ? and :.
>
> I believe that the above just assigns a tru
Andrew Gaffney wrote:
>
> Perl wrote:
> > I am trying to understand how this works. For example:
> >
> > my $n = @$a > @$b ? @$a : @$b;
> >
> > I understand this is a conditional statement I am just not sure what is
> > being compared with ? and :.
>
> I believe that the above just assigns a true
Perl wrote:
>
> I am trying to understand how this works. For example:
>
> my $n = @$a > @$b ? @$a : @$b;
>
> I understand this is a conditional statement I am just not sure what is
> being compared with ? and :.
That is same as:
my $n;
if ( @$a > @$b ) {
$n = @$a;
}
else {
$n = @$
Perl wrote:
I am trying to understand how this works. For example:
my $n = @$a > @$b ? @$a : @$b;
I understand this is a conditional statement I am just not sure what is
being compared with ? and :.
I believe that the above just assigns a true or false (1 or 0) to $n. The statement is the
same
I am trying to understand how this works. For example:
my $n = @$a > @$b ? @$a : @$b;
I understand this is a conditional statement I am just not sure what is
being compared with ? and :.
--Paul
13 matches
Mail list logo