just the folder name?
test the snippet I posted earlier... it should do it for you!
L-P
2008/9/3 brian54321uk <[EMAIL PROTECTED]>
> Thanks for the input, having tested Shawns solution, I will probably find
> at a later date that it is vital I include the full pathname in future
> output, so will
Thanks for the input, having tested Shawns solution, I will probably
find at a later date that it is vital I include the full pathname in
future output, so will subject the file to a second pass to get rid of
the full pathname whilst I am at my present testing point.
However, I would like to get
what Shawn just wrote could be ok for you Brian, but only if you change
working directory while processing files, because his script uses cwd() to
get directory (which reads 'current working directory')
the other option would be to say:
use File::Basename;
use File::Spec;
my @alldirs = File::Spe
On Wed, 2008-09-03 at 16:47 +0100, brian54321uk wrote:
> Just tested this out and unfortunately instead of dirname replacing
> abc123, I get a .
That's because the dirname is a '.'
Try:
use Cwd;
if( (my $dir = dirname( $file )) eq '.' ){
$dir = cwd();
}
--
Just my 0.0002 million dollar
Mr. Shawn H. Corey wrote:
On Wed, 2008-09-03 at 14:55 +0100, brian54321uk wrote:
Hi
I would like to replace a string of characters in a file to the name of
the directory it is in.
Thefore, in the example below, I would like to know how to replace "?"
open( F, $ARGV[0] );
while( ) {
s!ab
On Wed, 2008-09-03 at 14:55 +0100, brian54321uk wrote:
> Hi
> I would like to replace a string of characters in a file to the name of
> the directory it is in.
> Thefore, in the example below, I would like to know how to replace "?"
>
>
> open( F, $ARGV[0] );
>
> while( ) {
>
> s!abc123!?!;