Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Your help in this matter is greatly appreciated. For I am stumped with this one! Thanks in advance.#!/usr/bin/perl -w use strict; use FileHandle; my $localdir="C:\\PROJECTS\\"; my $id="LWX1"; opendir LOCALDIR, "$localdir"; my @local_files = grep /^$id/i, readdir LOCALDIR; ###my guess fr both would be this: (doesn't work) ###where "_arbv_" is the 2nd string that must be matched #my @local_files = grep /^$id&&_arbv_/i, readdir LOCALDIR; closedir LOCALDIR; ##determine which files to download foreach my $local (@local_files) { print "$local\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Regexp help w/ grep
by Roy Johnson (Monsignor) on Oct 14, 2005 at 17:11 UTC | |
|
Re: Perl Regexp help w/ grep
by VSarkiss (Monsignor) on Oct 14, 2005 at 17:40 UTC | |
|
Re: Perl Regexp help w/ grep
by injunjoel (Priest) on Oct 14, 2005 at 17:08 UTC | |
by revdiablo (Prior) on Oct 14, 2005 at 19:00 UTC | |
by duff (Parson) on Oct 15, 2005 at 03:52 UTC |