develooper Front page | perl.perl5.porters | Postings from April 2003

[PATCH] [perl #8063] perlfilter doesn't mention potential DATA clobber

Thread Next
Casey West
April 28, 2003 08:03
[PATCH] [perl #8063] perlfilter doesn't mention potential DATA clobber
Message ID:

The requester mentions that some source filters clobber the DATA
filehanle.  In my testing (and as I suspected), Filter::Util::Call
doesn't mess with the DATA filehandle so sane source filter
implementations based on this module wouldn't be a problem.

Of course, hand-rolled source filters could very well clobber the DATA
filehandle.  With this in mind I submit the following patch.  The
thing is, I'm not sure if it's necessary because perlfilter is all
about using Filter::Util::Call.  What say you?

  Casey West

Shooting yourself in the foot with Ada 
After correctly packing your foot, you attempt to concurrently load
the gun, pull the trigger, scream, and confidently aim at your foot
knowing it is safe. However the cordite in the round does an Unchecked
Conversion, fires and shoots you in the foot anyway. 

--- perl-current.orig/pod/perlfilter.pod        Mon Nov 12 10:56:58 2001
+++ perl-current/pod/perlfilter.pod     Mon Apr 28 10:55:37 2003
@@ -551,6 +551,20 @@
 you know. The tricky bit will be choosing how much knowledge of Perl's
 syntax you want your filter to have.
+=over 5
+=item Some Filters Clobber the C<DATA> Handle
+Some source filters use the C<DATA> handle to read the calling program.
+When using these source filters you cannot rely on this handle, nor expect
+any particular kind of behavior when operating on it.  Filters based on
+Filter::Util::Call (and therefore Filter::Simple) do not alter the C<DATA>
 The Source Filters distribution is available on CPAN, in 

 LocalWords:  Nov

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About