Tom Phoenix wrote:
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
sort {
$a->value() cmp $b->value()
||
$a->part('Name')->value() cmp $b->part('Name')->value()
}
grep { defined } @objects
But sometimes $a->part('Name') returns undef, so the sort
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> sort {
> $a->value() cmp $b->value()
> ||
> $a->part('Name')->value() cmp $b->part('Name')->value()
> }
> grep { defined } @objects
But sometimes $a->part('Name') returns undef, so the sort fails.
Jay Savage wrote:
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
for my $obj(
sort {
$a->value() cmp $b->value()
||
$a->part('Name')->value() cmp $b->part('Name')->value()
}
grep { defined } @objects
) {
...
$a/$b->value() always works since if $
Timothy Johnson wrote:
Just a thought, but couldn't you put the logic in your grep statement?
Something like this:
grep {defined($_->value()) or defined($_->part('Name')->value())}
@objects;
The only problem is then that the object woudl be completely skipped.
I need all objects regardles
Just a thought, but couldn't you put the logic in your grep statement?
Something like this:
grep {defined($_->value()) or defined($_->part('Name')->value())}
@objects;
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 25, 2006 12:22 PM
To: beginne
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> for my $obj(
> sort {
> $a->value() cmp $b->value()
> ||
> $a->part('Name')->value() cmp $b->part('Name')->value()
> }
> grep { defined } @objects
> ) {
>
> ...
>
> $a/$b->value() always works since i