See Inline comments use strict; > use warnings; > my $fname = $ARGV[0]; > open my $RFH,'<',$fname; > > while (<$RFH>) { > next unless /:/ and my %field = /(.*?):(.*?)/mg; # Wrong > # I would prefer doing this chomp; if(/^(.+?)\:(.+?)/){ $field{$1}=$2;} }
> foreach my $key (keys %field ) { > print "KEY=[$key]------VALUE=[$field{$key}]\n"; > } > } > > But I am not getting the desired result. > > Thanks & Regards in advance > Anirban Adhikary. > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- Thanks Ram <http://www.netcore.co.in/> n <http://pragatee.com>