Pake::FileCreationTask - Pake::FileCreationTask documentation


pake documentation Contained in the pake distribution.

Index


Code Index:

NAME

Top

Pake::FileCreationTask

SYNOPSIS

Top

    use Pake::FileCreationTask;
    $file_task = Pake::FileCreationTask->new($code,$name,$dependency_array_ref);
    $file_task->invoke();




Description

Top

File creation task, executes if the file with the same name does not exists

Methods

Top

Overview of overriden methods in the FileTask object

needed

Needed only if the specified file does not exists

timestamp

Returns file timestamp. If the file don't exists it returns... nothing


pake documentation Contained in the pake distribution.

package Pake::FileCreationTask;

our $VERSION = '0.2';

use strict;
use warnings;

our @ISA = qw(Pake::Task);

sub needed{
    my $self = shift;
    my $stamp;
    $stamp = $self->timestamp();
    return 1 unless -e $self->{"name"};
}

sub timestamp{
    my $self = shift;
    if(-e $self->{"name"}){
	return(stat($self->{"name"}))[9];
    }
}

1;