Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Adding formatting to a string

by belden (Friar)
on Jun 17, 2004 at 21:51 UTC ( [id://367774]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Adding formatting to a string
in thread Adding formatting to a string

If you're going to do that you might as well do

#!/usr/bin/perl @list = split //, 'ABCDEFGH'; s&&local$/; <DATA>&e&&y&; &&d;& s#zoTfFdDsOt##g; while/(\D)(\d+)/gi; sub z{(&O-&O)*((&O-&O)*(&O-&O))} sub o{&z-((&O-&O)*(&O-&O))+&O-&O} sub T{&z-(&O-&O)} sub f{&T+(&O-&O)} sub F{(&O-(&O-&O))/(&O-&O)} sub d{print chr shift} sub D(@){map chr,@_} sub s{print D$1->(@list[split//,$2])} sub O{ord shift} sub t{&z+&O-&O(A)} __DATA__ #t50703010o507040703002o507040703004o507040703003F01020f5070 306057t50703050t50703060o507040703003T50703010T50703040o5070 40703005F01020t50703070T50703040o507040703005t50703030F01020 T50703010f5070306057T50703060t50703020T50703040o507040703005

Proves the same point!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-26 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found