#!/usr/bin/perl @before = ( "indono" , "acha" , "yamaoku" , "porute" , "piipo" ); @after = sort( @before ); @retfa = sort( b cmp a ) @before; print "Content-type:text/html\n\n"; print "変更前 = @before<br>"; print "変更後(昇順) = @after<br>"; print "変更後(降順) = @retfa<br>"; ●出力結果 変更前 = indono acha yamaoku porute piipo 変更後(昇順) = acha indono piipo porute yamaoku 変更後(降順) = yamaoku porute piipo indono acha