Re: system()

[email protected] ("Chas. Owens")
Newsgroups perl.beginners
Message-ID <[email protected]>
On Mon, May 19, 2008 at 6:21 AM, schms <[email protected]> wrote:
snip
> while (<RDME>) {
snip

you need a chomp here

snip
>        my $POLICYNAME = $_;
>
>        my @args = ("/usr/openv/netbackup/bin/admincmd/bpplinfo
> $POLICYNAME -modify -inactive");
snip

this is a pointless use of an array with one element.

Try this instead:

open my $readme, "-|", $COMMAND
    or die "had a problem running $COMMAND: $!\n";

while (my $policyname = <$readme>) {
    chomp($policyname);
    system("/usr/openv/netbackup/bin/admincmd/bpplinfo", $policyname,
"-modify", "-inactive");
}

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.