RE: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread nkuipers
>= Original Message From chris <[EMAIL PROTECTED]> = >Given a full pathname c:\windows\system32\kernel32.dll > >I need to parse this into a directory, file, and extension > >my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; > >breaks down into the following > >my $dir = "c:\\window

RE: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread Shishir K. Singh
> Given a full pathname c:\windows\system32\kernel32.dll >I need to parse this into a directory, file, and extension >my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; >breaks down into the following >my $dir = "c:\\windows\\system32\\"; >my $file = "kernel32"; >my $ext = "dll"; Fil

Re: How to parse a full pathname into dir, file, ext?

2002-07-23 Thread chris
I get it. Thank you use File::Basename; my $os_string = "MSWin32"; fileparse_set_fstype($os_string); my $fullfilename = "c:\\windows\\system32\\kernel32.dll"; my ($name,$path,$suffix) = fileparse($fullfilename, '\..*'); $suffix =~ s/\.//g; print "$name\n" . "$path\n" . "$suffix\n"; -- To unsubs