hello, It's my understanding that large libraries take longer to load, and libraries that use object oriented features of perl experience more overhead (to deal with the object oriented features), so this combination is probably producing the slow down on your machine. Yet I'm surprised that you are experiencing a dramatic slow down. Your script can be written a little more succinctly (and I think a little more readable): #!perl -w use strict; my ($mday, $mon, $year) = (localtime(time))[3..5]; $year = $year + 1900; $year = substr $year, 2; print sprintf "\n%02u/%02u/%02u", $mon + 1, $mday, $year; on 1/5/00 10:56 AM, John Delacour at JD@EREMITA.demon.co.uk wrote: > Further reading in perlfaq5.pod proposes two methods using > Time:localtime or not using it. The difference in speed is marked > owing to the time needed to load the lib, so I shall be sticking to > the time list. If the __END_ is uncommented in the script below, it > will take appreciably longer. > > > #!perl -w > @quicktime = localtime time; > $qd = $quicktime[3]; > if (length $qd < 2) {$qd = "0$qd"}; > $qm = 1 + $quicktime[4]; > if (length $qm < 2) {$qm = "0$qm"}; > $qy = 1900 + $quicktime[5]; > $qy = substr $qy, 2; > print "\n$qd\/$qm\/$qy"; > #__END__ > use Time::localtime; > $d = localtime(time())->mday; > if (length $d < 2) {$d = "0$d"}; > $m = 1 + localtime(time())->mon; > if (length $m < 2) {$m = "0$m"}; > $y =1900 + localtime(time())->year; > $y = substr $y, 2; > print "\n$d\/$m\/$y"; > > > This question of the time taken to load libraries (which I've > discussed briefly with Chris off-list in relation to AE) is bugging > me. My machine is not all that slow (180 MHz Motorola) and yet > scripts that require imported functions are slowed down dramatically. > > Perhaps I'm missing something, but surely not everyone is running a > G3 and this delay must be noticeable to others. Is there any way of > avoiding it? I've tried putting Time in a new folder and putting > this folder first in the Preferences list, but it makes no difference > > JD -- Enrique Terrazas, MD <mailto:terrazas@labmed.ucsf.edu> <http://pangloss.ucsf.edu/~terrazas/> # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org