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

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.
  • Static rules such as:
    before '*' => run { set object_type => 'account' };

    on '/' => run { show 'crud/index' };
    Can be written instead as:
    before '*' => set object_type => 'account';

    on '/' => show 'crud/index';
    it's a bit more declarative that way. :-)
    • Also, with our extended glob syntax one can replace:
      before qr'/(.*?)/(.*)' => run { set id => $2; };
      with this:
      before '**/*' => run { set id => $2; };
      With both changes in place, it'd look like this:
      under '/admin/account' => run {
          before '*'    => set object_type => 'account';
          before '**/*' => run { set id => $2 };

          on '/'         => show 'crud/index';
          on '/list'     => show 'crud/list';
          on '/create'   => show 'crud/list';
          on '/view/*'   => show 'crud/view';
          on '/update/*' => show 'crud/update;
      };