Re: file name matching

2002-01-09 Thread Andrea Holstein
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) =

Re: file name matching

2002-01-08 Thread John W. Krahn
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>; > >

RE: file name matching

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

RE: file name matching

2002-01-08 Thread Scott
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,

RE: file name matching

2002-01-08 Thread Mahon, Rick
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