[19599] in Perl-Users-Digest
Perl-Users Digest, Issue: 1794 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 23 06:05:32 2001
Date: Sun, 23 Sep 2001 03:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1001239506-v10-i1794@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 23 Sep 2001 Volume: 10 Number: 1794
Today's topics:
Re: Best way to hide the perl source code.. (Tim Hammerquist)
Re: Cannot run perl scripts in Apache when file opened (AcCeSsDeNiEd)
CGI module (Chad Yoshikawa)
Re: Connecting to SQL Server <ron@savage.net.au>
Re: extra newline in s command <bwalton@rochester.rr.com>
Goto and global variables <dscarlett@REMOVETHIS.optushome.com.au>
Re: Goto and global variables <rob_13@excite.com>
Re: Goto and global variables <dscarlett@REMOVETHIS.optushome.com.au>
Re: Goto and global variables <pne-news-20010923@newton.digitalspace.net>
Re: Goto and global variables <pne-news-20010923@newton.digitalspace.net>
Re: Goto and global variables <please@no.spam>
Re: Newbie problem <yalaoui@lexbase.fr>
Re: Newbie problem tmac@transport.com
OT: Re: Schwartzian Transform problem (Tim Hammerquist)
Re: Peek and Poke on Perl? <gamtci1@mpinet.net>
Re: Peek and Poke on Perl? <ravn@thunderbear.dyndns.dk>
Re: Problem with Object Oriented Perl (Tim Hammerquist)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 23 Sep 2001 07:54:50 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Best way to hide the perl source code..
Message-Id: <slrn9qr63e.s5.tim@vegeta.ath.cx>
Me parece que Tintin <tintin@snowy.calculus> dijo:
>
> "Espen Myrland" <em@online.no> wrote in message
> news:87r8szxsp2.fsf@strand.arcanum.net...
> > Jayakumar Mundunuri <jkumar@atrenta.com> writes:
> >
> > > Hi Friends!!
> > >
> > > Can you suggest me what is the best way to hide perl source code?
> > >
> > > perl Compiler/ perlcc / perl Bite code / encrypt / perl Filter ....
> > >
> > > I heard the above names but not really attempted to use them.
> > >
> > > It would be great help if anybody guide me with some references.
> > >
> > > Thanks in advance.
> > >
> >
> > chmod 700 perl_source
>
> That's as useful as doing:
>
> chmod 000 perl_source
>
> or
>
> rm -f perl_source
>
> which is moderately secure, but not particularly useful.
Au contraire. Using 'chmod 700 ...' *I* can still use my glorious
source code that I don't want anyone to see. =) _And_ no one else
(except root and those with superuser access) can see it.
It all depends on what you want. OTOH, you are probably correct in
assuming all this is probably _not_ what the OP meant. =)
I would agree with the perlfaq answer.
--
Sometimes we can choose the path we follow.
Sometimes our choices are made for us.
And sometimes we have no choice at all.
-- Morpheus, The Sandman
------------------------------
Date: Sun, 23 Sep 2001 07:37:29 GMT
From: dillon@rm_accessdenied.darktech.org (AcCeSsDeNiEd)
Subject: Re: Cannot run perl scripts in Apache when file opened via Samba
Message-Id: <3bad902e.4418892@news.cyberway.com.sg>
On Mon, 17 Sep 2001 15:13:58 GMT, jonadab@bright.net (Jonadab the Unsightly One) wrote:
>are you using
>Notepad or something? (Repeat this mantra: "dontusenotepad")
Notepad was just one of them.
>Now, if a program opens, reads, and then closes a file
>and *then* Apache can't read it, that would have to be
>a Samba problem, I think.
I can open a file, and close it without saving it, still gives the problem.
I can even save it and close it, no joy
I think it might be a Samba problem.
But in the meantime, what I do is copy the file to my local
drive, then edit from there. Later copy it to the samba/apache network drive.
No complaints here.
To e-mail me, remove "rm_"
------------------------------
Date: Sun, 23 Sep 2001 07:32:26 GMT
From: m_010@yahoo.com (Chad Yoshikawa)
Subject: CGI module
Message-Id: <3bad8c74.22181455@enews.newsguy.com>
when i go to CPAN homepage. I saw lots of CGI modules under
Category >> World Wide Web HTML HTTP CGI >> CGI
I wonder which module people usually use to do HTTP GET / POST stuff?
there is alot :
CGI_Lite
CGI-Minimal-1.06
CGI-QuickForm-1.92 ...etc etc
I heard the CGI module ( use CGI; ) is come with standard perl
distribution, I think i should use that, since I don't have permission
to install extra perl module( e.g. CGI Lite ..etc ) on my perl
machine.
what kind of function does the CGI module has? does it have all the
functions Java Servlet API includes? like: Cookie, get Real Path,
SetHeader, get Query String .. etc etc.
But I browsed through CPAN categories but can't find a module call CGI
( use CGI; ). Where can I find documentation for this module?
thanks.
------------------------------
Date: Sun, 23 Sep 2001 12:15:50 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Connecting to SQL Server
Message-Id: <IEbr7.2260$cu4.165816@ozemail.com.au>
Jimmy
See below.
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
Jimmy <jimmyr@softhome.net> wrote in message news:453c0300.0109212201.2dc35212@posting.google.com...
> Anyone knows how to connect to SQL Server 2000 using perl modules?
> Thanks!
Tutorial 12 perhaps: http://savage.net.au/Perl-tuts-1-30.html
------------------------------
Date: Sun, 23 Sep 2001 02:33:40 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: extra newline in s command
Message-Id: <3BAD49B2.DE7AC769@rochester.rr.com>
laura fairhead wrote:
>
> On Sat, 22 Sep 2001 13:50:28 -0700, "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>
> >"laura fairhead" <laura_fairhead@my-deja.com> wrote in message
> >news:3bace3a7.94715075@news.cis.dfn.de...
...
> yes, I can't use 'chomp' because I'm working in Perl 4.
...
> The replace in the s command is interpretted as a regular
> expression and I need to just do a plain string replace.
> The /$k[$1]/ must not be interpretted as a regular expression,
> and it may have special characters in it.
>
> I've been reading as much as I can and looked at posts
> in this group but I can't find anything. Doesn't
> perl have a plain string replace function or does the
> r.h.s have to be an perl RE ?
>
> I read something here about using \Q to 'quote meta'
> but it doesn't seem to be working here. Is that another
> of the things new in Perl 5 ?
>
> All I can see at the moment is messing about with
> string splicing, using index() and then substr() to
> do it but that lookz awful really.
...
The "replacement string" in s/// is exactly what it says: a replacement
string. The string is interpolated once, but it is *not* a regex.
But...I don't know about Perl 4 -- I assume that is true for Perl 4, but
I have no way of testing that, nor docs etc. But I don't think that
would have changed between Perl 4 and Perl 5.
Your problem, though, is that the first $1 in your s/// is being
interpolated into a regex, then it is set to undef (by the regex engine,
in preparation for the pattern match), then it is set to whatever
happens in the regex (if there were no parens, nothing happens). Then
the undef result (or whatever was matched by the first set of parens in
the pattern if there were any) is being used as the subscript for @k in
the replacement string, causing the interpolation of the replacement
string to be 0000. Maybe the following would work for you:
chomp(@k=(qq[x000],<DATA>));
while(<>){
/(\d{4})/&& $1<=$#k && ($a=$1,1) && s/$1/$k[$a]/;
print;
}
__DATA__
pattern1
pattern2
pattern3
It looks like that works to me.
--
Bob Walton
------------------------------
Date: Sun, 23 Sep 2001 05:35:16 GMT
From: "David Scarlett" <dscarlett@REMOVETHIS.optushome.com.au>
Subject: Goto and global variables
Message-Id: <ower7.12876$Tv6.66631@news1.rdc1.nsw.optushome.com.au>
I've just been reading the Camel (for the 1st time) and I've got a few
questions about chapter 4.....
Firstly, just what does the "goto &NAME" call do? The description wasn't
very good, but from what I can tell, it calls a subroutine from within the
current subroutine, but when this sub finishes, instead of returning to the
sub it was called from, it returns to wherever that sub was called from. Is
this correct?
Secondly, it talks about using "our" to pull global variables into
subroutines of blocks, but how do you declare a global in the first place
(assuming use strict)? I know in C you'd just declare it outside of any
function, but there is no "main" function in PERL so how would you do it?
TiA,
David Scarlett
dscarlett@REMOVETHIS.optushome.com.au
http://www.listen.to/artifice/
http://members.optushome.com.au/dscarlett/
"If you have a thing for parentheses, then LISP is the programming language
for you!"
-My Computing Fundamentals lecturer
------------------------------
Date: Sun, 23 Sep 2001 07:05:03 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: Goto and global variables
Message-Id: <Xns91251F520953Frock13com@64.8.1.226>
David Scarlett
<news:ower7.12876$Tv6.66631@news1.rdc1.nsw.optushome.com.au>:
> but how do you declare a global in the first place
> (assuming use strict)? I know in C you'd just declare it
> outside of any function, but there is no "main" function in
> PERL so how would you do it?
You could:
use vars qw($these $be %global @vars);
The newer way is:
our (%global); # 5.6 and later I think.
Also, my $var; outside of your subs may suit your purposes.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Sun, 23 Sep 2001 07:16:20 GMT
From: "David Scarlett" <dscarlett@REMOVETHIS.optushome.com.au>
Subject: Re: Goto and global variables
Message-Id: <8%fr7.12960$Tv6.66920@news1.rdc1.nsw.optushome.com.au>
"Rob - Rock13.com" <rob_13@excite.com> wrote in message
news:Xns91251F520953Frock13com@64.8.1.226...
> David Scarlett
> <news:ower7.12876$Tv6.66631@news1.rdc1.nsw.optushome.com.au>:
>
> > but how do you declare a global in the first place
> > (assuming use strict)? I know in C you'd just declare it
> > outside of any function, but there is no "main" function in
> > PERL so how would you do it?
>
> You could:
>
> use vars qw($these $be %global @vars);
>
> The newer way is:
>
> our (%global); # 5.6 and later I think.
So using "our" outside of any blocks/functions creates a global?
>
> Also, my $var; outside of your subs may suit your purposes.
Wouldn't this give it lexical scope, so it couldn't be used in any subs or
blocks? Or does "our" when used in a sub/block pull lexical variables in
from the next lowest block?
--
David Scarlett
dscarlett@REMOVETHIS.optushome.com.au
http://www.listen.to/artifice/
http://members.optushome.com.au/dscarlett/
"Damn it, Kif, where's the little umbrella? That's what makes it a scotch on
the rocks!"
-Capt. Zapp Brannigann, Futurama
------------------------------
Date: Sun, 23 Sep 2001 10:07:05 +0200
From: Philip Newton <pne-news-20010923@newton.digitalspace.net>
Subject: Re: Goto and global variables
Message-Id: <8g5rqtgl4ti6ahablhv8v5cfl85vl8bei0@4ax.com>
On Sun, 23 Sep 2001 07:16:20 GMT, "David Scarlett"
<dscarlett@REMOVETHIS.optushome.com.au> wrote:
> "Rob - Rock13.com" <rob_13@excite.com> wrote in message
> news:Xns91251F520953Frock13com@64.8.1.226...
> > our (%global); # 5.6 and later I think.
>
> So using "our" outside of any blocks/functions creates a global?
Not really, I think. I'm not certain about the exact internal workings
of Perl, so I can't tell you when the global is "created" (when a slot
in the symbol table is created), but it doesn't really matter. You don't
need to "create" a global -- you just use it. So if you say our($foo)
inside a subroutine and assign $foo a value, then $foo has that value
from then on, globally. (Specifically, if you haven't declared a
package, it'll be $main::foo.)
You can also use $main::foo (or, equivalently, $::foo) without having to
declare anything; this works even under 'use strict'. Global variables
just spring into existence when you assign to them, just like hash
elements -- which they are, basically. (I don't know whether global
variables spring into existence when you try to *read* them; hash
elements don't, but you get undef back in either case.)
> >
> > Also, my $var; outside of your subs may suit your purposes.
>
> Wouldn't this give it lexical scope, so it couldn't be used in any subs or
> blocks?
It can be used in any subs or blocks that come after the 'my'
declaration and are in the same file. The 'my' lasts until the end of
the current block, or the end of the current file, whichever comes
first. So if you declare it outside any block, the variable will be
visible in the entire file, including any blocks and subroutines
declared in it. So people who want "global" variables often use 'my
$foo;' rather than 'use vars qw($foo);' or 'our $foo;', since
file-global is often enough for them.
An advantage of "real" global variables is that you can access them from
other files. So if you have 'our $foo;' in one file, and you then
require "otherfile.pl", then otherfile.pl can say 'our $foo;' as well
and see the same variable as your main file has. If you had used 'my
$foo;' in both cases, then there would be two different, unrelated
variables called $foo. (But if you "use Some::Module;" and
Some/Module.pm start off with 'package Some::Module;', then that file
will not be able to get at your foo with 'our $foo;', since that would
translate unqualified accesses to '$foo' into '$Some::Module::foo'
rather than '$main::foo'.)
> Or does "our" when used in a sub/block pull lexical variables in
> from the next lowest block?
Not sure what you mean, but lexical scope includes all lexically nested
scopes.
{
my $foo;
our $bar;
{
# $foo is visible inside this nested scope
# as is $bar
}
}
# $foo is not accessible here any more (out of scope)
# $bar is only accessible as $main::bar or $::bar
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sun, 23 Sep 2001 10:09:25 +0200
From: Philip Newton <pne-news-20010923@newton.digitalspace.net>
Subject: Re: Goto and global variables
Message-Id: <916rqt0ploqm3b1knnl3gf7d77lr3k2ed7@4ax.com>
On Sun, 23 Sep 2001 05:35:16 GMT, "David Scarlett"
<dscarlett@REMOVETHIS.optushome.com.au> wrote:
> Firstly, just what does the "goto &NAME" call do? The description wasn't
> very good, but from what I can tell, it calls a subroutine from within the
> current subroutine, but when this sub finishes, instead of returning to the
> sub it was called from, it returns to wherever that sub was called from. Is
> this correct?
I think so. From what I understand, it basically replaces the current
subroutine with the subroutine you called that way (a bit like an 'exec'
for subroutines), so if you're in 'sub foo' and then 'goto &bar', bar()
can't return to 'foo' because that subroutine doesn't exist on the call
stack any more; it's been replaced with 'bar'. So bar's caller is foo's
original caller.
But you probably don't have to worry about goto &NAME, since its primary
use AIUI is inside AUTOLOAD subroutines -- it's not something (sane)
people use in everyday programming.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sun, 23 Sep 2001 08:23:41 GMT
From: Andrew Cady <please@no.spam>
Subject: Re: Goto and global variables
Message-Id: <87d74i8ghb.fsf@homer.cghm>
"David Scarlett" <dscarlett@REMOVETHIS.optushome.com.au> writes:
> I've just been reading the Camel (for the 1st time) and I've got a
> few questions about chapter 4.....
>
> Firstly, just what does the "goto &NAME" call do? The description
> wasn't very good, but from what I can tell, it calls a subroutine
> from within the current subroutine, but when this sub finishes,
> instead of returning to the sub it was called from, it returns to
> wherever that sub was called from. Is this correct?
AFAIK "goto &NAME" is just like "return &NAME(@_)" except the calling
function won't show up on the call stack while in NAME. You probably
don't need it.
> Secondly, it talks about using "our" to pull global variables into
> subroutines of blocks, but how do you declare a global in the first
> place (assuming use strict)? I know in C you'd just declare it
> outside of any function, but there is no "main" function in PERL so
> how would you do it?
Same as in C -- my $var; in global scope. "our" is just like C++'s
"using". It's mainly just a convenience so you don't have to keep
typing $main:: in front of all your globals. Note that you only need
to type $main:: in front of all your variables if you're use-ing
strict vars.
------------------------------
Date: Sun, 23 Sep 2001 04:26:09 +0200
From: "Younes ALAOUI" <yalaoui@lexbase.fr>
Subject: Re: Newbie problem
Message-Id: <9ojh8o$1or$1@wanadoo.fr>
Hi,
First thanks for the answer.
I have already installed the MIME::Parser Module but the problem is that
under root all modules are located and not another user even if i re-install
the modules.
I noticed that Unix::Syslog had the same problem.
I think this could be caused by a bad environement.
But i don't know much things about it.
Can you help more plz??
Y.A.
"Laocoon" <Laocoon@eudoramail.com> a écrit dans le message news:
Xns9123EE6D85142Laocooneudoramailcom@62.153.159.134...
> "Younes ALAOUI" <yalaoui@lexbase.fr> wrote in
> news:9ogaib$s4$2@wanadoo.fr:
>
> > Hi,
> >
> > I have this error and i cannot help myself in resolving, can someone
> > help me
> >:
> >
> > Can't locate MIME/Parser/Reader.pm in @INC (@INC contains:
> > /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
> > /usr/lib/perl5/site_perl/5.6.0/i386-linux
> > /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.005
> > /usr/lib/perl5/site_perl) at
> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151. BEGIN
> > failed--compilation aborted at
> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151.
> >
> You have not installed or have not properly installed
> the MIME::Parser module.. Install the module in the right
> directory.. you can download the module from CPAN :
> http://search.cpan.org/search?mode=module&query=MIME%3A%3AParser
------------------------------
Date: Sat, 22 Sep 2001 23:47:19 -0700
From: tmac@transport.com
Subject: Re: Newbie problem
Message-Id: <3BAD8577.1E3E078E@transport.com>
--------------DB9BF4B07D884B3E5A28113E
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
You should be able to find the path with: perldoc perllocal
push @INC, <path to mod> won't work if you are using use, it will work
with require though.
You'd probably have better luck with this.
BEGIN {push @INC, <path to mod>}
use lib is better anyway.
Tim
"E.Chang" wrote:
> Please don't top-post. Put each part your reply after the text to
> which you are responding. That way readers can follow the sequence of
> the discussion. Notice how Laocoon wrote after your question, not
> before.
>
> "Younes ALAOUI" <yalaoui@lexbase.fr> wrote in
> news:9oi945$d9d$1@wanadoo.fr:
>
> [Reply moved to proper position.)
>
> > "Laocoon" <Laocoon@eudoramail.com> a écrit dans le message news:
> > Xns9123EE6D85142Laocooneudoramailcom@62.153.159.134...
> >> "Younes ALAOUI" <yalaoui@lexbase.fr> wrote in
> >> news:9ogaib$s4$2@wanadoo.fr:
> >>
> >> > Hi,
> >> >
> >> > I have this error and i cannot help myself in resolving, can
> >> > someone help me
> >> >:
> >> >
> >> > Can't locate MIME/Parser/Reader.pm in @INC (@INC contains:
> >> > /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
> >> > /usr/lib/perl5/site_perl/5.6.0/i386-linux
> >> > /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.005
> >> > /usr/lib/perl5/site_perl) at
> >> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151.
> >> > BEGIN failed--compilation aborted at
> >> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151.
> >> >
> >> You have not installed or have not properly installed
> >> the MIME::Parser module.. Install the module in the right
> >> directory.. you can download the module from CPAN :
> >> http://search.cpan.org/search?mode=module&query=MIME%3A%3AParser
> >
> > Hi,
> >
> > First thanks for the answer.
> >
> > I have already installed the MIME::Parser Module but the problem is
> > that under root all modules are located and not another user even
> > if i re-install the modules.
> >
> > I noticed that Unix::Syslog had the same problem.
> > I think this could be caused by a bad environement.
> > But i don't know much things about it.
> >
> > Can you help more plz??
>
> If the module is installed but the path to the module isn't icluded in
> @INC, you should be able to add the path to @INC. First find out
> precisely where the module is located. Then
>
> use lib <path to module>;
>
> or
>
> push @INC <path to module>;
>
> (replacing <path to module> with the appropriate string) before using
> the module.
>
> --
> EBC
--------------DB9BF4B07D884B3E5A28113E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
You should be able to find the path with: perldoc perllocal
<p>push @INC, <path to mod> won't work if you are using use, it will
work with require though.
<p>You'd probably have better luck with this.
<br>BEGIN {push @INC, <path to mod>}
<p>use lib is better anyway.
<p>Tim
<p>"E.Chang" wrote:
<blockquote TYPE=CITE>Please don't top-post. Put each part your reply
after the text to
<br>which you are responding. That way readers can follow the sequence
of
<br>the discussion. Notice how Laocoon wrote after your question,
not
<br>before.
<p>"Younes ALAOUI" <yalaoui@lexbase.fr> wrote in
<br>news:9oi945$d9d$1@wanadoo.fr:
<p>[Reply moved to proper position.)
<p>> "Laocoon" <Laocoon@eudoramail.com> a écrit dans le message
news:
<br>> Xns9123EE6D85142Laocooneudoramailcom@62.153.159.134...
<br>>> "Younes ALAOUI" <yalaoui@lexbase.fr> wrote in
<br>>> news:9ogaib$s4$2@wanadoo.fr:
<br>>>
<br>>> > Hi,
<br>>> >
<br>>> > I have this error and i cannot help myself in resolving, can
<br>>> > someone help me
<br>>> >:
<br>>> >
<br>>> > Can't locate MIME/Parser/Reader.pm in @INC (@INC contains:
<br>>> > /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
<br>>> > /usr/lib/perl5/site_perl/5.6.0/i386-linux
<br>>> > /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl/5.005
<br>>> > /usr/lib/perl5/site_perl) at
<br>>> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151.
<br>>> > BEGIN failed--compilation aborted at
<br>>> > /usr/lib/perl5/site_perl/5.6.0/MIME/Parser.pm line 151.
<br>>> >
<br>>> You have not installed or have not properly installed
<br>>> the MIME::Parser module.. Install the module in the right
<br>>> directory.. you can download the module from CPAN :
<br>>> <a href="http://search.cpan.org/search?mode=module&query=MIME%3A%3AParser">http://search.cpan.org/search?mode=module&query=MIME%3A%3AParser</a>
<br>>
<br>> Hi,
<br>>
<br>> First thanks for the answer.
<br>>
<br>> I have already installed the MIME::Parser Module but the problem
is
<br>> that under root all modules are located and not another user even
<br>> if i re-install the modules.
<br>>
<br>> I noticed that Unix::Syslog had the same problem.
<br>> I think this could be caused by a bad environement.
<br>> But i don't know much things about it.
<br>>
<br>> Can you help more plz??
<p>If the module is installed but the path to the module isn't icluded
in
<br>@INC, you should be able to add the path to @INC. First find
out
<br>precisely where the module is located. Then
<p> use lib <path to module>;
<p>or
<p> push @INC <path to module>;
<p>(replacing <path to module> with the appropriate string) before using
<br>the module.
<p>--
<br>EBC</blockquote>
</html>
--------------DB9BF4B07D884B3E5A28113E--
------------------------------
Date: Sun, 23 Sep 2001 08:16:27 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: OT: Re: Schwartzian Transform problem
Message-Id: <slrn9qr7bs.s5.tim@vegeta.ath.cx>
[ cross-post removed ]
Me parece que Bart Lateur <bart.lateur@skynet.be> dijo:
> Matt Garrish wrote:
>
> >> there
> >> haven't been a lot of Godzilla-isms around in a while - umm, that's not a
> >> problem, it's a feature!
>
> >Strange how the disappearance corresponds with the beginning of high
> >school...
Interesting point.
> Well, she claims to be an English teacher. I have no reason to doubt
> that. (Or was it professor?)
Don't forget the Corvette she bought for her daughter.
[Aug. 2, 2001]
> As all say, the real problem is Perl being a forked up child
> and not being able to con its parent into doing something,
> like turning over the keys to the 'Vette.
>
> * is chastised for buying her girl a Corvette *
>
> Least she doesn't drive mine anymore.
Of course, she doesn't actually say she bought her "daughter" or even
"child" a Corvette. She says her girl. Under Kira's strict
interpretation standards, we could pointlessy infer she's referring to
her girlfriend - in whatever sense one feels most comfortable with.
However, it is not within the scope of this ng to speculate as to a
poster's educational status nor orientation. It's just one of the many
pointless speculations that can be made in one of the many OT posts in
this ng.
--
If you do not climb, you will not fall. This is true.
But is it that bad to fail, that hard to fall?
-- Morpheus, The Sandman
------------------------------
Date: Sun, 23 Sep 2001 04:23:44 GMT
From: Gary <gamtci1@mpinet.net>
Subject: Re: Peek and Poke on Perl?
Message-Id: <3BAD6397.5244@mpinet.net>
OK, I'll change the terminology from peek and poke to
read and write. Wow, what a difference, I guess it's
no longer just an 8-bit DOS/CPM thing now...
------------------------------
Date: 23 Sep 2001 12:28:52 +0200
From: Thorbjoern Ravn Andersen <ravn@thunderbear.dyndns.dk>
Subject: Re: Peek and Poke on Perl?
Message-Id: <m2itea6w0r.fsf@thunderbear.dyndns.dk>
Gary <gamtci1@mpinet.net> writes:
> My (currently) limited knowledge of this tells me adding
> embedded C wouldn't solve this problem. Using a direct
> memory instruction should raise an exception/memory violation.
> It seems to me this code needs to be some sort of "driver" or
> registered with the OS in some way to be permitted access to
> a fixed address space (or I/O space for that matter).
If you use DOS, then there is no such protection built-in in the
operating system - all programs have full access. Third-party
software exists to add this functionality.
Such facilities require low-level support from the operating system,
so if you need this, you may want to switch to one which supports
memory protection.
Alternatively do what others did under DOS. Debug very carefully.
A reasonable solution using Perl, would be to use Inline::C to write
two routines implementing peek and poke respectively, and then call
them from your program.
--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Sun, 23 Sep 2001 08:25:05 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Problem with Object Oriented Perl
Message-Id: <slrn9qr7s5.s5.tim@vegeta.ath.cx>
Me parece que Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> dijo:
> According to Tim Hammerquist <timmy@cpan.org>:
> > Me parece que Randal L. Schwartz <merlyn@stonehenge.com> dijo:
> > > >>>>> "Thomas" == Thomas Bätzler <Thomas@Baetzler.de> writes:
>
> > > Thomas> my $class = ref( $proto ) || $proto;
>
> Randal replied in part:
>
> > > replace this with
> > >
> > > my $class = shift;
>
> Fully agreed.
>
> > Somewhat in line with your statement, I've had the following new() method
> > in my ASP::NextLink module:
> >
> > sub new {
> > my $class = shift;
> > die "Cannot call class method on an object" if ref $class;
> > ...
> > }
> >
> > This sort of verification is done inside all subs that are restricted
> > to *only* instance methods or to *only* class methods. Would you
> > consider this overkill? Or would you recommend just doc'ing them as
> > class|instance calls and let the user misuse at his/her own peril?
>
> You didn't ask me, but I'll reply anyhow :)
I should have directed it toward the group at large. My mistake. Thanks
for sharing your input anyway. :)
> I think it's good programming practice in a class where users call
> the new() method themselves. If they don't, there's no need for such
> a test, because the wrong kind of call can only happen in a buggy
> version, not in one that is delivered, right? Of course, then the
> new() method should be called _new().
This makes perfect sense. If a user is calling a method which is not
exposed, it's not a bug in the module if it doesn't work as expected?
This would be the priciple of encapsulation:
Users should use the interface provided.
If users make use of internal workings, they should not be surprised
if it breaks, since internal implementation may change so long as
the interface remains the same (assuming a good OO design).
...or so 97% of OO docs and instructors say.
> Anno
Tim
--
I would feel infinitely more comfortable in your presence if you would agree
to treat Gravity as a Law, rather than one of a number suggested options.
-- Barnabas, The Sandman
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1794
***************************************