in reply to Why my variable is not 0 ?

different values - including 0 - are considered false in Perl but not the other way round.

DB<9> use Data::Dump "dd" DB<10> dd { true => !0, false => !1 } { false => "", true => 1 }
If you want Perl's internal value for false˛ to be mapped to 0 you have to do a $porter ||= 0

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

˛) NB: magical value! It is more than just an empty string to evaluate correctly in different contexts.