But there is no array in the code snippet, and this makes your post incoherent. (That means we can't understand what you are trying to ask us about.)The array contents are ...
I think one or more monks, in replying to one or more of your earlier posts, has mentioned modules like File::Spec and File::Basename. Have you looked into those? Have you tried them? Is there some problem that you have with trying them?
Others have also told you about using split -- e.g. like this:
Have you tried anything like that yet? Is there some problem with trying that?my @a = qw/C:\abc\dfg\axy C:\abc\dfg\#@$#@$@\hwllo/; for ( @a ) { my @p = split /\\/; print "last-component= ", $p[-1], " and next-to-last= ", $p[-2], " +\n"; }
In reply to Re: unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by graff
in thread unable to fomulate right regular expression to fetch the intermediate and last word from a line (windows path) using delimiter "\"
by suniln
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |