/[suikacvs]/www/test/http/mime-multipart/mixed-replace/mixed-replace-generation.pl
Suika

Contents of /www/test/http/mime-multipart/mixed-replace/mixed-replace-generation.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Feb 10 15:03:58 2007 UTC (18 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
New tests

1 wakaba 1.1 use strict;
2    
3     package mixed_replace_generation;
4    
5     sub new ($;%) {
6     my ($class, %opt) = @_;
7     return bless {boundary => 'abcdefghijklmn', out => \*main::STDOUT,
8     nl => "\x0D\x0A", %opt}, $class;
9     } # new
10    
11     sub output_cgi_header ($) {
12     my $self = shift;
13     print {$self->{out}} q<Content-Type: multipart/x-mixed-replace; boundary=">
14     . $self->{boundary} . qq<"\n>;
15     print "\n";
16     } # output_cgi_header
17    
18     sub output_line ($$) {
19     my ($self, $s) = @_;
20     print {$self->{out}} $s . $self->{nl};
21     } # output_line
22    
23     sub output_string ($$) {
24     my ($self, $s) = @_;
25     print {$self->{out}} $s;
26     } # output_string
27    
28     sub output_boundary ($) {
29     my $self = shift;
30     print {$self->{out}} $self->{nl} . '--' . $self->{boundary} . $self->{nl};
31     } # output_boundary
32    
33     sub output_last_boundary ($) {
34     my $self = shift;
35     print {$self->{out}}
36     $self->{nl} . '--' . $self->{boundary} . '--' . $self->{nl};
37     } # output_last_boundary
38    
39     1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24