Can someone please help with how to get this done.
I have an array, let's call it
@directories ('my/dir/name','my/dir/games','my/dir/hobbies');
I have a search function setup, but the one problem I'm coming across, I have this statement
find(\&wanted, @directories);
if (scalar @filesfound) {
foreach $mystuff (@filesfound) {
print "\t$mystuff\n";
When I do a search, it prints out the entire dir path I have specified in @directories. What I want is to only print the last name in the path, e.g., it would not print
/my/dir/games but print games instead.
I know split suppose to take care of it but I don't know how to do it.
Thanks
I have an array, let's call it
@directories ('my/dir/name','my/dir/games','my/dir/hobbies');
I have a search function setup, but the one problem I'm coming across, I have this statement
find(\&wanted, @directories);
if (scalar @filesfound) {
foreach $mystuff (@filesfound) {
print "\t$mystuff\n";
When I do a search, it prints out the entire dir path I have specified in @directories. What I want is to only print the last name in the path, e.g., it would not print
/my/dir/games but print games instead.
I know split suppose to take care of it but I don't know how to do it.
Thanks