Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Can I clean this up??

by frankus (Priest)
on Jul 24, 2002 at 10:50 UTC ( #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? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2023-03-28 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (66 votes). Check out past polls.

    Notices?