関数:大文字と小文字の変換をしたい
lc関数およびuc関数を使うと、文字列の大文字と小文字の変換を行うことができます。
lc(変換前文字列)およびuc(変換前文字列)
変換前文字列には、大文字小文字問わずアルファベット文字列を指定します。
プログラム 例
#!/usr/bin/perl
use locale;
$string = "Hello World!";
print "変換前の文字列は、" . $string , "\n";
print "大文字に変換すると、" , uc($string) , "\n";
print "小文字に変換すると、" , lc($string) , "\n";
例の実行結果
[it-engineer@home1 perl]# perl 20070518-1.pl
変換前の文字列は、Hello World!
大文字に変換すると、HELLO WORLD!
小文字に変換すると、hello world!

