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: If value is NULL then quit?: Edit Log



StarkRavingCalm
User

Mar 22, 2013, 10:47 AM


Views: 370
If value is NULL then quit?

I am creating a script that will monitor directories for specific files and email the contents.
That part is working great but how do I tell the script to quit if the array is empty?

my @files = grep ( -f ,<*.txt>);
# Write them out
foreach $file (@files) {
print "$file\n";
}

I dont want to repeatedly recieve email with:

$VAR1 = {};


(This post was edited by StarkRavingCalm on Mar 22, 2013, 10:49 AM)


Edit Log:
Post edited by StarkRavingCalm (User) on Mar 22, 2013, 10:49 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