ingydotnet / boolean-pm

Boolean Type Support for Perl
7 stars 5 forks source link

isTrue/isFalse limitation with clone #19

Open iynehz opened 3 years ago

iynehz commented 3 years ago

Simple clone implementations like dclone ends up with a copy although this module is designed to use singletons. I know this is a limitation of Perl itself: Perl does not have a native boolean type and dclone does not support this 3rd party boolean module. But I wonder if we can improve isTrue/isFalse, or, at least note this caveat in module doc..

use 5.012;
use warnings;
use boolean;
use Storable qw(dclone);

say boolean::isTrue(true);          # 1
say boolean::isTrue(dclone(true));  # 0