in reply to Loging into a series of windows machines

Looks like scriptomatic (whatever that is) is seriously b0rken (or at least doesn't work well with perl).

For instance, that's VBScript-ish:

foreach my $objItem (in $colItems) {

That should be either (@$colItems) or (keys %$colItems) or such depending on what type of reference $colItems is. Use e.g. Data::Dumper to see what that is.

This doesn't parse properly, either:

sub WMIDateStringToDate(strDate) { return "blah ER"; }

This construct looks like JavaScript. In perl, you may put subroutine prototypes in parens after a subroutine identifier, but you generally don't want to, because you don't need that. And you don't name your parameters to a sub.

So that is

sub WMIDateStringToDate { return "blah ER"; }
which, given its usefulness and no being called anywhere, you could just drop entirely.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: Loging into a series of windows machines
by BrowserUk (Patriarch) on Dec 15, 2007 at 02:14 UTC
    For instance, that's VBScript-ish: foreach my $objItem (in $colItems) { That should be either (@$colItems) or (keys %$colItems) or such depending on what type of reference $colItems is.

    Actually not. $colItems is an Win32::OLE object and in is a function exported by that module for iterating collections.

    So ease up on the OP cos Win32::OLE is one of the hardest modules around to get to grips with even when you are fully conversant with Perl.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.