新型引用符

                             <p>ソースコード</p>
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
#!/usr/bin/perl

# 初期設定
# require Jcode;
# $JcodeVer = "Jcode $Jcode::VERSION";
# *Jgetcode = &amp;Jcode::getcode;
# *Jconvert = &amp;Jcode::convert;

require "../../../cgi-bin/jcode.pl";
$JcodeVer = "jcode.pl $jcode::version";
*Jgetcode = &amp;jcode::getcode;
*Jconvert = sub { &amp;jcode::to($_[1], $_[0], $_[2]); };

@G_styles = ('../../ipp.css','../test.css');
$G_title = 'テスト19';
$G_myCode = &amp;Jgetcode('漢字');
$G_Code = 'jis';
$G_Charset = 'iso-2022-jp';

$G_scrName = $ENV{'SCRIPT_NAME'};
if($G_scrName =~ /ts[0-9]{4}/){
    $G_scrName = $&amp;;
    $G_linkFile = "../$G_scrName.htm";
}

{
    &amp;printHeader;
    print "<div class=test>n<table border=1>";

    $temp = '"変数"という文字列';
    $quotstr = '][)('"/\';
    $doublequotstr = "][)('"/\";

    $str = '<tr><td>'?'を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr';
    &amp;Jprint($str."n");
    $str = q(<tr><td>q(?)を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr);
    &amp;Jprint($str."n");
    $str = q/<tr><td>q/?/を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr/;
    &amp;Jprint($str."n");
#    $str = q[<tr><td>q[?]を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr];
#    &amp;Jprint($str."nn");
    $str = "<tr><td>"?"を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr";
    &amp;Jprint($str."n");
    $str = qq(<tr><td>qq(?)を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr);
    &amp;Jprint($str."n");
    $str = qq/<tr><td>qq/?/を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr/;
    &amp;Jprint($str."n");
#    $str = qq[<tr><td>qq[?]を使用<td>$tempを"格納"、'表示'する。<td>][)('"/\<td>$quotstr<td>$doublequotstr];
#    &amp;Jprint($str."n");

    print "</table>n</div>n";
    &amp;printFooter;

    exit;
}

sub printHeader{
    if($G_Charset){
        print "Content-type: text/html; charset=$G_Charsetnn";
    }else{
        print "Content-type: text/htmlnn";
    }
    print '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">'."n";
    print "<html lang=ja>n<head>n";
    if($G_Charset){ print "<meta http-equiv="Content-Type" content="text/html; charset=$G_Charset">n"; }
    print '<meta http-equiv="Content-Script-Type" content="text/javascript">',"n";
    print '<meta http-equiv="Content-Style-Type" content="text/css">'."n";
    &amp;Jprint ("<title>$G_title</title>n");
    foreach (@G_styles){ print "<link rel="stylesheet" type="text/css" href="$_">n"; }
    print "</head>n<body>n";
    print "<div class=head>n";
    &amp;Jprint ("<h1>$G_title</h1><hr>n");
    &amp;printlinks;
    print "<hr></div>n";
}

sub printFooter{
    print "<div class=foot><hr>n";
    &amp;printlinks;
    print "<hr>n";
    &amp;Jprint("漢字コード変換 : $JcodeVer<br>n");
    open(IN, '../../sig.txt');
    print while (<IN>);
    close(IN);
    print "</div>n";
    print "</body></html>n";
}

sub printlinks{
    print "<a href="../../../index.htm">Home</a>n";
    print "/n<a href="../../">Perl</a>n";
    print "/n<a href="../">TestCGI Index</a>n";
    if($G_linkFile){ &amp;Jprint ("/n<a href="$G_linkFile">$G_titleの解説</a>n"); }
}

sub Jprint{
    if($G_Code eq $G_myCode){
        foreach (@_){ print; }
    }else{
        foreach (@_){ print &amp;Jconvert($_, $G_Code, $G_myCode); }
    }
}

sub JconvPrint{
    foreach (@_){ print &amp;Jconvert($_, $G_Code, &amp;Jgetcode($_)); }
}
                          </div>
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy