Prince99 has asked for the wisdom of the Perl Monks concerning the following question:

Hello again my brothers,
My question today is in regards to the use ofsystem(). I am trying to run a report on my network from a perl script. Here is the code I have tried thus far:
@args = ("/where/my/program/is", "report=sa lesrep.rdf", "useid=my_user_id", "server=my_server ", "destype=printer", "desname=my_desname"); $ret_val = system(@args) == 0 or die "system @args failed: $?"; }

Every time I run it I get the same error:
REP-0001: Unable to find the Report Builder message file. P lease verify your installation. system /where/my/program/is report=salesrep.rdf useid=my_userid server +=my_server destype=print er desname=my_desname failed: 256 at test2.pl line 24


Does anyone have an idea what this error refers to? Any help would be appreciated.

Prince99

Too Much is never enough...

Edit 2001-04-17 by tye

Replies are listed 'Best First'.
Re: error on system() call???
by arturo (Vicar) on Apr 17, 2001 at 19:15 UTC

    Since system executes an external program, that error message is produced by the file at /where/my/program/is, so check the documentation on that program to find out what it means.

    Or you could read the message you get and deduce that the problem is that the external program can't find the Report Builder message file =)

    (OK, that last bit should help you find what you're looking for in the docs for the program)

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

(tye)Re: error on system() call???
by tye (Sage) on Apr 17, 2001 at 20:47 UTC
    $ret_val = system(@args) == 0 or die

    Note that that is parsed as: $ret_val = ( system(@args) == 0 )  or  die and so doesn't actually record the exit status.

            - tye (but my friends call me "Tye")
Re: error on system() call???
by THRAK (Monk) on Apr 17, 2001 at 19:21 UTC
    Sounds like a pathing problem. You are calling the program, but it can't find its accessory files (i.e. report_builder.msg). Add the proper location to the path, or maybe you can use chdir $LOC so you are in the directory where the accessory files are located. This should fix this problem.

    -THRAK
    www.polarlava.com
Re: error on system() call???
by ChOas (Curate) on Apr 17, 2001 at 19:25 UTC
    And a quicky: The actual return value of the system
    call is in the high 8 bits, so you might want to
    shift the return to get the real result:
    $Retval=system(@Args)>>8

    GreetZ!,
      ChOas

    print "profeth still\n" if /bird|devil/;