Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Monday August 09, 2004
09:12 AM

What you see is not what you get (WYSINWYG)

[ #20317 ]

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • $ perl -le 'print "No underscores!" if 1_234_567_890 !~ /_/'
    • $ 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 !~ /\./'