Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

(tye)Re2: Regular expression

by tye (Sage)
on Jun 11, 2001 at 21:58 UTC ( [id://87595]=note: print w/replies, xml ) Need Help??

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;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found