It's so much more convenient to type 'tperl' when i want to test something in perl.
If you have an equivalent source case that is as simple and short, I'd be happy to use it, but perl tends toward being expansive. But demonstrating "use constants" without using any modules (when constants is a module) seems a bit impossible. Why would you try?
"Most likely, what you're seeing is that your mem module is equivalent to a simple BEGIN block."Of course, but shorter. use mem wasn't the point. Anyone who knows intermediate perl would likely know that. I just don't like putting BEGIN{} blocks that 'should' be indented, in the middle of my module headers. use mem's primary use is to enable using a package in the same file just like it would function in a separate file. The use mem(xxx) form is documented to make it official that anything you want to put in parens on the same line, is "OK" -- it won't cause a problem. I don't think other modules guarantee that. Since both involve bringing things "inline", I grouped them together in the same module.
It would be rather lame to come up with a module just to be able to safely init things at runtime -- that sole purpose was to guarantee the passed arguments would never cause an error in future code (by assigning some semantic meaning to the arglist passed to the module), don't you agree?
The point was that the hash isn't in random order...Ah... it's the pairs that are in random order, now that makes more sense. I.e. if you print out the clist hash, it's not in the order it was entered, but that doesn't matter as long as the pairs are kept together. Was thinking about using a qw(continue 0 next 1 redo 2 last 3), as an initializer but the randomness of hashes had me wondering why that worked -- but they'll still be kept as pairs in any randomized hash...
In reply to Re^2: Curious: are anon-hashes in random order?
by perl-diddler
in thread Curious: are anon-hashes in random order?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |