The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CatalystX::ASP::Compiler - Role for CatalystX::ASP providing code compilation

SYNOPSIS

  use CatalystX::ASP;
  with 'CatalystX::ASP::Compiler';

  sub execute {
    my ($self, $c, $scriptref) = @_;
    my $parsed = $self->parse($c, $scriptref);
    my $subid = $self->compile($c, $parsed->{data});
    eval { &$subid };
  }

DESCRIPTION

This class implements the ability to compile parsed ASP code.

METHODS

$self->compile($c, $scriptref, $subid)

Takes a $scriptref that has been parsed and $subid for the name of the subroutine to compile the code into. Returns

$self->compile_include($c, $include)

Takes an $include file. This will search for the file in IncludesDir and parse it, and assign it a $subid based on it's filename.

$self->compile_file($c, $file)

Takes an $file assuming it exists. This will search for the file in IncludesDir and parse it, and assign it a $subid based on it's filename.

$self->register_include($c, $scriptref)

Registers the file file of any calls to $Response->Include() so as to prevent infinite recursion

SEE ALSO