return code to STDOUT

Discussion in 'Perl Misc' started by MischMan, Jan 23, 2004.

  1. MischMan

    MischMan Guest

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

    thanx :)
     
    MischMan, Jan 23, 2004
    #1
    1. Advertising

  2. In article <>,
    MischMan <> 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
     
    Walter Roberson, Jan 23, 2004
    #2
    1. Advertising

  3. 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
     
    Jürgen Exner, Jan 23, 2004
    #3
  4. MischMan

    Robin Guest

    >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
     
    Robin, Jan 23, 2004
    #4
  5. MischMan

    Matt Garrish Guest

    "Robin" <> wrote in message
    news:buq8vk$vj7$...
    > >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
     
    Matt Garrish, Jan 23, 2004
    #5
  6. MischMan

    Matt Garrish Guest

    "Matt Garrish" <> wrote in message
    news:5ghQb.20096$...
    >
    > 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
     
    Matt Garrish, Jan 23, 2004
    #6
  7. MischMan

    Robin Guest

    "Matt Garrish" <> wrote in message
    news:5ghQb.20096$...
    >
    > "Robin" <> wrote in message
    > news:buq8vk$vj7$...
    > > >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
     
    Robin, Jan 24, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elad
    Replies:
    0
    Views:
    416
  2. Greenhorn
    Replies:
    15
    Views:
    839
    Keith Thompson
    Mar 6, 2005
  3. Replies:
    3
    Views:
    790
    Darío Griffo
    Jun 30, 2008
  4. Andreas S
    Replies:
    3
    Views:
    269
    Eric Hodel
    Dec 9, 2006
  5. Replies:
    2
    Views:
    348
    A. Sinan Unur
    Dec 7, 2005
Loading...

Share This Page