Title: Regular expression question
I have a file such as:
My $file = c:\temp\zips\ok.txt;
How can I split the $file to get the only path:
My $dir = c:\temp\zips;
My $file = ok.txt;
Thanks in advance!
Lucy
___
Perl-Win32-Users
Hi,
Sorry for this delay, I had intended to try out the Active State Perl beta 2
with the new graphical PPM GUI much earlier. As my post is more about screen
reader and keybord accessibility than anything else, I thought I'd start a
new thread just for clarity. Here we go:
Summary
Even a
Title: Regular expression question
I have a file such as:
My $file = c:\temp\zips\ok.txt;
How can I split the $file to get the only path:
My $dir = c:\temp\zips;
My $file = ok.txt;
Thanks in advance!
Lucy
___
Perl-Win32-Users mailing
Okies, I did some modifications in the program and found out that the
culprit was a path which had \P in it.
The path was something like \\ABCD\C$\XYZ\PQRS\Pbc.log. When I modified
the path to
\\ABCD\C$\XYZ\\PQRS\\Pbc.log
It worked just fine. Now what does \P mean to grep function. I wish to
Title: Regular expression question
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Cai, Lucy (L.)Sent: Monday, July 31, 2006 17:21To:
Cai, Lucy (L.); perl-win32-users@listserv.ActiveState.com;
perl-unix-users@listserv.ActiveState.com;
[EMAIL PROTECTED];
[EMAIL
Title: Regular expression question
Cai, Lucy (L.) wrote, on Monday, July 31, 2006 8:21
PM
: My
$file = "c:\temp\zips\ok.txt";
: How can
I split the $file to get the only path:
: My $dir
= "c:\temp\zips";: My $file = "ok.txt";
May I
suggest you use File:Basename instead of a regex?
Joe
Title: Regular expression question
hi
wagner,
try
this:
#/perl
-w
$file =
'c:\temp\zips\foo\foo2\foo3\ok.txt'; @pa = split (/\\/, $file);$file =
$pa[$#pa];
for $i
(0..($#pa-1)) {$dir .=
"$pa[$i]\\";}
print "directory:
$dir\n";print "file: $file\n";
fabrício s.
martins