This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Increase $English::VERSION to 1.06
[perl5.git] / cpan / Time-HiRes / HiRes.pm
1 package Time::HiRes;
2
3 { use 5.006; }
4 use strict;
5
6 require Exporter;
7 require DynaLoader;
8
9 our @ISA = qw(Exporter DynaLoader);
10
11 our @EXPORT = qw( );
12 our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
13                  getitimer setitimer nanosleep clock_gettime clock_getres
14                  clock clock_nanosleep
15                  CLOCK_HIGHRES CLOCK_MONOTONIC CLOCK_PROCESS_CPUTIME_ID
16                  CLOCK_REALTIME CLOCK_SOFTTIME CLOCK_THREAD_CPUTIME_ID
17                  CLOCK_TIMEOFDAY CLOCKS_PER_SEC
18                  ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF
19                  TIMER_ABSTIME
20                  d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
21                  d_nanosleep d_clock_gettime d_clock_getres
22                  d_clock d_clock_nanosleep
23                  stat
24                 );
25
26 our $VERSION = '1.9725';
27 our $XS_VERSION = $VERSION;
28 $VERSION = eval $VERSION;
29
30 our $AUTOLOAD;
31 sub AUTOLOAD {
32     my $constname;
33     ($constname = $AUTOLOAD) =~ s/.*:://;
34     # print "AUTOLOAD: constname = $constname ($AUTOLOAD)\n";
35     die "&Time::HiRes::constant not defined" if $constname eq 'constant';
36     my ($error, $val) = constant($constname);
37     # print "AUTOLOAD: error = $error, val = $val\n";
38     if ($error) {
39         my (undef,$file,$line) = caller;
40         die "$error at $file line $line.\n";
41     }
42     {
43         no strict 'refs';
44         *$AUTOLOAD = sub { $val };
45     }
46     goto &$AUTOLOAD;
47 }
48
49 sub import {
50     my $this = shift;
51     for my $i (@_) {
52         if (($i eq 'clock_getres'    && !&d_clock_getres)    ||
53             ($i eq 'clock_gettime'   && !&d_clock_gettime)   ||
54             ($i eq 'clock_nanosleep' && !&d_clock_nanosleep) ||
55             ($i eq 'clock'           && !&d_clock)           ||
56             ($i eq 'nanosleep'       && !&d_nanosleep)       ||
57             ($i eq 'usleep'          && !&d_usleep)          ||
58             ($i eq 'ualarm'          && !&d_ualarm)) {
59             require Carp;
60             Carp::croak("Time::HiRes::$i(): unimplemented in this platform");
61         }
62     }
63     Time::HiRes->export_to_level(1, $this, @_);
64 }
65
66 bootstrap Time::HiRes;
67
68 # Preloaded methods go here.
69
70 sub tv_interval {
71     # probably could have been done in C
72     my ($a, $b) = @_;
73     $b = [gettimeofday()] unless defined($b);
74     (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
75 }
76
77 # Autoload methods go after =cut, and are processed by the autosplit program.
78
79 1;
80 __END__
81
82 =head1 NAME
83
84 Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers
85
86 =head1 SYNOPSIS
87
88   use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep
89                       clock_gettime clock_getres clock_nanosleep clock
90                       stat );
91
92   usleep ($microseconds);
93   nanosleep ($nanoseconds);
94
95   ualarm ($microseconds);
96   ualarm ($microseconds, $interval_microseconds);
97
98   $t0 = [gettimeofday];
99   ($seconds, $microseconds) = gettimeofday;
100
101   $elapsed = tv_interval ( $t0, [$seconds, $microseconds]);
102   $elapsed = tv_interval ( $t0, [gettimeofday]);
103   $elapsed = tv_interval ( $t0 );
104
105   use Time::HiRes qw ( time alarm sleep );
106
107   $now_fractions = time;
108   sleep ($floating_seconds);
109   alarm ($floating_seconds);
110   alarm ($floating_seconds, $floating_interval);
111
112   use Time::HiRes qw( setitimer getitimer );
113
114   setitimer ($which, $floating_seconds, $floating_interval );
115   getitimer ($which);
116
117   use Time::HiRes qw( clock_gettime clock_getres clock_nanosleep
118                       ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF );
119
120   $realtime   = clock_gettime(CLOCK_REALTIME);
121   $resolution = clock_getres(CLOCK_REALTIME);
122
123   clock_nanosleep(CLOCK_REALTIME, 1.5e9);
124   clock_nanosleep(CLOCK_REALTIME, time()*1e9 + 10e9, TIMER_ABSTIME);
125
126   my $ticktock = clock();
127
128   use Time::HiRes qw( stat );
129
130   my @stat = stat("file");
131   my @stat = stat(FH);
132
133 =head1 DESCRIPTION
134
135 The C<Time::HiRes> module implements a Perl interface to the
136 C<usleep>, C<nanosleep>, C<ualarm>, C<gettimeofday>, and
137 C<setitimer>/C<getitimer> system calls, in other words, high
138 resolution time and timers. See the L</EXAMPLES> section below and the
139 test scripts for usage; see your system documentation for the
140 description of the underlying C<nanosleep> or C<usleep>, C<ualarm>,
141 C<gettimeofday>, and C<setitimer>/C<getitimer> calls.
142
143 If your system lacks C<gettimeofday()> or an emulation of it you don't
144 get C<gettimeofday()> or the one-argument form of C<tv_interval()>.
145 If your system lacks all of C<nanosleep()>, C<usleep()>,
146 C<select()>, and C<poll>, you don't get C<Time::HiRes::usleep()>,
147 C<Time::HiRes::nanosleep()>, or C<Time::HiRes::sleep()>.
148 If your system lacks both C<ualarm()> and C<setitimer()> you don't get
149 C<Time::HiRes::ualarm()> or C<Time::HiRes::alarm()>.
150
151 If you try to import an unimplemented function in the C<use> statement
152 it will fail at compile time.
153
154 If your subsecond sleeping is implemented with C<nanosleep()> instead
155 of C<usleep()>, you can mix subsecond sleeping with signals since
156 C<nanosleep()> does not use signals.  This, however, is not portable,
157 and you should first check for the truth value of
158 C<&Time::HiRes::d_nanosleep> to see whether you have nanosleep, and
159 then carefully read your C<nanosleep()> C API documentation for any
160 peculiarities.
161
162 If you are using C<nanosleep> for something else than mixing sleeping
163 with signals, give some thought to whether Perl is the tool you should
164 be using for work requiring nanosecond accuracies.
165
166 Remember that unless you are working on a I<hard realtime> system,
167 any clocks and timers will be imprecise, especially so if you are working
168 in a pre-emptive multiuser system.  Understand the difference between
169 I<wallclock time> and process time (in UNIX-like systems the sum of
170 I<user> and I<system> times).  Any attempt to sleep for X seconds will
171 most probably end up sleeping B<more> than that, but don't be surpised
172 if you end up sleeping slightly B<less>.
173
174 The following functions can be imported from this module.
175 No functions are exported by default.
176
177 =over 4
178
179 =item gettimeofday ()
180
181 In array context returns a two-element array with the seconds and
182 microseconds since the epoch.  In scalar context returns floating
183 seconds like C<Time::HiRes::time()> (see below).
184
185 =item usleep ( $useconds )
186
187 Sleeps for the number of microseconds (millionths of a second)
188 specified.  Returns the number of microseconds actually slept.
189 Can sleep for more than one second, unlike the C<usleep> system call.
190 Can also sleep for zero seconds, which often works like a I<thread yield>.
191 See also C<Time::HiRes::usleep()>, C<Time::HiRes::sleep()>, and
192 C<Time::HiRes::clock_nanosleep()>.
193
194 Do not expect usleep() to be exact down to one microsecond.
195
196 =item nanosleep ( $nanoseconds )
197
198 Sleeps for the number of nanoseconds (1e9ths of a second) specified.
199 Returns the number of nanoseconds actually slept (accurate only to
200 microseconds, the nearest thousand of them).  Can sleep for more than
201 one second.  Can also sleep for zero seconds, which often works like
202 a I<thread yield>.  See also C<Time::HiRes::sleep()>,
203 C<Time::HiRes::usleep()>, and C<Time::HiRes::clock_nanosleep()>.
204
205 Do not expect nanosleep() to be exact down to one nanosecond.
206 Getting even accuracy of one thousand nanoseconds is good.
207
208 =item ualarm ( $useconds [, $interval_useconds ] )
209
210 Issues a C<ualarm> call; the C<$interval_useconds> is optional and
211 will be zero if unspecified, resulting in C<alarm>-like behaviour.
212
213 Returns the remaining time in the alarm in microseconds, or C<undef>
214 if an error occurred.
215
216 ualarm(0) will cancel an outstanding ualarm().
217
218 Note that the interaction between alarms and sleeps is unspecified.
219
220 =item tv_interval 
221
222 tv_interval ( $ref_to_gettimeofday [, $ref_to_later_gettimeofday] )
223
224 Returns the floating seconds between the two times, which should have
225 been returned by C<gettimeofday()>. If the second argument is omitted,
226 then the current time is used.
227
228 =item time ()
229
230 Returns a floating seconds since the epoch. This function can be
231 imported, resulting in a nice drop-in replacement for the C<time>
232 provided with core Perl; see the L</EXAMPLES> below.
233
234 B<NOTE 1>: This higher resolution timer can return values either less
235 or more than the core C<time()>, depending on whether your platform
236 rounds the higher resolution timer values up, down, or to the nearest second
237 to get the core C<time()>, but naturally the difference should be never
238 more than half a second.  See also L</clock_getres>, if available
239 in your system.
240
241 B<NOTE 2>: Since Sunday, September 9th, 2001 at 01:46:40 AM GMT, when
242 the C<time()> seconds since epoch rolled over to 1_000_000_000, the
243 default floating point format of Perl and the seconds since epoch have
244 conspired to produce an apparent bug: if you print the value of
245 C<Time::HiRes::time()> you seem to be getting only five decimals, not
246 six as promised (microseconds).  Not to worry, the microseconds are
247 there (assuming your platform supports such granularity in the first
248 place).  What is going on is that the default floating point format of
249 Perl only outputs 15 digits.  In this case that means ten digits
250 before the decimal separator and five after.  To see the microseconds
251 you can use either C<printf>/C<sprintf> with C<"%.6f">, or the
252 C<gettimeofday()> function in list context, which will give you the
253 seconds and microseconds as two separate values.
254
255 =item sleep ( $floating_seconds )
256
257 Sleeps for the specified amount of seconds.  Returns the number of
258 seconds actually slept (a floating point value).  This function can
259 be imported, resulting in a nice drop-in replacement for the C<sleep>
260 provided with perl, see the L</EXAMPLES> below.
261
262 Note that the interaction between alarms and sleeps is unspecified.
263
264 =item alarm ( $floating_seconds [, $interval_floating_seconds ] )
265
266 The C<SIGALRM> signal is sent after the specified number of seconds.
267 Implemented using C<setitimer()> if available, C<ualarm()> if not.
268 The C<$interval_floating_seconds> argument is optional and will be
269 zero if unspecified, resulting in C<alarm()>-like behaviour.  This
270 function can be imported, resulting in a nice drop-in replacement for
271 the C<alarm> provided with perl, see the L</EXAMPLES> below.
272
273 Returns the remaining time in the alarm in seconds, or C<undef>
274 if an error occurred.
275
276 B<NOTE 1>: With some combinations of operating systems and Perl
277 releases C<SIGALRM> restarts C<select()>, instead of interrupting it.
278 This means that an C<alarm()> followed by a C<select()> may together
279 take the sum of the times specified for the C<alarm()> and the
280 C<select()>, not just the time of the C<alarm()>.
281
282 Note that the interaction between alarms and sleeps is unspecified.
283
284 =item setitimer ( $which, $floating_seconds [, $interval_floating_seconds ] )
285
286 Start up an interval timer: after a certain time, a signal ($which) arrives,
287 and more signals may keep arriving at certain intervals.  To disable
288 an "itimer", use C<$floating_seconds> of zero.  If the
289 C<$interval_floating_seconds> is set to zero (or unspecified), the
290 timer is disabled B<after> the next delivered signal.
291
292 Use of interval timers may interfere with C<alarm()>, C<sleep()>,
293 and C<usleep()>.  In standard-speak the "interaction is unspecified",
294 which means that I<anything> may happen: it may work, it may not.
295
296 In scalar context, the remaining time in the timer is returned.
297
298 In list context, both the remaining time and the interval are returned.
299
300 There are usually three or four interval timers (signals) available: the
301 C<$which> can be C<ITIMER_REAL>, C<ITIMER_VIRTUAL>, C<ITIMER_PROF>, or
302 C<ITIMER_REALPROF>.  Note that which ones are available depends: true
303 UNIX platforms usually have the first three, but only Solaris seems to
304 have C<ITIMER_REALPROF> (which is used to profile multithreaded programs).
305 Win32 unfortunately does not haveinterval timers.
306
307 C<ITIMER_REAL> results in C<alarm()>-like behaviour.  Time is counted in
308 I<real time>; that is, wallclock time.  C<SIGALRM> is delivered when
309 the timer expires.
310
311 C<ITIMER_VIRTUAL> counts time in (process) I<virtual time>; that is,
312 only when the process is running.  In multiprocessor/user/CPU systems
313 this may be more or less than real or wallclock time.  (This time is
314 also known as the I<user time>.)  C<SIGVTALRM> is delivered when the
315 timer expires.
316
317 C<ITIMER_PROF> counts time when either the process virtual time or when
318 the operating system is running on behalf of the process (such as I/O).
319 (This time is also known as the I<system time>.)  (The sum of user
320 time and system time is known as the I<CPU time>.)  C<SIGPROF> is
321 delivered when the timer expires.  C<SIGPROF> can interrupt system calls.
322
323 The semantics of interval timers for multithreaded programs are
324 system-specific, and some systems may support additional interval
325 timers.  For example, it is unspecified which thread gets the signals.
326 See your C<setitimer()> documentation.
327
328 =item getitimer ( $which )
329
330 Return the remaining time in the interval timer specified by C<$which>.
331
332 In scalar context, the remaining time is returned.
333
334 In list context, both the remaining time and the interval are returned.
335 The interval is always what you put in using C<setitimer()>.
336
337 =item clock_gettime ( $which )
338
339 Return as seconds the current value of the POSIX high resolution timer
340 specified by C<$which>.  All implementations that support POSIX high
341 resolution timers are supposed to support at least the C<$which> value
342 of C<CLOCK_REALTIME>, which is supposed to return results close to the
343 results of C<gettimeofday>, or the number of seconds since 00:00:00:00
344 January 1, 1970 Greenwich Mean Time (GMT).  Do not assume that
345 CLOCK_REALTIME is zero, it might be one, or something else.
346 Another potentially useful (but not available everywhere) value is
347 C<CLOCK_MONOTONIC>, which guarantees a monotonically increasing time
348 value (unlike time() or gettimeofday(), which can be adjusted).
349 See your system documentation for other possibly supported values.
350
351 =item clock_getres ( $which )
352
353 Return as seconds the resolution of the POSIX high resolution timer
354 specified by C<$which>.  All implementations that support POSIX high
355 resolution timers are supposed to support at least the C<$which> value
356 of C<CLOCK_REALTIME>, see L</clock_gettime>.
357
358 =item clock_nanosleep ( $which, $nanoseconds, $flags = 0)
359
360 Sleeps for the number of nanoseconds (1e9ths of a second) specified.
361 Returns the number of nanoseconds actually slept.  The $which is the
362 "clock id", as with clock_gettime() and clock_getres().  The flags
363 default to zero but C<TIMER_ABSTIME> can specified (must be exported
364 explicitly) which means that C<$nanoseconds> is not a time interval
365 (as is the default) but instead an absolute time.  Can sleep for more
366 than one second.  Can also sleep for zero seconds, which often works
367 like a I<thread yield>.  See also C<Time::HiRes::sleep()>,
368 C<Time::HiRes::usleep()>, and C<Time::HiRes::nanosleep()>.
369
370 Do not expect clock_nanosleep() to be exact down to one nanosecond.
371 Getting even accuracy of one thousand nanoseconds is good.
372
373 =item clock()
374
375 Return as seconds the I<process time> (user + system time) spent by
376 the process since the first call to clock() (the definition is B<not>
377 "since the start of the process", though if you are lucky these times
378 may be quite close to each other, depending on the system).  What this
379 means is that you probably need to store the result of your first call
380 to clock(), and subtract that value from the following results of clock().
381
382 The time returned also includes the process times of the terminated
383 child processes for which wait() has been executed.  This value is
384 somewhat like the second value returned by the times() of core Perl,
385 but not necessarily identical.  Note that due to backward
386 compatibility limitations the returned value may wrap around at about
387 2147 seconds or at about 36 minutes.
388
389 =item stat
390
391 =item stat FH
392
393 =item stat EXPR
394
395 As L<perlfunc/stat> but with the access/modify/change file timestamps
396 in subsecond resolution, if the operating system and the filesystem
397 both support such timestamps.  To override the standard stat():
398
399     use Time::HiRes qw(stat);
400
401 Test for the value of &Time::HiRes::d_hires_stat to find out whether
402 the operating system supports subsecond file timestamps: a value
403 larger than zero means yes. There are unfortunately no easy
404 ways to find out whether the filesystem supports such timestamps.
405 UNIX filesystems often do; NTFS does; FAT doesn't (FAT timestamp
406 granularity is B<two> seconds).
407
408 A zero return value of &Time::HiRes::d_hires_stat means that
409 Time::HiRes::stat is a no-op passthrough for CORE::stat(),
410 and therefore the timestamps will stay integers.  The same
411 thing will happen if the filesystem does not do subsecond timestamps,
412 even if the &Time::HiRes::d_hires_stat is non-zero.
413
414 In any case do not expect nanosecond resolution, or even a microsecond
415 resolution.  Also note that the modify/access timestamps might have
416 different resolutions, and that they need not be synchronized, e.g.
417 if the operations are
418
419     write
420     stat # t1
421     read
422     stat # t2
423
424 the access time stamp from t2 need not be greater-than the modify
425 time stamp from t1: it may be equal or I<less>.
426
427 =back
428
429 =head1 EXAMPLES
430
431   use Time::HiRes qw(usleep ualarm gettimeofday tv_interval);
432
433   $microseconds = 750_000;
434   usleep($microseconds);
435
436   # signal alarm in 2.5s & every .1s thereafter
437   ualarm(2_500_000, 100_000);
438   # cancel that ualarm
439   ualarm(0);
440
441   # get seconds and microseconds since the epoch
442   ($s, $usec) = gettimeofday();
443
444   # measure elapsed time 
445   # (could also do by subtracting 2 gettimeofday return values)
446   $t0 = [gettimeofday];
447   # do bunch of stuff here
448   $t1 = [gettimeofday];
449   # do more stuff here
450   $t0_t1 = tv_interval $t0, $t1;
451
452   $elapsed = tv_interval ($t0, [gettimeofday]);
453   $elapsed = tv_interval ($t0); # equivalent code
454
455   #
456   # replacements for time, alarm and sleep that know about
457   # floating seconds
458   #
459   use Time::HiRes;
460   $now_fractions = Time::HiRes::time;
461   Time::HiRes::sleep (2.5);
462   Time::HiRes::alarm (10.6666666);
463
464   use Time::HiRes qw ( time alarm sleep );
465   $now_fractions = time;
466   sleep (2.5);
467   alarm (10.6666666);
468
469   # Arm an interval timer to go off first at 10 seconds and
470   # after that every 2.5 seconds, in process virtual time
471
472   use Time::HiRes qw ( setitimer ITIMER_VIRTUAL time );
473
474   $SIG{VTALRM} = sub { print time, "\n" };
475   setitimer(ITIMER_VIRTUAL, 10, 2.5);
476
477   use Time::HiRes qw( clock_gettime clock_getres CLOCK_REALTIME );
478   # Read the POSIX high resolution timer.
479   my $high = clock_getres(CLOCK_REALTIME);
480   # But how accurate we can be, really?
481   my $reso = clock_getres(CLOCK_REALTIME);
482
483   use Time::HiRes qw( clock_nanosleep TIMER_ABSTIME );
484   clock_nanosleep(CLOCK_REALTIME, 1e6);
485   clock_nanosleep(CLOCK_REALTIME, 2e9, TIMER_ABSTIME);
486
487   use Time::HiRes qw( clock );
488   my $clock0 = clock();
489   ... # Do something.
490   my $clock1 = clock();
491   my $clockd = $clock1 - $clock0;
492
493   use Time::HiRes qw( stat );
494   my ($atime, $mtime, $ctime) = (stat("istics"))[8, 9, 10];
495
496 =head1 C API
497
498 In addition to the perl API described above, a C API is available for
499 extension writers.  The following C functions are available in the
500 modglobal hash:
501
502   name             C prototype
503   ---------------  ----------------------
504   Time::NVtime     double (*)()
505   Time::U2time     void (*)(pTHX_ UV ret[2])
506
507 Both functions return equivalent information (like C<gettimeofday>)
508 but with different representations.  The names C<NVtime> and C<U2time>
509 were selected mainly because they are operating system independent.
510 (C<gettimeofday> is Unix-centric, though some platforms like Win32 and
511 VMS have emulations for it.)
512
513 Here is an example of using C<NVtime> from C:
514
515   double (*myNVtime)(); /* Returns -1 on failure. */
516   SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0);
517   if (!svp)         croak("Time::HiRes is required");
518   if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer");
519   myNVtime = INT2PTR(double(*)(), SvIV(*svp));
520   printf("The current time is: %f\n", (*myNVtime)());
521
522 =head1 DIAGNOSTICS
523
524 =head2 useconds or interval more than ...
525
526 In ualarm() you tried to use number of microseconds or interval (also
527 in microseconds) more than 1_000_000 and setitimer() is not available
528 in your system to emulate that case.
529
530 =head2 negative time not invented yet
531
532 You tried to use a negative time argument.
533
534 =head2 internal error: useconds < 0 (unsigned ... signed ...)
535
536 Something went horribly wrong-- the number of microseconds that cannot
537 become negative just became negative.  Maybe your compiler is broken?
538
539 =head2 useconds or uinterval equal to or more than 1000000
540
541 In some platforms it is not possible to get an alarm with subsecond
542 resolution and later than one second.
543
544 =head2 unimplemented in this platform
545
546 Some calls simply aren't available, real or emulated, on every platform.
547
548 =head1 CAVEATS
549
550 Notice that the core C<time()> maybe rounding rather than truncating.
551 What this means is that the core C<time()> may be reporting the time
552 as one second later than C<gettimeofday()> and C<Time::HiRes::time()>.
553
554 Adjusting the system clock (either manually or by services like ntp)
555 may cause problems, especially for long running programs that assume
556 a monotonously increasing time (note that all platforms do not adjust
557 time as gracefully as UNIX ntp does).  For example in Win32 (and derived
558 platforms like Cygwin and MinGW) the Time::HiRes::time() may temporarily
559 drift off from the system clock (and the original time())  by up to 0.5
560 seconds. Time::HiRes will notice this eventually and recalibrate.
561 Note that since Time::HiRes 1.77 the clock_gettime(CLOCK_MONOTONIC)
562 might help in this (in case your system supports CLOCK_MONOTONIC).
563
564 Some systems have APIs but not implementations: for example QNX and Haiku
565 have the interval timer APIs but not the functionality.
566
567 =head1 SEE ALSO
568
569 Perl modules L<BSD::Resource>, L<Time::TAI64>.
570
571 Your system documentation for C<clock>, C<clock_gettime>,
572 C<clock_getres>, C<clock_nanosleep>, C<clock_settime>, C<getitimer>,
573 C<gettimeofday>, C<setitimer>, C<sleep>, C<stat>, C<ualarm>.
574
575 =head1 AUTHORS
576
577 D. Wegscheid <wegscd@whirlpool.com>
578 R. Schertler <roderick@argon.org>
579 J. Hietaniemi <jhi@iki.fi>
580 G. Aas <gisle@aas.no>
581
582 =head1 COPYRIGHT AND LICENSE
583
584 Copyright (c) 1996-2002 Douglas E. Wegscheid.  All rights reserved.
585
586 Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Jarkko Hietaniemi.
587 All rights reserved.
588
589 Copyright (C) 2011, 2012 Andrew Main (Zefram) <zefram@fysh.org>
590
591 This program is free software; you can redistribute it and/or modify
592 it under the same terms as Perl itself.
593
594 =cut