Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Can I clean this up??

by frankus (Priest)
on Jul 24, 2002 at 10:50 UTC ( [id://184761]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open(FIL,">>$myfil") || die "No open for ct tot: $! \n";
    if($ct == 1){
    ...
    }
    system("mailx -s 'Mail header' myemail < $myfil");
    close(FIL);
    
  2. or download this
    open(MAIL,"|mailx blah) || die "No mail stuff: $! \n";
    if($ct == 1){
    ...
            print MAIL "\n$ct are not available at this time.\n";
    }
    close(MAIL);
    
  3. or download this
    # Removed brackets, replaced || with or due to higher presedence and r
    +eadability 
    # used single quotes on uninterpolated strings.
    ...
    print MAIL "\n$ct are not available at this time.\n" if $ct >= 2;
    
    close(MAIL);
    
  4. or download this
    open(MAIL,"|mailx blah) || die "No mail stuff: $! \n";
    SWITCH: {
    ...
       $ct == 1   && { print MAIL "\n$ct is down at this time.\n"; last SW
    +ITCH };
    }
    close(MAIL);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://184761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found