Upgrade to Test::Simple 0.64_03
[p5sagit/p5-mst-13.2.git] / lib / Pod / Simple / TiedOutFH.pm
CommitLineData
351625bd 1
2use strict;
3package Pod::Simple::TiedOutFH;
4use Symbol ('gensym');
5use Carp ();
6
7#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
9sub handle_on { # some horrible frightening things are encapsulated in here
10 my $class = shift;
11 $class = ref($class) || $class;
12
13 Carp::croak "Usage: ${class}->handle_on(\$somescalar)" unless @_;
14
15 my $x = (defined($_[0]) and ref($_[0]))
16 ? $_[0]
17 : ( \( $_[0] ) )[0]
18 ;
19 $$x = '' unless defined $$x;
20
21 #Pod::Simple::DEBUG and print "New $class handle on $x = \"$$x\"\n";
22
23 my $new = gensym();
24 tie *$new, $class, $x;
25 return $new;
26}
27
28#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
30sub TIEHANDLE { # Ties to just a scalar ref
31 my($class, $scalar_ref) = @_;
32 $$scalar_ref = '' unless defined $$scalar_ref;
33 return bless \$scalar_ref, ref($class) || $class;
34}
35
36sub PRINT {
37 my $it = shift;
38 foreach my $x (@_) { $$$it .= $x }
39
40 #Pod::Simple::DEBUG > 10 and print " appended to $$it = \"$$$it\"\n";
41
42 return 1;
43}
44
45sub FETCH {
46 return ${$_[0]};
47}
48
49sub PRINTF {
50 my $it = shift;
51 my $format = shift;
52 $$$it .= sprintf $format, @_;
53 return 1;
54}
55
56sub FILENO { ${ $_[0] } + 100 } # just to produce SOME number
57
58sub CLOSE { 1 }
59
60#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
611;
62__END__
63
64Chole
65
66 * 1 large red onion
67 * 2 tomatillos
68 * 4 or 5 roma tomatoes (optionally with the pulp discarded)
69 * 1 tablespoons chopped ginger root (or more, to taste)
70 * 2 tablespoons canola oil (or vegetable oil)
71
72 * 1 tablespoon garam masala
73 * 1/2 teaspoon red chili powder, or to taste
74 * Salt, to taste (probably quite a bit)
75 * 2 (15-ounce) cans chick peas or garbanzo beans, drained and rinsed
76 * juice of one smallish lime
77 * a dash of balsamic vinegar (to taste)
78 * cooked rice, preferably long-grain white rice (whether plain,
79 basmati rice, jasmine rice, or even a mild pilaf)
80
81In a blender or food processor, puree the onions, tomatoes, tomatillos,
82and ginger root. You can even do it with a Braun hand "mixer", if you
83chop things finer to start with, and work at it.
84
85In a saucepan set over moderate heat, warm the oil until hot.
86
87Add the puree and the balsamic vinegar, and cook, stirring occasionally,
88for 20 to 40 minutes. (Cooking it longer will make it sweeter.)
89
90Add the Garam Masala, chili powder, and cook, stirring occasionally, for
915 minutes.
92
93Add the salt and chick peas and cook, stirring, until heated through.
94
95Stir in the lime juice, and optionally one or two teaspoons of tahini.
96You can let it simmer longer, depending on how much softer you want the
97garbanzos to get.
98
99Serve over rice, like a curry.
100
101Yields 5 to 7 servings.
102
103