Please help

I need to make a spell check program that will open a
dictionary that the user enters the name of and then a
file that will be checked against the dictionary file.

so at prompt
% spellcheck.pl   Dictionary_file   Check_this_file

the program will 
open the Dictionary_File and then open the
Check_this_file  

after they are open I have to check one file against
the other  but I can'r get two files to open at once.

I have to separate the file names to be opened later
in subs
($file_D , $file_C) = (split " ". <>);

I am working on a few subs that will open the files
after I get them like

sub read_file1
    {
      print " \$file1 = $file1 \n";     # what is
value of $file1 ./DICT
     my $file1 = shift;                   # get 1st
argument to the sub ?
     my @dictionary;                     # going to be
checked against
     open(DICTIONARY,' $file_D') or return undef ; #
Also NOT working
#    open(DICTIONARY,$file_D) or return undef ;  # NOT
WORKING
# write dictionary to be compared against
# added path  because $file_D = './DICT' didn't work
(set for test) 
#    open(DICTIONARY,'./DICT') or return undef;  
#works w/ hard path
     while(<DICTIONARY>)
        {
         chomp;
         push @dictionary,$_;
 # i know it gets here if I use a path in the open
(handle , ' path ')
          print "while  $dictionary[$i] \t $i\n";    #
check 2b removed
         $i++;                                        
          # check 2b removed
        }
     close DICTIONARY;
     return @dictionary;
    }


# a similar start fot the file to be checked  but as
of yet I can not get a file open without a hard coded
path . It can not be a hard coded path because I do
not know the dictionary or the file to be checked in
advance.

Should I change my way of thinking of the problem?
Is there some bit of code that will separate files
like a \n (newline) except \? (newfile) that I can
split the <> input on?  

As always I thank you very much for your time and
effort in advance.

THank you  Thank you    Thank you very much

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to