Re: Assistance with regular expression

2011-02-16 Thread Akhthar Parvez K
Hi William, On Tuesday 15 Feb 2011, William Muriithi wrote: > Pal, > [snip] > I am trying to list files that exist on file1 that are missing on file2 and > have the following script: > > #! /usr/bin/perl > > use strict; > #use warning; > > open MSRT, "/Users/williamm/Documents/file1" or die $

Re: Assistance with regular expression

2011-02-14 Thread John W. Krahn
William Muriithi wrote: Pal, Hello, I have to files that I am trying to match: I think you mean two files? Generated from rpm -qa> file1 file1 libstdc++-4.1.2-48.el5 info-4.8-14.el5 libICE-1.0.1-2.1 libacl-2.2.39-6.el5 lcms-1.18-0.1.beta1.el5_3.2 dmidecode-2.10-3.el5 ... Generate f

Re: Assistance with regular expression

2011-02-14 Thread Parag Kalra
What you should probably do is to use hashes. Something like this: 1. Read the first file. 2. Split the each item of first file using an hyphen 3. Store the first item as the keys of hash say - file1_hash 4. Read the second file and store the items as the keys of a new hash say - file2_hash 5. Lo