($old, $new) = @ARGV; if (-d $new) { ($basename = $old) =~ s#.*/##s; #what two s and three #mean ? $new .= "/$basename"; }