Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • One of my beefs about perl is that it doesn't come with a good interactive environment (unlike python). I frequently test things against an implementation, just to see whether something works or not; I usually go to the documentation afterwords. :-)

    I must say though, that hash slices are one of those things that I nearly always avoid if possible; they're just too visually cluttered.

    • I don't understand what you mean. Yes, there is perl -d, as mentioned, and you can always use perl -e itself, too. But not knowing what you mean, I can't say if these are sufficient to your desires.

      Testing is sometimes a problem. For testing Slash, I wrote Slash::Test, which exports the four major objects, Dumper(), the entire API, all the constants, all the available plugin objects, etc. so I can do stuff like:
      % perl -MSlash::Test=useperl -e 'print Dumper $slashdb->getUserFoo($user->{uid})'
      Everything I need is right there, so I don't need to bother setting it up, and testing little snippets is very simple. I can test templates, too:
      % perl -MSlash::Test=useperl -eDisplay
      [% USE Dumper; Dumper.dump( Slash.db.getUserFoo(user.uid) ) %]

      Testing environments are important, but if perl doesn't have one you need, it's not too hard to write one to suit your own purposes.

      As to hash slices, I use them sparingly, usually only when other methods are more cluttered.