#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    10
    Rep Power
    0

    Do I havve to print to the screen?


    In scripts that I've used, If I don't print to the screen at one point, I will get an error. If i do put a print in there so it is printing to the screen I get on errors.

    My question is do I have to print to the screen or STDOUT? And, if it just has to be STDOUT can I redirect STDOUT to some where else (maybe a file) and print to STDOUT after the redirection and not get an error?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,938
    Rep Power
    1225
    Did you not understand my answers to your prior question on this exact same issue?

    Please read through some of the links in this google search to learn "how cgi scripts work".
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    spaceBAR Central
    Posts
    229
    Rep Power
    42
    Can you give us some code to look at and exactly what errors you are getting?

    ** This prints to a file
    Code:
    my $log_file  =  "/tmp/log_file.log";
    open( LOG_FILE, "+>>$log_file" ) or die( "Couldn't create/open log file: $log_file.\n" );
    print LOG_FILE "Text written to log file.......\n";
    close LOG_FILE or die( "Couldn't close log file: $log_file, $!.\n" );


    ** This prints to you screen if you are running script from command line
    ** and have not redirected STDOUT

    Code:
    print "This just prints to screen if you are running from command line...\n";
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,938
    Rep Power
    1225
    spacebar208,

    The OP's question is being asked in a CGI context. The OP does not understand cgi form submission process.

IMN logo majestic logo threadwatch logo seochat tools logo