It's not clear to me if you like matching libqt-mt.so If you do, then change your regex to: if ($name =~ m/\.so/) # escape the period makes it match an actual period If not, then change it to: if ($name =~ m/\.so\./) #matches libqt.so.2, but not libqt-mt.so
the . character in your original regex is matching any character before the so, and you want to match an actual period. /\/\ark -----Original Message----- From: zentara [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 3:31 PM To: [EMAIL PROTECTED] Subject: regex for shared object files Hi, I'm trying to find all .so.xxx files on my system. Eventually I want to do things with them, but for now I just want to identify them. I pretty much have it, except I'm lacking enough regex knowledge to separate out the so from the .so. files. I'm matching cursor moc_sound libqt.so.2 libqt-mt.so etc. It's pretty close but not clean enough. Anyone? Thanks. ########################################## #!/usr/bin/perl -w use strict; use File::Basename; use File::Find; my $name; my $dirname= '/usr/lib'; find (\&found, $dirname); sub found { ($name) = basename("$File::Find::name"); if ($name =~ m/.so/){ print $name,"\n"; }} ########################################## -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]