in reply to Using Win32::OLE 'Excel' and stumped

$allfiles[$elem] =~ /^[\d\w\s]+\.$filetype/

I believe the problem comes from your regex. Its's searching for 1 or more occurences of 'd','\','w' or 's' in the filenames. Note that \d,\w,\s don't work in a character class. As a result, @files is empty.

$allfiles[$elem] =~ /^(?:\S)+\.$filetype/

You could replace it with something like the above,which checks for non-whitespace characters.

Update: Thanks for the lesson..It's 1:35 a.m. here and I'm getting goggy : )..To think that I've read through Mastering Regular Expressions some time back..

Replies are listed 'Best First'.
Re: Re: Using Win32::OLE 'Excel' and stumped
by Albannach (Monsignor) on Apr 30, 2001 at 21:34 UTC
    Actually \d,\w and \s do work in character classes, though they are exceptions. This does mean that his regex is not very fussy, accepting any name of one or more characters made up of any combination of numerics, alphanumerics and whitespace, but I don't think it is the source of his problem.

    --
    I'd like to be able to assign to an luser

(tye)Re: Using Win32::OLE 'Excel' and stumped
by tye (Sage) on Apr 30, 2001 at 21:35 UTC

    Actually, they do. Try it.

            - tye (but my friends call me "Tye")