Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > return code to STDOUT

Reply
Thread Tools

return code to STDOUT

 
 
MischMan
Guest
Posts: n/a
 
      01-23-2004
newbie perl question: looking for a simple accurate way to state to
STDOUT that the program ran OK ...

thanx
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-23-2004
In article <(E-Mail Removed) >,
MischMan <(E-Mail Removed)> wrote:
: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.
--
History is a pile of debris -- Laurie Anderson
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      01-23-2004
MischMan wrote:
> 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


 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      01-23-2004
>newbie perl question: looking for a simple accurate way to state to
>STDOUT that the program ran OK ...


>thanx


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


 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      01-23-2004

"Robin" <(E-Mail Removed)> wrote in message
news:buq8vk$vj7$(E-Mail Removed)...
> >newbie perl question: looking for a simple accurate way to state to
> >STDOUT that the program ran OK ...

>
> >thanx

>
> 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


 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      01-23-2004

"Matt Garrish" <(E-Mail Removed)> wrote in message
news:5ghQb.20096$(E-Mail Removed) ...
>
> 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


 
Reply With Quote
 
Robin
Guest
Posts: n/a
 
      01-24-2004

"Matt Garrish" <(E-Mail Removed)> wrote in message
news:5ghQb.20096$(E-Mail Removed) ...
>
> "Robin" <(E-Mail Removed)> wrote in message
> news:buq8vk$vj7$(E-Mail Removed)...
> > >newbie perl question: looking for a simple accurate way to state to
> > >STDOUT that the program ran OK ...

> >
> > >thanx

> >
> > 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...)


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to return stdout from a method ? barthelemy.von.haller@gmail.com C++ 3 06-30-2008 12:09 PM
beginner Q: Kernel#puts, STDOUT, $stdout relation Andreas S Ruby 3 12-09-2006 12:39 AM
Problems redirecting STDOUT (NOT sys.stdout) to a pipe. Elad Python 0 03-19-2006 01:30 PM
copy stdout fails with permission denied when stdout is redirected brian.mabry.edwards@gmail.com Perl Misc 2 12-07-2005 10:49 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM



Advertisments