in reply to Re^4: 'or' versus '||' - Unexpected Results
in thread 'or' versus '||' - Unexpected Results

Sorry, but that's not true. It works.

use strict; use warnings; use Data::Dumper; use Tk; my $t=MainWindow->new(); my $c=$t->Scrolled('Canvas')->pack; $c->createArc(5,5,100,100); $t->update; my @a1 = @{ $c->bbox('all') || [ 1,2,3 ] }; print(Dumper(\@a1)); # 51,3,102,55 my @a2 = @{ $c->bbox('FOO') || [ 1,2,3 ] }; print(Dumper(\@a2)); # 1,2,3

Because it returns undef (not []) on error as I was assuming.

my $rv = $c->bbox('FOO'); print(Dumper($rv)); # undef

Replies are listed 'Best First'.
Re^6: 'or' versus '||' - Unexpected Results
by massa (Hermit) on Jun 24, 2008 at 19:57 UTC
    My mistake... sorry. I tested it directly with []...