Re: Getting directory path

2002-08-20 Thread Peter Scott
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 A

Re: Getting directory path

2002-08-20 Thread Samy Kamkar
you can use the Cwd module: use Cwd; my @vars = split(/\//, cwd); # or in your case ($var1, $var2, $var3, $var4) = split(/\//, cwd); I believe, even on windows, cwd will return the directory path with "/"s instead of "\"s FlashGuy wrote: > Hi, > > How can I retrieve the directory path and sp

Re: Getting directory path

2002-08-20 Thread drieux
On Tuesday, August 20, 2002, at 09:00 , FlashGuy wrote: > How can I retrieve the directory path and split the results into separate > variables based on the "\" > > Example: > > d:\temp\test\files> I would recommend the File::Basename approach, or you could go with say: #!/usr/bin/perl

Re: Getting directory path

2002-08-20 Thread Peter Scott
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