die problem?

Discussion in 'Perl Misc' started by g4173c@motorola.com, Apr 19, 2007.

  1. Guest

    Hi:

    I have the following code:

    #
    # First Check out the File...
    #
    system ("cleatool co -unr -nc $revfilename") || die "Error:
    Couldn't Check Out $revfilename: $!\n";
    #
    # Open File, find the REV variable name and increament...
    #
    open (REVFILE, "+<$revfilename") || die "Couldn't Open File
    $revfilename: $!\n";


    The system call has a typo for the command. I thought that it should
    have stopped there, however I get this:

    Can't exec "cleatool": No such file or directory at ba line 83,
    <ALTERA> line 6.
    Couldn't Open File pkg.vhd: Permission denied

    What am I doing wrong? Shouldn't it have exited on the cleatool error?

    Thanks for any help in advance!
    Tom
    , Apr 19, 2007
    #1
    1. Advertising

  2. wrote:
    >
    > I have the following code:
    >
    > #
    > # First Check out the File...
    > #
    > system ("cleatool co -unr -nc $revfilename") || die "Error:
    > Couldn't Check Out $revfilename: $!\n";
    > #
    > # Open File, find the REV variable name and increament...
    > #
    > open (REVFILE, "+<$revfilename") || die "Couldn't Open File
    > $revfilename: $!\n";
    >
    >
    > The system call has a typo for the command. I thought that it should
    > have stopped there, however I get this:
    >
    > Can't exec "cleatool": No such file or directory at ba line 83,
    > <ALTERA> line 6.
    > Couldn't Open File pkg.vhd: Permission denied
    >
    > What am I doing wrong? Shouldn't it have exited on the cleatool error?


    No.

    perldoc -f system



    John
    --
    Perl isn't a toolbox, but a small machine shop where you can special-order
    certain sorts of tools at low cost and in short order. -- Larry Wall
    John W. Krahn, Apr 19, 2007
    #2
    1. Advertising

  3. Purl Gurl <> wrote:
    > g4173c wrote:
    >
    >
    >> system ("cleatool co -unr -nc $revfilename") || die "Error:
    >> Couldn't Check Out $revfilename: $!\n";

    >
    >> The system call has a typo for the command. I thought that it should
    >> have stopped there, however I get this:

    >
    >> Can't exec "cleatool": No such file or directory at ba line 83,
    >> <ALTERA> line 6.

    >
    > Your system call is successful. An error message is returned to
    > your call,



    No it isn't.


    > which is success. Your argument "cleatool" is incorrect
    > but your "system" call successfully runs and completes; no system
    > error code is returned.



    Yes it is.

    perl -le '$ret = system "bad"; print $ret'

    -1


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Apr 20, 2007
    #3
  4. Purl Gurl <> wrote:
    > Tad McClellan wrote:
    >
    >> Purl Gurl wrote:
    >>> g4173c wrote:

    >
    > (snipped)
    >
    >>>> system ("cleatool co -unr -nc $revfilename") || die "Error:
    >>>> Couldn't Check Out $revfilename: $!\n";

    >
    >>>> The system call has a typo for the command. I thought that it should
    >>>> have stopped there, however I get this:

    >
    >>>> Can't exec "cleatool": No such file or directory at ba line 83,

    >
    >>> Your system call is successful. An error message is returned to
    >>> your call,

    >
    >> No it isn't.

    >
    > My presumption is you are not wearing your reading glasses
    > rather than your usual habit of lying to readers.



    My presumption is that you do not know the difference between
    a function's "return value" and "output".


    > "Can't exec "cleatool": No such file or directory at ba line 83"


    > Nah, this is not a problem



    That is output, it is not a return value as you said it was.


    >>> no system
    >>> error code is returned.

    >
    >> Yes it is.

    >
    >> perl -le '$ret = system "bad"; print $ret'

    >
    >> -1

    >
    > Irrelevant.



    It illustrates that system *does* return an error code.


    > All you have accomplished is to exemplify how
    > childish are you.



    All you have accomplished is to illustrate that you do not know
    what you are talking about. Yet again.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Apr 20, 2007
    #4
    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. Martin Nilsson

    Assign program result or die

    Martin Nilsson, Jul 15, 2004, in forum: Perl
    Replies:
    1
    Views:
    511
    J├╝rgen Exner
    Jul 15, 2004
  2. daniel kaplan

    die question

    daniel kaplan, Sep 14, 2004, in forum: Perl
    Replies:
    2
    Views:
    522
    Sherm Pendley
    Sep 14, 2004
  3. Lloyd Sheen

    Die IDE Die

    Lloyd Sheen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    426
    Natty Gur
    Jan 26, 2004
  4. Lloyd Sheen

    More Die IDE Die

    Lloyd Sheen, Jan 24, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    443
    Alvin Bruney
    Jan 25, 2004
  5. Ted
    Replies:
    1
    Views:
    586
    Eric Lawrence [MSFT]
    Mar 1, 2004
Loading...

Share This Page