# No.19 Perl Sample (code key - 36) # Learning Perl: Convert text to upper case 2 (小文字を大文字に変換する) # Tomonori Nagano # Last Update: January 18, 2008 # # This file is encoded in Unicode (UTF-8). If you see gibberish characters, # please re-encode the file in utf-8. # # this sample script is simplified for pedagogical purposes. Those who are # interested in advanced Perl programming are encouraged to consult with # relevant sections of "Perl Cookbook" by Christiansen & Torkington while(<>){ chomp ; # delete the end-of-line character foreach (@chars = split("",$_)) { print "\u$_" ; # \u converts only the initial character to upper-case } print "\n" ; # print the end-of-line character }