App-Framework

 view release on metacpan or  search on metacpan

lib/App/Framework/Extension/Filter.pm  view on Meta::CPAN

		# uppercase
		$state_href->{output} = uc $line ;	
	}

If no L</outfile> option is specified, then all output will be written to STDOUT. Also, normally the output is written line-by-line after each line has been processed. If the L</buffer>
option has been specified, then all output lines are buffered (into the state variable L</output_lines>) then written out at the end of processing all input. Similarly, if the L</inplace>
option is specified, then buffering is used to process the complete input file then overwrite it with the output.

=head2 Outfile option

The L</outfile> option may be used to set the output filename. This may include variables that are specific to the Filter extension, where the variables value is updated for each
input file being processed. The following Filter-sepcific variables may be used:

		$filter{'filter_file'} = $state_href->{file} ;
		$filter{'filter_filenum'} = $state_href->{file_number} ;
		my ($base, $path, $ext) = fileparse($file, '\..*') ;
		$filter{'filter_name'} = $base ;
		$filter{'filter_base'} = $base ;
		$filter{'filter_path'} = $path ;
		$filter{'filter_ext'} = $ext ;

lib/App/Framework/Extension/Filter.pm  view on Meta::CPAN

1;

__END__



* app_start - allows hash setup
* app_end - allows file creation/tweak
* app
** return output line?
** HASH state auto- updated with:
*** all output lines (so far)
*** regexp match vars (under 'vars' ?)
** app sets HASH 'output' to tell filter what to output (allows multi-line?)
* options
** inplace - buffers up lines then overwrites (input) file
** dir - output to dir
** input file wildcards
** recurse - does recursive file find (ignore .cvs .svn)
** output - can spec filename template ($name.ext)

lib/App/Framework/Feature/Run.pm  view on Meta::CPAN

  $app->run->set(
      'on_error'   => 'fatal',
      'required'   => {
          'lsvob'      => 1,
          'ffmpeg'     => 1,
          'transcode'  => 1,
          'vlc'        => 1,	
      },
  ) ;

NOTE: The values you specify along with the program names are not important when you set the required list - these values get updated
with the actual executable path.

=head2 Command output

All output (both STDOUT and STDERR) is captured from the external command and can be accessed by reading the L</results> field. This returns
an ARRAY reference, where the ARRAY contains the lines of text output (one array entry per line).

NOTE: the lines have the original trailing newline B<removed>.

  my $results_aref = $app->run()->results ;

lib/App/Framework/GetStarted.pod  view on Meta::CPAN

    my $app = App::Framework->new() ;
    
    # ... and run it
    $app->go() ;

Or, if like me you are *really* lazy, then you can just call:

    # Create application and run it
    go() ;

It's usually a "good thing" to define a version number (and better still, keep it updated as the script changes!). If you do define a $VERSION
at the start of the script, App::Framework will use it when displaying script manual pages.    

=head2 Set-up

The command-line arguments and options are defined in a text section at the end of the program. In fact it's actually part of a 
__DATA__ definition. All program settings are grouped under sections which are introduced by '[section]' style headings. There are many 
different settings that can be set using this mechanism, but since the framework sets most of them to useful defaults, then the most common 
settings are:

=over 4



( run in 0.618 second using v1.01-cache-2.11-cpan-05444aca049 )