#!perl use warnings; use strict; use CGI; open FH, '>','/tmp/hash.dat' or die "Can not open hash.dat : $!"; my $q = new CGI; for my $k ( sort $q->param ) { if ($k =~ /(.+)_drp$/){ print FH join'|', $q->param( $1 ),$q->param( $k )."\n"; } } close FH;