Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I was only mildly impressed by this until I tried to sort it all out. It's a great one, really quite complex. I think the solution is pretty clear and correct. Nice job xiper.

#!/usr/bin/perl BEGIN { undef $; # $; is $SUBSCRIPT_SEPARATOR } $- > new; # $- is $FORMAT_LINES_LEFT $~ = '10011011001111001110101000000100100011'; # $FORMAT_NAME $. = '31150460500070422151862305023215186070'; # $INPUT_LINE_NUMBER unless( $= = 0 ) # just an assignment to $= # always returns 0 here { $_ = ( $. . 9_630_151_829 ); # appends '9630151829' to previous $. # and assigns to $_ $. = $; # $. is undef now } not map # map #1: builds the YAHOP string { map # map #2: builds the individual words { $* = 2**6; # $MULTILINE_MATCHING $^ = substr( $~, $_, 6 ); # this grabs various 6-digit strings # from $~ and stores them in $^ map { $= = $= + $_ } # map #3: $= is undef at the beginning # of this so it ends up being the # decimal representation of $^ above map { $_ * ( $* /= 2 ) } # map #4: converts each bit received # from the split() to decimal and # passes the list to map #3 split( $, , $^ ); # $, is undef by default, so it splits # $^ into its six binary digits and # returns the list to map #4 $. .= chr( $= + 72 ); # $. is the YAHOP string to be printed # later; xiper subtracted an offset # from each of the characters just be +cause $= = $; # $= is undef } # returns two character chunks of $_ in a list to map #2 # remember that $_ is aliased from down below /../g; # $" is a space by default, so insert a space after each word $. .= $" ##"; # comment } # the split returns the five words in their proper numeric format # to map #1, then it dies split 6 or die $. . $/ #.+$/g; # comment, not regex

Brandan L.

In reply to Re: Re: The magic dollar by b-funk
in thread The magic dollar by xiper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found