Do a SPLIT on the string using the "\" as the character to split by. This gives you an array @ of values. use the POP function to remove the last value from the array, which would be the filename. Then stick it all back together.
sorry no 'samples' thats the fun part of learning :-) Buy a copy of PERL for dummies !! its a great reference that I use a LOT. Peter Sumner -----Original Message----- From: John Deretich [mailto:[EMAIL PROTECTED] Sent: Thursday, 25 September 2003 12:47 To: 'HAWKINS,JOSHUA (HP-FtCollins,ex1)' Cc: Perl-Win32-Admin-Request (E-mail) Subject: RE: s/ / / operator Hi, would you know how to strip off the file name on the end? 'F:\new\new\test\test' Trying but unsuccessfull. thanks, John -----Original Message----- From: HAWKINS,JOSHUA (HP-FtCollins,ex1) [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 6:21 PM To: 'John Deretich' Subject: RE: s/ / / operator Nope, sorry that works for me. I get 'F:\new\new\test\test' as the result. Josh >-----Original Message----- >From: John Deretich [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 24, 2003 7:17 PM >To: 'HAWKINS,JOSHUA (HP-FtCollins,ex1)' >Cc: Perl-Win32-Admin-Request (E-mail) >Subject: RE: s/ / / operator > > >Sorry, > >it didn't work. >Any more ideas:) > >John > >-----Original Message----- >From: HAWKINS,JOSHUA (HP-FtCollins,ex1) [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 24, 2003 6:11 PM >To: 'John Deretich'; Perl-Win32-Admin-Request (E-mail) >Subject: RE: s/ / / operator > > >Try > >$new = "F:\\new\\new"; >$test = "F:\\test"; >$test1 = "F:\\test\\test\\test"; > >$test1 =~ s/\Q$test\E/$new/i; > >Josh > >>-----Original Message----- >>From: John Deretich [mailto:[EMAIL PROTECTED] >>Sent: Wednesday, September 24, 2003 6:53 PM >>To: Perl-Win32-Admin-Request (E-mail) >>Subject: s/ / / operator >> >> >>Hello, >> >>I was wondering if anyone knows how to use this s/ / / operator >>with variable interpolation. >> >>For example: >> >>$new = "F:\\new\\new"; >>$test = "F:\\test"; >>$test1 = "F:\\test\\test\\test"; >> >>$test1 =~ s/$test/$new/i; >> >>doesn't seem to work. >>Does anyone know why? >> >>thanks, >> >>John >>_______________________________________________ >>Perl-Win32-Admin mailing list >>[EMAIL PROTECTED] >>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs >> > _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
