Returning specific data from a webpage?

A

Anno Siegel

A. Sinan Unur said:
The OP might be on Windows where the case insensitive nature of the
operating system can play nasty tricks on the unsuspecting individual.
Indeed:

D:\Home\asu1> cat ttt.pl
#!/usr/bin/perl

use Strict;
use Warnings;

Same for Mac (OS X or earlier), at least when run on a case-insensitive
file system.

At first sight it looks pretty harmless, after all Perl finds the
intended module, so all is fine. However, a potential import()
method in the module will *not* be found because Perl looks for
->Warnings::import (in the case of "warnings"), where case matters.
This doesn't lead to an error message either (only if parameters were
given).

So the module *has* been loaded, but then some things the code expects
to be done have *not* been done. The resulting situation can be very
confusing.

Anno
 
A

axel

A. Sinan Unur said:
The OP might be on Windows where the case insensitive nature of the
operating system can play nasty tricks on the unsuspecting individual.

It can happen on a MAC OS X HFS+ system as well, with some nasty side effects...

#!/usr/bin/perl

use Strict; # sic!
use Warnings; # sic!

$pi = 3.14159;
printf ("Pi is %0.2f \n", $pie);
__END__

Generates no problems with regard to the use statements.

But neither does it actually implement strict or warnings and the
above snippet will compile and run without any warnings to inform
us:

Pi is 0.00

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,933
Members
47,472
Latest member
blackwatermelon

Latest Threads

Top