[ic] Ambiguous result

Bill Randle billr@exgate.tek.com
Thu, 16 Nov 2000 17:07:24 -0800


On Nov 16,  7:47pm, MhsapoA@netscape.net wrote:
} Subject: [ic] Ambiguous result
}
} [ text/plain
}   Encoded with "quoted-printable" ] :
1) How do I use the [more] in this case?: I want to show up to 20 items per
} page
}
} 2) The variable $istock get only "N" even if the $invsplit is less than zero.
}  I did the same code in plain perl and works.  Could you please tell me
} what's wrong?
}
} Below is the code:
} ========================================================================
} [loop search="
} st=db
} sq=select * from inventory where
} ml=10000
} "]
}
}
} [perl]
} push (@f,'[loop-data inventory sku]');
} push (@l,'[loop-data inventory quantity]');
} [/perl]
}
} [/loop]
}
} [perl]
} @indices = sort { $l[$a] cmp $l[$b] or
} $f[$a] cmp $f[$b]} (0..$#f);
}
} foreach (@indices){
} $la = $l[$_];
} $fa = $f[$_];
}
} $key = $fa . "\0" . $la ;
} }
}
}
} foreach $key (sort keys %models){
} ($skusplit,$invsplit) = split (/\0/, $key);

It looks like you're missing something here. The hash '%models' is not
defined. Should there be something like
	$models{$key} = something;
in the "foreach (@indices)" loop?

Also, make sure that the inventory quantity part of the key does not
have any extra spaces (e.g. '  1' or '1 ') as that will cause Perl to
interpolate the value as a string, rather than a number, in which case
you would always get the 'N' branch of the $invsplit test.

	-Bill