#!/usr/local/bin/perl use strict; use warnings; %tAssociativeArray=('name'=>'John','age'=>'31','sex'=>'male'); foreach(sort keys %tAssociativeArray) { $tKey=$_; $tValue=$tAssociativeArray{$tKey}; print $tKey.' -> '.$tValue."\n"; }%tAssoc