$destination = (split /\n/, `ls -dt /path/to/targets/PC*`)[0]; chdir $destination;