Advertisement
cd62131

textarea with CGI.pm

Dec 1st, 2018
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.50 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use utf8;
  5. use CGI qw(:standard -no_xhtml);
  6. my $q = CGI->new;
  7. $q->charset('utf-8');
  8. print $q->header(-type => 'text/html', -charset => 'utf-8');
  9. my $html5 = $q->start_html(
  10.   -lang => 'ja-JP'
  11.   , -head => [meta({charset => 'utf-8'})]
  12. );
  13. $html5 =~ s/<!DOCTYPE.*?>/<!DOCTYPE html>/s;
  14. print
  15.   $html5
  16.   , $q->start_form
  17.   , $q->textarea(-name => 'foo')
  18.   , $q->submit
  19.   , $q->end_form
  20.   , ($q->param ? $q->p(~~$q->param('foo')) : '')
  21.   , $q->end_html
  22.   ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement