in reply to Re: bit selections
in thread bit selections

In your sample code int is not doing anything.

Yes and no. It has an effect, but it's not visible since he's not using |, & and/or ^ at the moment.

>perl -le"$_='7'; int if $ARGV[0]; print $_ | '123'" 0 723 >perl -le"$_='7'; int if $ARGV[0]; print $_ | '123'" 1 127

The effect:

>perl -MDevel::Peek -e"$_='0'; Dump $_; int; Dump $_;" SV = PV(0x236054) at 0x18447c4 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x1824064 "0"\0 CUR = 1 LEN = 4 SV = PVIV(0x238030) at 0x18447c4 REFCNT = 1 FLAGS = (IOK,POK,pIOK,pPOK) IV = 0 PV = 0x1824064 "0"\0 CUR = 1 LEN = 4

The better solution:

push @list, 0+$_;