I tend to .. use File::Basename;
works well for me. Regards Martin -----Original Message----- From: Wittrock, Friedel [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 07:16 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: AW: s/ / / operator Hi, to get the filename: ----------------------------- $pf = 'F:\new\new\test\test'; $filename = (split /\\/, $pf)[-1]; print "Filename: $filename\n"; ----------------------------- regards Friedel -----Urspr�ngliche Nachricht----- Von: John Deretich [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 25. September 2003 05:17 An: 'HAWKINS,JOSHUA (HP-FtCollins,ex1)' Cc: Perl-Win32-Admin-Request (E-mail) Betreff: 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 ****************************************************************************** The information in this document, including any attachments or subsequent correspondence originating from this email address ("email"), is confidential and may be legally privileged. It is intended solely for the addressee. However, it may be intercepted by the system controller at Bankgesellschaft Berlin AG for the purposes of monitoring communications relevant to the system controller's business. Access to this email by anyone else is unauthorised. If you have received this email in error, please notify the Sender immediately by telephone. Please also delete this email from your computer. Any form of reproduction, dissemination, copying, disclosure, modification, distribution or publication of this email is prohibited without the prior consent of Bankgesellschaft Berlin AG. If you are not the intended recipient, any action taken or omitted to be taken in reliance of this email is strictly prohibited and may be unlawful. Bankgesellschaft Berlin AG accepts no liability for the consequences of any person acting, or refraining from action in reliance of this email ****************************************************************************** _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
