Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This is just a silly little thing that popped up from the mists of my mind. I'm not even sure it's in the right place, but here goes.

The parable of the falling droplet

Or: a silly little mnemonic for record separators

Cue our Hero: a confused Perl coder getting $/ and $\ mixed up again, despite the mnemonics mentioned in perlvar.

Cue The Solution: the Falling Droplet!

Imagine, if you will, a falling droplet of rain. It knows that its purpose in life is to fall down and follow the path of least resistance down to its final destination in a convenient body of water somewhere nearby. Imagine, now, that this droplet encounters an obstacle: a leaning toothpick. It will slide down this toothpick, happily rolling down the obstacle and continuing on its way:

o <--- our brave droplet . . <--- the path our droplet follows . / . / . / ./ <-- the leaning toothpick ./ ./ .../ -------- <-- the ground

Now, take a small mental sidestep and think of input and output: I/O. In between I and O is ... a leaning toothpick. Imagine our brave droplet falling down on this particular toothpick. If the toothpick is leaning towards the right, the droplet will end up on the left of it, if it is leaning to to the left, it will end up on the right of it. Or, if the toothpick leans to the right, the droplet will end up with the I, or input, and consequently, it will end up with the O, or output in the other case.

Cue (finally) The Point: Stick a $ in front of our leaning toothpick, imagine our droplet, and there's our mnemonic:

I/O $/ - droplet falls to left, or I - input record seperator $\ - droplet falls to right, or O - output record separator

Silly, but true.

CU
Robartes- who should really get some sleep now


In reply to The parable of the falling droplet by robartes

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 drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found