Scott wrote:
>
> Morning:
>
> I need to scan a directory for files, they will be in pairs, a .tag file
> and a .txt file. I need to first make sure the .tag file(s) is there. If
> it is I need to check for the same prefix .txt file. Here is what I do to
> check for the file:
>
> ($scantag) =
Scott wrote:
>
> I need to scan a directory for files, they will be in pairs, a .tag file
> and a .txt file. I need to first make sure the .tag file(s) is there. If
> it is I need to check for the same prefix .txt file. Here is what I do to
> check for the file:
>
> ($scantag) = <*.tag>;
>
>
Works fine on the Linux box, no go on the Windows box. Anyone have
another idea?
Thanks,
-Scott
On Tue, 8 Jan 2002, Scott wrote:
> > I'm new to Perl, so take this with a grain of salt, but I did it like this:
> > use strict;
> > use File::Basename;
> > my $basename;
> > my $filename = 'your
Rick:
Thank you! I modified it to do a scan of all files in the directory
using:
my $basename;
my ($filename) = <*.tag>;
($basename) = fileparse($filename, '\.tag');
print "basename = $basename\n";
On Tue, 8 Jan 2002, Mahon, Rick wrote:
> I'm new to Perl, so take this with a grain of salt,
I'm new to Perl, so take this with a grain of salt, but I did it like this:
use strict;
use File::Basename;
my $basename;
my $filename = 'yourfile.tag';
($basename) = fileparse($filename, '\.tag');
print "basename = $basename\n";
# see perldoc File::Basename for more info. fileparse() can give