Re: Header files dilemma!

2001-04-23 Thread Casey West

On Tue, Apr 24, 2001 at 09:59:46AM +1000, King, Jason wrote:
: from my experience in c.l.p.misc some people take those bibliographies as a
: disguised RTFMs .. I'd love to see it for all posts - but am afraid at how
: some beginners might interpret it

It is extremely welcome provided there is a nice description of why to
read them, or code examples that fortify the need to read them.

The ultimate goal is that people read and re-read the documentation
before asking questions.  I would hope for that even here ( note I
said hope ).

In answering questions, it is essential to consider how you can shape
and equip new commers for their coding future.  Answering to just
answer only does half the job.

-- 
Casey West



RE: Header files dilemma!

2001-04-23 Thread King, Jason

from my experience in c.l.p.misc some people take those bibliographies as a
disguised RTFMs .. I'd love to see it for all posts - but am afraid at how
some beginners might interpret it

-- 
  jason king

  No children may attend school with their breath smelling of "wild
  onions" in West Virginia. - http://dumblaws.com/


>-Original Message-
>From: Nutter, Mark [mailto:[EMAIL PROTECTED]]
>Sent: Mon 23 Apr 2001 22:51
>To: '[EMAIL PROTECTED]'
>Subject: RE: Header files dilemma!
>
>
>> I hope this helps, and don't forget to read:
>> 
>> perldoc perlmod
>> perldoc perlmodlib
>> perldoc constant
>> perldoc Exporter
>
>Ooo, a bibliography at the end of the specific advice -- 
>that's a *great*
>idea for a beginners list.  We should make that a convention :)
>



RE: Header files dilemma!

2001-04-23 Thread Nutter, Mark

> I hope this helps, and don't forget to read:
> 
> perldoc perlmod
> perldoc perlmodlib
> perldoc constant
> perldoc Exporter

Ooo, a bibliography at the end of the specific advice -- that's a *great*
idea for a beginners list.  We should make that a convention :)




Re: Header files dilemma!

2001-04-22 Thread Casey West

On Fri, Apr 20, 2001 at 07:21:26PM -0700, Benothmane, Mohamed wrote:
: I am trying to include a header file in each Perl package (files with .pm
: extension), but the constants declared in the header files are not
: recognized anymore.  The only way I found to go around this problem is
: copying the same header file with different names and then I include each
: copy with different name in each package.  Why can't I just use one header
: file and include in each package?  Any help would really be appreciated.

Mohamed,

I am a bit confused, because Perl doesn't really have "header" files.
If you would like to make a Perl module that exports constants, I can
help you with that.

The following is a module that exports PI as a constant:

package Export::Pie;

use strict;
use constant PI => 4 * atan2( 1, 1 );

require Exporter;

our @ISA = qw[ Exporter ];
our @EXPORT  = qw[ PI ]
our $VERSION = '0.01';

1;

__END__

You could then use this module (Export/Pie.pm) in a program or other
module like this:

use Export::Pie;

print "Pi is " . PI;

I hope this helps, and don't forget to read:

perldoc perlmod
perldoc perlmodlib
perldoc constant
perldoc Exporter

Enjoy!

-- 
Casey West