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.
  • Did someone change your password? I can't login :)

    • I can confirm this. I tried to login now and was not able to, either.

    • I've reset the password to "foo", I must have changed it during testing.

      Go nuts.
      • Thanks. I was able to login to TinyAuth, create an account, receive the password by mail and promote myself to admin.

        However, I cannot seem to be able to commit anything to the repository:

        shlomi:~/progs/perl/cpan/Archive-Zip/trunk/Archive-Zip$ svn commit -F svn-commit.tmp
        Authentication realm: <> The Open Repository
        Password for 'shlomi':
        Authentication realm: <> The Open Repository
        Password for '':

        • That is correct.

          As I mentioned, the application is just for testing purposes atm, it isn't controlling the actual repository yet.

          I'll do that some time down the track, just before release.
  • Your &run method if/elsif/else chain is very difficult to read. Switching to a dispatch table makes it much easier to understand.

    my %method_for = (
        o => 'action_logout',
        f => 'view_forgot',
        r => 'action_forgot',
        c => 'view_change',
        p => 'action_change',
        n => 'view_new',
        a => 'action_new',
        l => 'view_list',
        m => 'view_promote',
        b => 'action_pro

    • I'm not sure I'd call that simpler, possibly more elegant though
      • It's easier to see which action maps to which method and makes it less likely to have bugs in the future as adding a new action is trivial. You just add a new entry to the hash and don't have to worry about the code.

        • I find that both elegant and easier to read. I haven' used dispatch tables much but time to go read about them again. : )
          • The "but time to go read about them again" is the main reason I don't want to use them... I'm trying to keep stuff as utterly boring and minimalist as possible.

            But you are right the if/else chain is VISUALLY hard to read, so I might do something to fix that instead of moving to dispatch table.
            • Technically that’s not even a dispatch table (since it does not map from strings to coderefs). I don’t know why people “need to read about them” either – I came up with the concept independently long before I knew it had a name. Seems obvious to me, and I don’t think I am a genius… what do I know.

              And actually, I don’t know why Ovid rewrote the code the way he did, because it’s easy to make it even simpler:

              sub run {
                  my $self = shift;