-Original Message-
From: Uri Guttman [mailto:u...@stemsystems.com]
Sent: Wednesday, April 21, 2010 4:21 PM
To: Lonnie Ellis
Cc: beginners@perl.org
Subject: Re: Using backtick operator output and feeding it into array
>>>>> "LE" == Lonnie Ellis writes:
LE>
-Original Message-
From: Linux Expert [mailto:linuxexper...@gmail.com]
Sent: Wednesday, April 21, 2010 4:28 PM
To: beginners@perl.org
Subject: Re: Using backtick operator output and feeding it into array
(@digOutput) = `dig -x $ipaddie +short`;
The line shown above is replacing the
(@digOutput) = `dig -x $ipaddie +short`;
The line shown above is replacing the entire @digOutput array on each
assignment. Try this instead:
push @digOutput,`dig -x $ipaddie +short`;
> "LE" == Lonnie Ellis writes:
LE> I'm pretty new to perl, and can't seem to get the following bit of code
LE> to work. If I print the array while in the sub, it returns what I want
LE> but outside of the sub it doesn't recognize it. Aren't all variable
LE> global by default unless