my %file_hash = ( a=>'notiagro.html', d=>'notideportes.html' # and so on ); my $catfile = $file_hash{$cat} || 'default value';