my $filename = 'xxx/yyy/zzz.a'; my ($tmp1,$tmp2,$name) = split(/\//,$filename); print "$name";