return code to STDOUT

M

MischMan

newbie perl question: looking for a simple accurate way to state to
STDOUT that the program ran OK ...

thanx :)
 
W

Walter Roberson

:newbie perl question: looking for a simple accurate way to state to
:STDOUT that the program ran OK ...

And if the program might have bugs that you don't know about, then how
would you know that the program -really- ran correctly rather than
just running according to the way you programmed it?


But I suspect that isn't what you wanted to hear. What you
probably wanted to hear was:

print "OK\n";

which could be improved to

print STDOUT "OK\n";

just in case select() has been used to change the default location
to print to.
 
J

Jürgen Exner

MischMan said:
newbie perl question: looking for a simple accurate way to state to
STDOUT that the program ran OK ...

What about
print STDOUT "the program ran OK ...";

jue
 
R

Robin

newbie perl question: looking for a simple accurate way to state to
STDOUT that the program ran OK ...

just print something with print "something"; I know this has already been
answered, I wonder why I'm even here. You can also code:

select (STDOUT);
print "Something";


This will select your default file handle, STDOUT and then print it, if
you've selected another file.
peace,
-Robin
 
M

Matt Garrish

Robin said:
just print something with print "something"; I know this has already been
answered, I wonder why I'm even here. You can also code:

select (STDOUT);
print "Something";


This will select your default file handle, STDOUT and then print it, if
you've selected another file.

Did you just read Jurgen's post and thought you understood it? print will
*always* print to STDOUT by default, unless you specifically send the data
to another filehandle or output stream. The only reason to re-select STDOUT
is if you've already used a select statement in your code, and even then
it's incredibly pointless in this case to select STDOUT just to print an
okay message at the end of the script, don't you think? (Oh, sorry. I forgot
you don't...)

Matt
 
M

Matt Garrish

Matt Garrish said:
Did you just read Jurgen's post and thought you understood it?

The question still stands, but I meant to say Walter's post...

Matt
 
R

Robin

Matt Garrish said:
Did you just read Jurgen's post and thought you understood it? print will
*always* print to STDOUT by default, unless you specifically send the data
to another filehandle or output stream. The only reason to re-select STDOUT
is if you've already used a select statement in your code, and even then
it's incredibly pointless in this case to select STDOUT just to print an
okay message at the end of the script, don't you think? (Oh, sorry. I forgot
you don't...)

did read the post...actually, that's kinda what I meant...
-Peace-Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top