Changeset 16061 for lang/actionscript/todoshare/perl/Html.pm
- Timestamp:
- 07/21/08 21:42:48 (6 months ago)
- Files:
-
- 1 modified
-
lang/actionscript/todoshare/perl/Html.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/perl/Html.pm
r16014 r16061 1 1 package stream; 2 use strict; 2 3 3 4 sub new { … … 23 24 } 24 25 return; 26 } 27 #print (ref $tag); 28 if ((ref $tag) eq "CODE") { 29 my @args=@$c; 30 $args[0]=$t; 31 return &{$tag}(@args); 25 32 } 26 33 $t->out("<$tag "); … … 80 87 81 88 package Html; 89 use strict; 82 90 83 91 our @EXPORT = qw(header p brln); … … 85 93 86 94 sub header { 87 print "Content-type: text/html; charset=utf-8\n\n"; 95 my %args=(type=>"text/html" ,@_); 96 print "Content-type: $args{type}; charset=utf-8\n\n"; 88 97 } 89 98 sub brln { … … 91 100 } 92 101 93 sub p { 94 my $c=shift; 102 sub stdoutStream { 95 103 new stream(sub { 96 104 my $s=shift; 97 105 print $s; 98 })->p($c); 106 }); 107 } 108 sub p { 109 my $c=shift; 110 &stdoutStream->p($c); 99 111 } 100 112 1;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)