Goo::Thing::pm::Runner - Run a Perl program


Goo documentation Contained in the Goo distribution.

Index


Code Index:

NAME

Top

Goo::Thing::pm::Runner - Run a Perl program

SYNOPSIS

Top

use Goo::Thing::pm::Runner;

DESCRIPTION

Top

METHODS

Top

run

Delegate running a Perl program to either Goo::Thing::pm::Perl6Runner or Goo::Thing::pm::Perl5Runner.

AUTHOR

Top

Nigel Hamilton <nigel@trexy.com>

SEE ALSO

Top


Goo documentation Contained in the Goo distribution.

#!/usr/bin/perl

package Goo::Thing::pm::Runner;

###############################################################################
# Nigel Hamilton
#
# Copyright Nigel Hamilton 2005
# All Rights Reserved
#
# Author:       Nigel Hamilton
# Filename:     Runner.pm
# Description:  Run a Perl program
#
# Date          Change
# ----------------------------------------------------------------------------
# 01/08/2005    Factored out of ProgramEditor as part of the new Goo
#
##############################################################################

use Goo::Object;
use Goo::Prompter;
use Goo::Thing::pm::TypeChecker;
use Goo::Thing::pm::Perl5Runner;
use Goo::Thing::pm::Perl6Runner;

use base qw(Goo::Object);


###############################################################################
#
# run - keep adding a thing to the program
#
###############################################################################

sub run {

    my ($this, $thing, $target) = @_;

  	if (Goo::Thing::pm::TypeChecker::is_perl6($thing)) {
        Goo::Thing::pm::Perl6Runner->new()->run($thing, $target);
    } else {
        Goo::Thing::pm::Perl5Runner->new()->run($thing, $target);

    }

}


1;


__END__