Guest User

Untitled

a guest
Feb 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use lib qw( ./lib ../lib ../../lib );
  4. use Template::TT2::Test
  5. tests => 5,
  6. debug => 'Template::TT2::Filters',
  7. args => \@ARGV;
  8.  
  9. use Badger::Filesystem '$Bin Dir';
  10. my $tmp = Dir($Bin, 'tmp')->must_exist(1);
  11.  
  12. use Template::TT2::Filters;
  13. pass('loaded filters');
  14.  
  15. #------------------------------------------------------------------------
  16. # hack to allow STDERR to be tied to a variable.
  17. # (I'm really surprised there isn't a standard module which does this)
  18. # UPDATE: there is now... but hey, I've already written the code.
  19. #------------------------------------------------------------------------
  20.  
  21. package Tie::File2Str;
  22.  
  23. sub TIEHANDLE {
  24. my ($class, $textref) = @_;
  25. bless $textref, $class;
  26. }
  27. sub PRINT {
  28. my $self = shift;
  29. $$self .= join('', @_);
  30. }
Add Comment
Please, Sign In to add comment