my $userid = "rsennat"; #assume userid is set to a var my $string = $str1 . "," . $str2; system "echo $string" >> '/tmp/$userid';