home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / exec.pm.bak < prev    next >
Encoding:
Text File  |  2002-06-14  |  1.3 KB  |  72 lines

  1. package Filter::exec ;
  2.  
  3. use Carp ;
  4. use Filter::Util::Exec ;
  5. use strict ;
  6. use warnings ;
  7. use vars qw($VERSION) ;
  8.  
  9. $VERSION = "1.01" ;
  10.  
  11. sub import
  12. {
  13.     my($self, @args) = @_ ;
  14.  
  15.     croak("Usage: use Filter::exec 'command'")
  16.     unless @args ;
  17.  
  18.     Filter::Util::Exec::filter_add($self, @args) ;
  19. }
  20.  
  21. 1 ;
  22. __END__
  23.  
  24. =head1 NAME
  25.  
  26. Filter::exec - exec source filter
  27.  
  28. =head1 SYNOPSIS
  29.  
  30.     use Filter::exec qw(command parameters) ;
  31.  
  32. =head1 DESCRIPTION
  33.  
  34. This filter pipes the current source file through the program which
  35. corresponds to the C<command> parameter.
  36.  
  37. As with all source filters its scope is limited to the current source
  38. file only. Every file you want to be processed by the filter must have a
  39.  
  40.     use Filter::exec qw(command ) ;
  41.  
  42. near the top.
  43.  
  44. Here is an example script which uses the filter:
  45.  
  46.     use Filter::exec qw(tr XYZ PQR) ;
  47.     $a = 1 ;
  48.     print "XYZ a = $a\n" ;
  49.  
  50. And here is what it will output:
  51.  
  52.     PQR = 1
  53.  
  54. =head1 WARNING
  55.  
  56. You should be I<very> careful when using this filter. Because of the
  57. way the filter is implemented it is possible to end up with deadlock.
  58.  
  59. Be especially careful when stacking multiple instances of the filter in
  60. a single source file.
  61.  
  62. =head1 AUTHOR
  63.  
  64. Paul Marquess
  65.  
  66. =head1 DATE
  67.  
  68. 11th December 1995.
  69.  
  70. =cut
  71.  
  72.