#!/bin/perl -w use strict; use warnings; use Net::NTP; my $ntp = '0.au.ntp.pool.org'; my $port = '123'; sub syncNTP{ my %result = get_ntp_response($ntp,$port); my $time = $result{'Reference Timestamp'}; my $newtime = localtime($time); return $newtime; }