Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    $_= "193287461528";
    "0 but true" while s/(\d)(\d\d\d)(\D|$)/$1,$2$3/;
    print;
    
  2. or download this
    Useless use of a constant in void context at warn.pl line 3.
    193,287,461,528
    
  3. or download this
    #!/usr/bin/perl -w
    $_= "193287461528";
    sub zero() { "0 but true" }
    ...
    }
    zero while s/(\d)(\d\d\d)(\D|$)/$1,$2$3/;
    print;
    
  4. or download this
    $ perl warn.pl
    Useless use of a constant in void context at warn.pl line 9.
    193,287,461,528
    $ perl warn.pl x
    193,287,461,528
    
  5. or download this
    #!/usr/bin/perl -w
    $_= "193287461528";
    sub zero() { "0 but true" }
    zero while s/(\d)(\d\d\d)(\D|$)/$1,$2$3/;
    print;
    my $x= 0+zero;