develooper Front page | perl.beginners | Postings from February 2002

Re: use Strict/use strict (was Re: what have I...)

Thread Previous
From:
Jeff 'japhy' Pinyan
Date:
February 6, 2002 14:41
Subject:
Re: use Strict/use strict (was Re: what have I...)
Message ID:
Pine.GSO.4.21.0202061740030.612-100000@crusoe.crusoe.net
On Feb 6, Jenda Krynicky said:

>From: Jeff 'japhy' Pinyan <jeffp@crusoe.net>
>> On Feb 6, John said:
>> 
>> >#!/usr/bin/perl -w
>> >
>> >use Strict;
>> 
>> You are using Windows (sorry).  Please change that line to
>> 
>>   use strict;
>> 
>> Because Windows is case-INsensitive, 'use Strict' loads strict.pm, but
>> because Perl is case-sensitive, the effects of strict.pm are never
>> enabled.
>
>I wish perl would issue a warning if it loads the file for module 
>"Foo", doesn't find package "Foo", but finds a package "foo".
>(That is it finds only a package that differs from the requested only 
>in the case.) :-(

Guess what I did a couple months ago?  ;)  Perl 5.6.2 behaves this way.

  japhy% cat Foo.pm
  package foo;
  1;

  japhy% bleadperl -w -MFoo -e0
  Package `Foo' not found (did you use the incorrect case?).

It will raise that error if it can't find a package by the same name of
the file.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About