in reply to Re: Re: foreach inside print
in thread foreach inside print

You can do it with a substitution, but that's not really a good idea, and difficult to make portable. Instead, use File::Basename, and the basename or dirname methods.