App-SimpleScan-Plugin-Cache

 view release on metacpan or  search on metacpan

lib/App/SimpleScan/Plugin/Cache.pm  view on Meta::CPAN

package App::SimpleScan::Plugin::Cache;

our $VERSION = '0.02';

use warnings;
use strict;
use Carp;

sub pragmas {
  no strict 'refs';
  *{caller() . '::_cache'} = \&_do_cache;
  *{caller() . '::_nocache'} = \&_do_nocache;
  return ['cache', \&_do_cache],
         ['nocache', \&_do_nocache];
}

sub _do_nocache {
  my ($self, $rest) = @_;
  $self->stack_code("mech()->nocache();\n");
}
    
sub _do_cache {
  my ($self, $rest) = @_;
  $self->stack_code("mech()->cache();\n");
}


1; # Magic true value required at end of module
__END__

=head1 NAME

App::SimpleScan::Plugin::Cache - Adds %%cache/%%nocache pragmas to simple_scan


=head1 VERSION

This document describes App::SimpleScan::Plugin::Cache version 0.01


=head1 SYNOPSIS

    use App::SimpleScan;
    # Automatically loads 

=head1 DESCRIPTION

Adds a C<%%cache> and C<%%nocache> pragma to C<simple_scan>.

=head1 INTERFACE 

=head2 pragmas

C<pragmas> installs the subs in the caller to support the pragmas
and returns a list of installed subs and pragmas to associate them with.

=head1 DIAGNOSTICS

=over

=item C<< Error message here, perhaps with %s placeholders >>

[Description of error here]

=item C<< Another error message here >>

[Description of error here]

[Et cetera, et cetera]

=back



( run in 0.606 second using v1.01-cache-2.11-cpan-39bf76dae61 )