#!/usr/bin/perl use strict; chomp( my $date = `date +%d_%b_%H-%M` ); my $dir = "/tmp"; my $result_file = "test-result-$date"; mkdir "$dir/$result_file" if ( !-d "$dir/$result_file" ); open( my $fh, ">", "$dir/$result_file/results.log" ) or die "Cannot create file - $!\n";