Hello All,
Here is the code for the format command:
use Win32::Service;
push( @ARGV, Win32::NodeName() ) unless( scalar @ARGV );
foreach my $Machine ( @ARGV )
{
local %List;
print "Available services on $Machine:\n";
if( Win32::Service::GetServices( $Machine, \%List ) )
{
$~ = FormatHeader;
write;
$~ = FormatData;
foreach $Service ( sort( keys( %List ) ) )
{
write;
}
print "\n" x 3;
}
else
{
print Win32::FormatMessage( Win32::GetLastError() ), "\n";
}
}
format FormatHeader =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
"Service Name", "Service Display Name"
---------------------------------------------------------- ------------
----------------------------------------------
.
format FormatData =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$List{$Service}, $Service
.
And here is the error.
Missing right curly or square bracket at example_8_1.pl line 38, at end
of linesyntax error at example_8_1.pl line 38, at EOF
Execution of example_8_1.pl aborted due to compilation errors.
And if I replace < with | or > it works just fine.
Michael D. Eggleton
http://www.gorealnetworks.com
mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]