Get font family from mainwindows : Font GUI Perl

 

#!/usr/local/bin/perl -w
use Tk;
use strict;

my $str = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789";

my $mw = MainWindow->new;
my $lframe = $mw->Frame->pack(-fill => 'both', -side => 'left', -expand => 1);
my $lb = $lframe->Scrolled(qw/Listbox -scrollbars e -height 3/)->
                          pack(qw/-fill both -expand 1 -side top/);

$lb->insert('end', sort $mw->fontFamilies);


my $entry = $mw->Entry(
    -textvariable => $str,
    -width => 12, 
    -font => "{Comic Sans MS} 72",
    -relief => 'raised',
    -highlightthickness => 0,
)->pack(-expand => 1, -fill => 'x', -side => 'left');

$lb->bind("<Button>", sub { $entry->configure(-font =>
    "{". $lb->get($lb->curselection) . "} 72"); });

MainLoop;

   
  

Get Servers : NetAdmin Win32 Perl

  

#!/usr/bin/perl -w

use Win32::NetAdmin;

$status = Win32::NetAdmin::GetServers( '', '',
    SV_TYPE_ALL,
    %all_systems );

if ($status) {
   @keys = keys( %all_systems );
   
   @sorted = sort( @keys );
   
   foreach $key (@sorted) {
      print "$key $all_systems{$key}n";
   }
} else {
   print_error();
}

sub print_error {
    print Win32::FormatMessage( Win32::GetLastError() );
}