#!/usr/bin/perl -w #use strict; $|=1; #Turn off STDOUT Buffering # This is wild but Perl has # a special string that will evaluate # to a "true", "zero" value and can be used # in a numeric computation - even with # warnings! # This is so obscure that it must be # depreciated in favor of the 0E0 notation. # I personally wouldn't use this, and I # show it just for amusement. This just # Perl trivia. my $str_zero = "0 but true"; ### special string ### $str_zero += 1; print "new str_zero is: $str_zero\n"; # No warning, this is the same as 0E0 my $bogus_zero = "0 bogus"; $bogus_zero +=1; print "bogus_zero plus one is: $bogus_zero\n"; # "works" albeit with a warning __END__ new str_zero is: 1 Argument "0 bogus" isn't numeric in addition (+) at C:\TEMP\zeroButTrue.pl line 23. bogus_zero plus one is: 1