ファイル名: w/split_join_sub.cgi

#!/usr/local/bin/perl

#------------------------------------------------------------
$Title = 'split_join_sub';
$BODY = '<BODY BGCOLOR="#000000" TEXT="#C0C0C0">';
print "Content-type: text/html\n\n";

print "<HTML><HEAD><TITLE>$Title</TITLE></HEAD>\n";
print "$BODY\n";
$A = ('1a2a3a4a5a6a');
@A = split(/a/,$A);
@AA = join('b',@A);
#----------------------------------------
($sec,$min,$hour) = localtime(time);
$hour = sprintf("%02d", $hour);

if ($hour <= '03'){&yoru;}
else {&igai;}

#--------------------------------------------
sub igai {
print "$hour時\n";
print "<BR><BR>\n";
print "\$A = ('1a2a3a4a5a6a')\n";
print "<BR><BR>\n";
print "\@A = split(/a/,|$A)\n";
print "<BR><BR>\n";
print "\@A = @A\n";
print "<BR><BR>\n";
print "\@AA = join('b',\@A)\n";
print "<BR><BR>\n";
print "\@AA = @AA\n";
print "<BR><BR>\n";
}
sub yoru {
print "深夜\n";
&igai;
}

print "</BODY>\n";
print "</HTML>\n";
exit;