Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Preprocessing print statements

by mauroid (Initiate)
on Nov 11, 2020 at 10:26 UTC ( [id://11123579]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $GREP_STR = "123"; ## a global var
    
    print GREP_FH "My line with 123\n"; ## anywhere in the code
    print GREP_FH "My line with 456\n";
    
  2. or download this
    &myprint("My line with 123\n");
    &myprint("My line with 456\n");
    
  3. or download this
    $GREP_STR = '123';
    
    print STDOUT "Header - always print this\n";
    print GREP_FH "My line with 123\n";    ## printed at the terminal
    print GREP_FH "My line with 456\n";    ## not printed
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-03-29 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found