Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

chaoticset
  (email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Sunday January 13, 2002
12:21 AM

Code Review

[ #2089 ]
Well, I asked for a style/effiency breakdown on a stupidly simple little piece of something: A sub for calculating standard deviation.

Time to go check monks to see if it bore any fruit.

Also, during scifi's showing of _The Fifth Element_ (a movie I like quite a bit...it lost a little bit of the charm the second time around, with certain effects not quite being so stunning...but still, neat little movie) I got a few things figured out.

I wrote a test to see if a certain behavior was valid; I know (from, I believe, the Camel) that if you take a hash in array form, it just unwinds the values in pairs.

But if you assigned an array to a hash, would it automatically group as you went? "Key, value, key, value..."?

It's no surprise to anybody reading this that it does; but it was a pleasant one to me. It means the idea I have of filling this hash up is going to be very, very easy.

Anyway, gotta check monks, then I'll code this thing up. Finally. Feels like I've been avoiding work. :\ I have coffee and time; no excuses now.

Tomorrow I will have excuses; I have to get ready for school, which starts Monday! (Assuming, of course, that I'm still eligible for being a student...I really hope I am, now. I'm looking forward to classes.)

Quick Addendum: There are excellent responses, further heightening my guilt about not contributing very much to the Monastery. Regardless, I just learned some new tricks, and I learned them in a way that'll help me apply them.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Hash pair assignments (as in declarations) are lists, plainly and simply. The fat comma operator is just a comma with an extra bit of syntactic sugar. You could as easily say:

    my %hash = ('one', 1, 'two', 2);

    or

    my %hash = split(/=|;/, 'one=1;two=2');

    Anything that creates a list will be interpreted as pairs, in "hash" context. The sooner you start thinking of lists, the sooner you'll unlock the mysteries of map and grep and slices.