On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
snip
if ($state == 'on') {
'vmware-cmd $_[0] stop soft';
my $tools = `/usr/bin/vmware-cmd \"$_[0]\"
gettoolslastactive -q`;
chomp
On 7/4/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
snip
> The second I am sure is the darn () in the file names I am feeding
> into the function. Can someone shed some light :) I need to call the
> first indices of many arrays that get passed into this function, so I
> was thinking $_[0] was w
?
So the `/usr/bin/vmware-cmd \"$_[0]\" gettoolslastactive -q`; is correct where
the var gets inserted?
Thanks!
jlc
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 8:15 PM
To: Joseph L. Casale
Cc: beginners@perl.org
Subject: Re: synta
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
snip
Is it actually incorrect to run: stop_it(@DNS); aside from maybe looking
strange?
snip
It doesn't look strange, but your code only works with the first
element of @DNS so it is pointless. If you want to say stop_it(@DNS)
and actually
OK Chase,
I saw the missing quotes:)
I sniped out the later work using the other elements of the array as to much
was broken! I do want to pass in an array and work with all of it.
So if I wanted to work with only the first indices to start, is this correct:
sub stop_it {
my ($vm) = @_[0];
Heh, I am running out of hair:P
I get two errors to start, one is the warning that is better write:
my ($vm) = $_[0];
instead of
my ($vm) = @_[0];
And the other is about the use of the global @_ (huh) with "my"?
I have this now:
#!/usr/bin/perl -w
@Exchange = ("/vmfs/volumes/467f06a5-7d59c067-35
Heh,
Clearly I need to sleep!
This doesn't even work either?
#!/usr/bin/perl -w
@list = (Exchange,Filter,DNS,Domain)
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
What is wrong here?
jlc
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Heh,
Clearly I need to sleep!
This doesn't even work either?
#!/usr/bin/perl -w
@list = (Exchange,Filter,DNS,Domain)
snip
You are missing your quotes.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
Heh, I am running out of hair:P
I get two errors to start, one is the warning that is better write:
my ($vm) = $_[0];
instead of
my ($vm) = @_[0];
The proper way to say this is
my ($vm) = @_;
And looking at your data I would suggest
my (
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to use
$_[0]
Second Value means
$_[1] and so on..
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to use
$_[0]
Second Value means
$_[1] and so on..
; beginners@perl.org
Subject: RE: syntax error of some sort?
@list = (Exchange,Filter,DNS,Domain);
sub stop_it {
$vm = $_[0];
print "$vm\n";
}
stop_it(@list)
A semi-colon is missing in the list assignment.
if you want to get the first value of the list then you have to u
12 matches
Mail list logo