Sorry, but I re-read my post and it is slightly misleading.
The first snippet does work. When I print $mask it has in it what I
expect.
It's the second one that doesn't seem to work.
--
------------------------------------------------------------------------- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin
------------------------------------------------------------------------- RRRRR Gary Luther RR RR SAF RR RR UTABEGAS 2500 Broadway RR RR Helena, MT 59602 RRRR [EMAIL PROTECTED] RR RR ULE !! RR RR Visit our website at RR RR http://www.safmt.org >>> "Gary Luther" <[EMAIL PROTECTED]> 06/18/01 01:03PM >>> This is probably another one of my trivial questions, so
thanks in advance for not flaming me............:-)
I have a statement that I am using to mask from the user some
file names that I am displaying (print) to him for a y or n
decision.
There are many files and so I am trying to give him the option
of specifying the first letter of the filename and then mask whether
he
gets to see the file based on the mask that he inputs. (For
any ladies on the list he/him is generic for user :-) whewwww!!)
Here are some code snippets that don't seem to
work.
First the reading of the mask from the command
line:
53 if ($ARGV[1])
{
54 $mask = "[$ARGV[1]]"; 55 } else { 56 $mask ='[2,A-Z]'; #default mask 57 } Now the code that seems to totally ignore it:
75 foreach $file (@files)
{
76 if ($file =~ /^$mask/) { 77 chomp($file); 78 ($size, $name) = split(" ", $file); 79 print "PRINT ([y],n,q): $file\n"; 80 $input=<STDIN>; I have put in as ARGV[1] 2BCD but still get files starting
with A.
It would appear that the $mask maybe isn't expanding??
Just guessing.
OK guru's HELP!!
TIA
--
------------------------------------------------------------------------- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin
------------------------------------------------------------------------- RRRRR Gary Luther RR RR SAF RR RR UTABEGAS 2500 Broadway RR RR Helena, MT 59602 RRRR [EMAIL PROTECTED] RR RR ULE !! RR RR Visit our website at RR RR http://www.safmt.org |
BEGIN:VCARD VERSION:2.1 X-GWTYPE:USER FN:Gary Luther TEL;WORK:0631 ORG:;Computer Center TEL;PREF;FAX:(406) 444-0684 EMAIL;WORK;PREF;NGW:[EMAIL PROTECTED] N:Luther;Gary TITLE:Systems Administrator END:VCARD