my $tempvalue = "c:/reports/check/test.txt"; my @split = split( '/', $tempvalue ); my $file = pop @split; print "\t", join( '/', @split ), "/design.$file\n";