my $var ="templatedata/shared/awards/data/test";## You might want to do some validation here. ## e.g. remove the begining / if present, ## convert \ to / if applicable, ## $var contains atleast one / , etc. my @junk = split("/", $var);## Also you might want to check if the thrid element exists to avoid use of uninitialized variable kind of errors/warningsmy $third = $junk[2]; ## array index starts with 0.