What you see is not what you get (WYSINWYG)

brian_d_foy on 2004-08-09T14:12:49

Here's a curious result I ran across while working on a test suite.

$ perl -le 'print "All digits!" if 0x20 =~ /^\d+\z/'
All digits!


Of course, the literal representation of that value in the program text is not the same as what Perl actually uses after it stringifies it.

$ perl -le 'print 0x20'
32


Or this?

Aristotle on 2004-08-10T03:37:03

$ perl -le 'print "No underscores!" if 1_234_567_890 !~ /_/'

Re:Or this?

vsergu on 2004-08-17T15:24:06

$ perl -le 'print "No e!" if 1e6 !~ /e/'
$ perl -le 'print "There's an e!" if 6666666666666666 =~ /e/'
$ perl -le 'print "There's a plus!" if 1e15 =~ /\+/'
$ perl -le 'print "No dot!" if 0.00 !~ /\./'