gokuraku has asked for the wisdom of the Perl Monks concerning the following question:
Gives me an output from java -version displayed while the script runs, but the array never gets populated for some reason.#! /usr/local/bin/perl use strict; my @javaInfo = `java -version`; foreach my $line (@javaInfo) { print "- $line\n"; }
Gets the perl information fine...so is this due to the way the data is returned? The format (like the quotes around the java version), maybe I am missing pipe for the data stream or something else?#! /usr/local/bin/perl use strict; my @perlInfo = `perl -version`; foreach my $line (@perlInfo) { print "- $line\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why isn't my array populating?
by Fletch (Bishop) on Mar 27, 2008 at 15:14 UTC | |
by gokuraku (Monk) on Mar 27, 2008 at 19:16 UTC | |
by graff (Chancellor) on Mar 28, 2008 at 00:55 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |