okay so this works:

@files = </home/*/*.txt>;
print "@files\n";

but this doesn't:

$search = "/home/*/*.txt";
@files = <$search>;
print "@files\n";

why? I need to know the workings.. (I am a bit of guru in Perl but still
missing some of the finer details). I have used opendir/readdir/closedir to
do this, but I wanted to know why the second example doesn't work.

-----Original Message-----
From: Jonathan E. Paton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 2:24 PM
To: [EMAIL PROTECTED]
Subject: Re: silly unlink question..


> But can someone explain the <*.bak>? how does that work
> and what does it do?  (and where is there a description
> of it's use)?   Thanx

File glob.  Returns an array of filenames which match the
regex /*\.bak$/ - basically those that end in .bak

This is a very Unix like feature of Perl, which avoids
having to use opendir/readdir/closedir much of the time. 
Useful when you get RSI, and want to use Perl shortcuts.

Jonathan Paton



__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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

Reply via email to