At 12:23 PM 8/20/02 -0400, FlashGuy wrote:

>We don't have the Spec module installed.

Then your Perl has been misinstalled, since File::Spec is part of the 
core and has been since 1998.  Talk to whoever installed your Perl and 
tell them it's either broken or horribly out of date.

>On Tue, 20 Aug 2002 09:18:05 -0700, Peter Scott wrote:
>
> > At 12:00 PM 8/20/02 -0400, FlashGuy wrote:
> >
> > >Hi,
> > >
> > >How can I retrieve the directory path and split the results into
> > >separate variables based on the "\"
> > >
> > >Example:
> > >
> > >d:\temp\test\files>
> > >
> > >Split:
> > >
> > >var1: d:
> > >var2: temp
> > >var3: test
> > >var4: files
> >
> > Use File::Spec, which is also portable.  (Since I ran this on Unix, I
> > had to fool it into thinking it was Windows to work with your example.)
> >
> > $ cat foo
> > #!/usr/bin/perl -wl
> > use strict;
> > BEGIN { $^O = "MSWin32" }         # You won't need this
> > use File::Spec;
> > my $path = "d:\\temp\\test\\files";
> > my @dirs = File::Spec->splitdir($path);
> > print join " * " => @dirs;
> >
> > $ ./foo
> > d: * temp * test * files
> >
> > --
> > Peter Scott
> > Pacific Systems Design Technologies
> > http://www.perldebugged.com/
> >

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to