in reply to Stripping parts of paths from directory names

I'll just add my $0.02 to this by giving an example:

my $file='/home/sites/site18/users/rjoseph/web/images/image1.jpg'; 
 
if ($file=~/^(.+)(\/web.+)$/) { 
  my $part1=$1; 
  my $part2=$2; 
 
  print "$part1\n$part2\n"; 
} 

Produces the output of
/home/sites/site18/users/rjoseph
/web/images/image1.jpg

Now, the fun part begins when you have an image named "weblink.jpg" or something similiar. But I'll leave that as a exercise to the reader.
  • Comment on Re: Stripping parts of paths from directory names