B
Ben
I'm still learning some of the basic element of Perl. In the
following segment,
#!/usr/bin/perl -w
use strict;
use OpenGL qw/ :all /;
use Math::Trig;
eval 'use Time::HiRes qw( gettimeofday )';
my $hasHires = !$@;
$|++;
The last two lines above, what is occurring? I don't understand the
purpose of "!$@", is it related to error handling of the previous eval
command? What's "$|++;" doing? I understand that $| is something
related to flushing piped output.
Later on in the script:
my $now = $hasHires ? gettimeofday() : time();
What's the function of "?" in this context?
Thanks,
-Ben
following segment,
#!/usr/bin/perl -w
use strict;
use OpenGL qw/ :all /;
use Math::Trig;
eval 'use Time::HiRes qw( gettimeofday )';
my $hasHires = !$@;
$|++;
The last two lines above, what is occurring? I don't understand the
purpose of "!$@", is it related to error handling of the previous eval
command? What's "$|++;" doing? I understand that $| is something
related to flushing piped output.
Later on in the script:
my $now = $hasHires ? gettimeofday() : time();
What's the function of "?" in this context?
Thanks,
-Ben