"<< was unexpected at this time."

Posted by djerveren on 2007-04-02 05:48

Hello all.

I have written a Perl script that works flawlessly with the standard Perl interpeter on Solaris 9, but when I try to run it on a Windows host with ActiveState Perl 5.8.8, it pukes on the usage of the until_EOF trick.

The actual code looks like this:

open(IN,"nsradmin <<EOF
        . type: nsr client
        show name
        show comment
        show group
        p
        q
EOF|") or die "$0 ($$) Cannot execute nsradmin! ($!)";

while (<IN>) {
        ...
}

Hello all.

I have written a Perl script that works flawlessly with the standard Perl interpeter on Solaris 9, but when I try to run it on a Windows host with ActiveState Perl 5.8.8, it pukes on the usage of the until_EOF trick.

The actual code looks like this:

open(IN,"nsradmin <<EOF
        . type: nsr client
        show name
        show comment
        show group
        p
        q
EOF|") or die "$0 ($$) Cannot execute nsradmin! ($!)";

while (<IN>) {
        ...
}

This is the only way I know of that let me send commands to the application nsradmin and then get the output as a file handle to loop around.

Are there any other clever ways to make this work on Windows aswell?

Best regards, /Daniel.