Hey Monks
I've got a system I'm working on consisting of several listings that I've been working on to solve certain parts of the problem. The general format is as follows:
#! /usr/bin/perl package diskman::runner; use strict; use warnings; use XML::Simple; # Accept arguments from the config.xml file my $args = XMLin('config/config.xml') or die "Can not read config.xml\ +n"; # Run the HP utility on every server in the config file foreach my $server (@{$args->{server}}) { system(qq[wine "/home/nathan/.wine/drive_c/Program\ Files/HP\ Remo +te\ System\ Management/"hprsmcli.exe -s $server -u $args->{user} -p $ +args->{pass} -f $args->{fmt} -o $args->{winepath}.$server -t $args->{ +options}]); } # Script is done print "Runner Done\n";
I've got 4 listings like this that I need to tie together in one script. This question is about my options for achieving such a package
Firstly, I know of system, exec, and backticks. If I run it using one of those, how do I know the script was successful and didn't die? Do warnings come back to my "main script"?. Secondly, what is the advantage of the package system? I'm thinking that I didn't design the listings as "modules" in a way that I can interface with them with use. I would just like to run them and return to the main script with some indication of failure or success. Do I need to use any package/use syntax?Ransom
In reply to Running script from script by Ransom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |