CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [StarkRavingCalm] If value is NULL then quit?: Edit Log



Kenosis
User

Mar 22, 2013, 10:57 AM


Views: 349
Re: [StarkRavingCalm] If value is NULL then quit?


Code
my @files = grep ( -f ,<*.txt>) or exit;


And this gives the same results:


Code
my @files = <*.txt> or exit;


Don't need to grep for whether it's a file...


(This post was edited by Kenosis on Mar 22, 2013, 11:03 AM)


Edit Log:
Post edited by Kenosis (User) on Mar 22, 2013, 11:01 AM
Post edited by Kenosis (User) on Mar 22, 2013, 11:02 AM
Post edited by Kenosis (User) on Mar 22, 2013, 11:03 AM
Post edited by Kenosis (User) on Mar 22, 2013, 11:03 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives