Gavin Henry said: > My brain is broken today. > > I have a file with a list of installed rpm packages, some of them are > duplicated and I want to sort the file/llist and print ones that have the > same name, like: > > yum-2.0.7 > yum-2.0.8 > > Then I am going to clean up the rpmdb > > Any tips, apart from reading my llama book ;-)
I HAVE just found the right page in my llama book: It gives something like: #!/usr/bin/perl -w my $what = "larry"; while (<>) { if (/^($what)/) { # pattern is anchored at beginning of string print "We saw $what in beginning of $_"; } } I will modify this one. Sorry for all the noise :-) > > > -- > Just getting into the best language ever... > Fancy a [EMAIL PROTECTED] Just ask!!! > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>