> > # compares lines in 2 files, shows set difference > > > > # call as: myprog file1 file2 > > > > while (<>) > > { > > /(\S+)/ and $seen_in_file1{$1} = +1; > > Did you mean $seen_in_file1{$1} += 1; > > When you give the diamond operator it tries to open > all you command > line args as files one after the other. The first > while you have above > will finish of file1 and file2. > > > } > > > > while (<>) > > The second while you have here will wait on your > standard input. > You will have to press Control-D to proceed, in > effect your > only_in_file2 hash will either contain nothing or > some input > you give in the standard input. > > I think you will have to open these two files > explicitly to > do your difference check.
Sorry, I may sound stupid, how do I output the results without having to do a control-D in the middle of the program running -> how do I open these files explicitly? Many thanks.... Priss __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]