package File::Tasks::Edit; # See POD at end for docs use strict; use base 'File::Tasks::Add'; use File::Flat (); use vars qw{$VERSION}; BEGIN { $VERSION = '0.07'; } ##################################################################### # File::Tasks::Task sub type { 'Edit' } sub test { my $self = shift; File::Flat->isaFile( $self->path ) and File::Flat->canWrite( $self->path ); } 1; __END__ =pod =head1 NAME File::Tasks::Edit - A File::Tasks edit task (change a file) =head1 DESCRIPTION The C task is similar to the L task, except that it expects a current file to already exists, which it will change the contents of (without changing permissions). =head1 METHODS =head2 new $Tasks, $path, $source Creates a new C object, although you probably won't be creating this object directly from here. Returns a new C object, or C on error. =head2 type Returns the task type, which is always 'Edit'. =head2 path The C accessor returns the path to the file within the set of tasks. =head2 source The C accessor returns the content source, which could be anything supported by L. =head2 test The C method checks to see if the file can be edited. Returns true if so, or false if not. =head2 execute The C method executes the task on the local filesystem. Returns true on success or C on error. =head2 content The C method returns the content that is to be written to the file. =head1 SUPPORT Bugs should be reported via the CPAN bug tracker at L For other issues, contact the author. =head1 AUTHOR Adam Kennedy Eadamk@cpan.orgE, L =head1 COPYRIGHT Copyright 2005 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =cut