On Wed, Aug 28, 2002 at 04:59:59PM +0530, Javeed SAR wrote:
> Hi,
> 
> I am reading dirextory  using ls.

Don't.  Use opendir and readdir.  The 'perldoc -f readdir' gives you an
example how to filter the result by using grep.

> How to match for .dsp and .vbp  file extensions
> 
> Is this right?
> 
> if ($file1 =~ m/\.vbp$/)

    opendir DIR, "/some/dir"
        or die "Cannot access /some/dir: $!\n";
    my @files = grep { -f && /\.(ds|vb)p$/ } readdir DIR;
    closedir DIR;
    print @files;

-- 
            Well, then let's give that Java-Wussie a beating... (me)

Michael Lamertz                        |     +49 2234 204947 / +49 171 6900 310
Sandstr. 122                           |                       [EMAIL PROTECTED]
50226 Frechen                          |                 http://www.lamertz.net
Germany                                |               http://www.perl-ronin.de 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to