ファイル名: w/chop.cgi

#!/usr/local/bin/perl

#------------------------------------------------------------
$Title = 'chop';
$BODY = '<BODY BGCOLOR="#000000" TEXT="#C0C0C0">';
$FONT_R = '<font color="#FF0000">';
$FONT_G = '<font color="#00FF00">';
$FONT_C = '</font>';
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>$Title</TITLE></HEAD>\n";
print "$BODY\n";
print "<blockquote>\n";
#------------------------------------------------------------
$a = "warewan";
$a1 = "warewan,warewan1,warewan2";
@a = ("warewan\n","warewan1","warewans","\Uwarewan","warewan12");
%a = (11,aa,22,bb,33,cc);
chop($a);
chop($a1);
chop(@a);
chop(%a);
@keys = keys(%a);
@values = values(%a);
#------------------------------------------------------------
print "$FONT_R\n";
print "<BR>\n";
print '$a = "warewan"';
print "<BR>\n";
print '$a1 = "warewan,warewan1,warewan2"';
print "<BR>\n";
print '@a = ("warewan\n","warewan1","warewans","\Uwarewan","warewan12")';
print "<BR>\n";
print '%a = (11,aa,22,bb,33,cc)';
print "$FONT_C\n";
print "<BR><BR>\n";
print "$FONT_G\n";
print 'chop($a)';
print "$FONT_C\n";
print "<BR>\n";
print "$a\n";
print "<BR><BR>\n";
print "$FONT_G\n";
print 'chop($a1)';
print "$FONT_C\n";
print "<BR>\n";
print "$a1\n";
print "<BR><BR>\n";
print "$FONT_G\n";
print 'chop(@a)';
print "$FONT_C\n";
print "<BR>\n";
print "@a \n";
print "<BR><BR>\n";
print "$FONT_G\n";
print 'chop(%a)';
print "$FONT_C\n";
print "<BR><BR>\n";
print "<blockquote>\n";
print "$FONT_G\n";
print '@keys = keys(%a)';
print "$FONT_C\n";
print "<BR>\n";
print "@keys\n";
print "<BR><BR>\n";
print "$FONT_G\n";
print '@values = values(%a)';
print "$FONT_C\n";
print "<BR>\n";
print "@values\n";
print "</blockquote>\n";
#------------------------------------------------------------
print "</blockquote>\n";
print "</BODY>\n";
print "</HTML>\n";
exit;