[15974] in Perl-Users-Digest
Perl-Users Digest, Issue: 3386 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 16 06:05:39 2000
Date: Fri, 16 Jun 2000 03:05:13 -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: <961149913-v9-i3386@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 16 Jun 2000 Volume: 9 Number: 3386
Today's topics:
Re: A Computer Programmers Profile (Bart Lateur)
Re: Bot for this group to auto-answer queries? (Bart Lateur)
Re: Building Perl on AIX using gcc rather than VAC++ lehmann@germany.net
Re: Computer Programmer Profile <gellyfish@gellyfish.com>
Re: Crazy enough that it might just work... (Bart Lateur)
End delimiter line <jplaux@easynet.fr>
flock() and blocking lock? (Marc Haber)
Re: Hotmail/E-mail/HTML Question <gellyfish@gellyfish.com>
How do I print out the result of a @diff ??? please. Sm <robert@chalmers.com.au>
Re: how to setuid and setgid (Villy Kruse)
https (Eric Mosley)
Re: looking for a 'diff' like comparison routine? (Abigail)
Re: looking for a 'diff' like comparison routine? (Bart Lateur)
Newbie Question: Lexical Analysis in Perl <MarkOn******@ukgateway.net>
Re: Newbie Question: Lexical Analysis in Perl (Rafael Garcia-Suarez)
Re: Newbie Question: Lexical Analysis in Perl <MarkOn******@ukgateway.net>
Re: ODBC, MSSQL and Unix <fty@mediapulse.com>
Re: Perl 5.6.0 & SCO <gellyfish@gellyfish.com>
Perl-Compiler for Windows? <meisl@amvt.tu-graz.ac.at>
Re: Perl-Compiler for Windows? (Bart Lateur)
Re: Posting Forms in IE <gedichte@lycosmail.com>
Problem spawning process on winnt <uittenb@natlab.research.philips.com>
Problems creating file <abel@inlander.es>
Re: Problems creating file <gedichte@lycosmail.com>
Problems installing perl5.6 on AIX 4.3.3 <Per.Weisteen@hydro.com>
problems with swig and/or MakeMaker <gedichte@lycosmail.com>
Random string required <nomail@hursley.ibm.com>
Re: Random string required <blah@nospam.com>
Re: Random string required (Abigail)
Re: Random string required <blah@nospam.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 16 Jun 2000 09:33:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: A Computer Programmers Profile
Message-Id: <394aecf2.2453334@news.skynet.be>
Ferk Da Jerk wrote:
>I'm sorry I was so rude.
Is this your dad or your mom speaking?
;-)
--
Bart.
------------------------------
Date: Fri, 16 Jun 2000 09:33:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Bot for this group to auto-answer queries?
Message-Id: <3949ec2f.2258516@news.skynet.be>
Jon Ericson wrote:
>What difference does it make if it's Tom Phoenix or a perl program that
>responds to poor subject lines with a standard message?
My confidence in Tom Phoenix' judgement on poor subject lines in far
higher than in the judgement of a bot. Say that the bot complains
wrongly about a poor subject line, twice a week. Wouldn't it soon become
a source of anger? "That dumb bot..."?
--
Bart.
------------------------------
Date: 16 Jun 2000 09:23:03 GMT
From: lehmann@germany.net
Subject: Re: Building Perl on AIX using gcc rather than VAC++
Message-Id: <8icrln$9sl$1@news.germany.net>
Philip Nelson <pandpATattglobal.net> wrote:
> I'm wanting to build Perl 5.6.0 on AIX using gcc rather than the IBM
> supplied compiler (which is an extra cost option which we don't
> have).
> After reading INSTALL I tried -
> sh Configure -Dcc=gcc
> but it fails - looks like specifying [aix] during the setup process
> overrides this and starts feeding the compiler the IBM C compiler
> parameters.
> Later on in the process it complains about various compile options
> not being valid and also not being able to find cc1 (which I think
> is the IBM compiler).
I ran accross the same problem with aix and I fixed two things to get
it to work, first the wrong compiler options come from the cbu file
for large files which gets them via getconf and doesn't check for
gcc. One of the options is -b64 which has a different meaning with gcc
(this causes the unable to find cc1 error, which is somewhere in
/usr/local/lib/gcc-lib/...).
By simply turning off large file support, the problems doesn't appear
(it probably also possible to fix the cbu segment in Configure, but I
didn't try that).
The second problem I got (at least with aix 4.3.2.0) is that Configure
doesn't find most library functions, this is due to a format
differences in the nm output and can be fixed by telling Configure not
the use nm to extract symbols (according to a comment in hints/aix
this problem should be fixed in aix 4.3, but apparently it is not in
the relase I have, may it works with 4.3.3).
bye, Alexander
------------------------------
Date: 16 Jun 2000 08:17:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Computer Programmer Profile
Message-Id: <8ick9p$97b$1@orpheus.gellyfish.com>
On Wed, 14 Jun 2000 14:38:39 -0700 Employer wrote:
> I am looking for information so that I may create a "profile" for
> a computer programmer.
>
48, Purple hair, keeps budgies and has a collection of Barbie dolls and
rides a trike made from a Maclaren F1, reads 'Railway News' and 'Budgie
World' and doesnt use the Internet because his mother wont let him have
a computer at home.
And the next silly question is ?
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 16 Jun 2000 09:33:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Crazy enough that it might just work...
Message-Id: <394bee6f.2834239@news.skynet.be>
Randal L. Schwartz wrote:
>Drew> I'm still awaiting proof that Tom Phoenix isn't software.
>
>If he is, I sure wonder who it is that I'm paying each month. :)
His designer?
--
Bart.
------------------------------
Date: Fri, 16 Jun 2000 09:22:50 +0200
From: Jean-Pascal Laux <jplaux@easynet.fr>
Subject: End delimiter line
Message-Id: <3949D5CA.1D60CB9E@easynet.fr>
I want to write text lines in a file using print fonction but I also
want that the en delimiter is line-feed (with no CR).
How to do it ?
Jean-Pascal Laux
------------------------------
Date: Fri, 16 Jun 2000 09:20:27 GMT
From: usenet-9947@marc-haber.de (Marc Haber)
Subject: flock() and blocking lock?
Message-Id: <3949f135@news.ivm.net>
Hi!
given the following code snippet (on a Linux system, $FHNAME pointing
to a file on a local FS):
use Fcntl qw(:DEFAULT :flock);
if( open FH, "< $FHNAME" )
{
print "trying to hget lock on $FHNAME\n";
unless( flock( FH, LOCK_EX ) )
{
# A
print "can't get lock on $FHNAME: $!";
}
else
{
print "lock acquired on $FHNAME. Freeing lock again\n";
}
flock( FH, LOCK_UN );
close(FH);
}
else
{
die "can't open $FHNAME: $!";
}
I understand the docs that the flock( FH, LOCK_EX ) call only returns
if the lock has been successfully acquired. Hence, the "unless" clause
marked A should never be executed. However, in a real environment, I
keep getting "can't get lock on <filename>: Device or resource busy"
errors.
What am I doing wrong here? Is there some kind of timeout after which
even a blocking call to flock() will return without having acquired
the lock?
Any hints will be appreciated.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: 16 Jun 2000 07:54:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Hotmail/E-mail/HTML Question
Message-Id: <8icj03$4uv$1@orpheus.gellyfish.com>
On Thu, 15 Jun 2000 13:01:23 GMT joel_ricker@my-deja.com wrote:
>
> $smtp->datasend("Content-Type: text/html");
^
I think you are missing something here.
If you must do this I would recommend that you use the module MIME::Lite
that makes doing things like this easier.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 16 Jun 2000 19:23:54 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: How do I print out the result of a @diff ??? please. Small sample code
Message-Id: <vlm25.2$zQ4.737@nsw.nnrp.telstra.net>
I wonder if anyone knows how to print out the result of this diff .
I have two simple text files I'm testing it against, which can contain
lines of anything.
But I can't find a way to print out the result ??? The docs don't mention
that part !
Thanks for all the help folks,
much appreciated.
Bob
............................
#!/usr/bin/perl
use Algorithm::Diff qw(diff LCS traverse_sequences);
open (DATAFILE1,"./textfile1.txt") ||
die "Sorry, couldn't open the text file";
open (DATAFILE2,"./textfile2.txt") ||
die "Sorry, couldn't open the text file";
@inarray1 = <DATAFILE1>;
@inarray2 = <DATAFILE2>;
#print "@inarray2\n"; #works
@diffs = diff( \@inarray1, \@inarray2 );
print "$diffs[3]\n";
close(DATAFILE1);
close(DATAFILE2);
------------------------------
Date: 16 Jun 2000 09:08:20 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: how to setuid and setgid
Message-Id: <slrn8kjrk3.pf4.vek@pharmnl.ohout.pharmapartners.nl>
On Thu, 15 Jun 2000 14:05:24 GMT, Dominic Prakash <dominic01@hotmail.com> wrote:
>Group,
>
>I am an Administrator of a particular task. (But NOT ROOT). I want to
>give certain permission to the common users to perform that task using
>perlscripts. So that they will not bug me any more for each and
>everything. The user will execute a Perlscript, and this script will
>have (-r-sr-sr-x admin) persmissions.
>
>How do I do that? Presently I am using an external C application with (-
>r-sr-sr-x 1 admin) permissions. This C application just uses setuid
>and setgid functions. How do I do that in Perl?
>
Check perlvar for the variables $< and $>. You can assign to these
variables which would have same effect as setuid and seteuid in C
programs, and of course the same restrictions apply.
mandoc perlvar for more information.
Villy
------------------------------
Date: Fri, 16 Jun 2000 09:55:03 GMT
From: ericm@iol.ie (Eric Mosley)
Subject: https
Message-Id: <XPm25.2498$QT5.27333@news.iol.ie>
How can I download a file using https (notice the s for ssl) from within a
perl program and save it to a local file.
Any pointers to modules, etc, would be appreciated greatly!
Thanks.
------------------------------
Date: 16 Jun 2000 04:34:23 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: looking for a 'diff' like comparison routine?
Message-Id: <slrn8kjqmo.kp1.abigail@alexandra.delanet.com>
Robert Chalmers (robert@chalmers.com.au) wrote on MMCDLXXXI September
MCMXCIII in <URL:news:akj25.257$vH4.4988@nsw.nnrp.telstra.net>:
,, Hi folks,
,, I need a script that will compare two text files (a) and (b) - rows of text
,, up to 80 chars each row, and print a list of the rows that appear in the
,, first file (a), that do not appear in the second file (b)
If you want diff, then, by all means, use diff.
However, what you describe above isn't diff.
,, I think its something like stepping through the first file a rwo at a time,
,, and searching for each row in the second file. If it doesn't find it, print
,, it out and skip to the next.
You aren't the first to ask this question. You aren't the second, third,
fourth, or even four thousandth person to ask this question.
It's a FAQ.
Use it.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Fri, 16 Jun 2000 09:33:13 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: looking for a 'diff' like comparison routine?
Message-Id: <394cf0f0.3475269@news.skynet.be>
Robert Chalmers wrote:
>I need a script that will compare two text files (a) and (b) - rows of text
>up to 80 chars each row, and print a list of the rows that appear in the
>first file (a), that do not appear in the second file (b)
Yup, that sounds like "diff" to me. Lucky you, there is a Perl module
available at CPAN (<http://search.cpan.org/> that implements the core. I
never used it (yet), though. The name is Algorithm::Diff or something
close.
--
Bart.
------------------------------
Date: Fri, 16 Jun 2000 10:02:45 +0100
From: "Mark Fletcher" <MarkOn******@ukgateway.net>
Subject: Newbie Question: Lexical Analysis in Perl
Message-Id: <8icqkc$d58$1@lure.pipex.net>
Hi,
Im currently doing a short project at University on Lexical Analysis and as
a newcomer to Perl I am investigating how Perl performs lexical analysis
with regards to matching regular expressions.
I was wondering if anyone out there could refer me to papers or URL's which
discuss this feature of Perl? I ve tried making a search on google but to no
effect :-(
Any help would be greatly appreciated!
Best Regards,
Mark Fletcher
Replace ****** with USENET in email address
------------------------------
Date: Fri, 16 Jun 2000 09:30:33 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Newbie Question: Lexical Analysis in Perl
Message-Id: <slrn8kjt56.aqd.garcia_suarez@rafael.kazibao.net>
Mark Fletcher wrote in comp.lang.perl.misc:
>Hi,
>
>Im currently doing a short project at University on Lexical Analysis and as
>a newcomer to Perl I am investigating how Perl performs lexical analysis
>with regards to matching regular expressions.
>
>I was wondering if anyone out there could refer me to papers or URL's which
>discuss this feature of Perl? I ve tried making a search on google but to no
>effect :-(
Basically, Perl uses NFAs to perform regexp matching.
See http://www.perl.com/pub/2000/05/p5pdigest/THISWEEK-20000528.html for a
little discussion on the regexp engine, and how to enhance it.
The perlre manpage can also help you.
The ultimate source remains perl source code ;-)
--
Rafael Garcia-Suarez
------------------------------
Date: Fri, 16 Jun 2000 10:47:02 +0100
From: "Mark Fletcher" <MarkOn******@ukgateway.net>
Subject: Re: Newbie Question: Lexical Analysis in Perl
Message-Id: <8ict7e$em6$1@lure.pipex.net>
Hi Rafael,
Thanks for the info. The material youve referred me to is exactly what Im
looking for :-)
Im still looking for as much as possible to include in my thesis so if
anyone else can come up with additional material keep sending them!
Best Regards,
Mark Fletcher
"Rafael Garcia-Suarez" <garcia_suarez@hotmail.com> wrote in message
news:slrn8kjt56.aqd.garcia_suarez@rafael.kazibao.net...
> Mark Fletcher wrote in comp.lang.perl.misc:
> >Hi,
> >
> >Im currently doing a short project at University on Lexical Analysis and
as
> >a newcomer to Perl I am investigating how Perl performs lexical analysis
> >with regards to matching regular expressions.
> >
> >I was wondering if anyone out there could refer me to papers or URL's
which
> >discuss this feature of Perl? I ve tried making a search on google but to
no
> >effect :-(
>
> Basically, Perl uses NFAs to perform regexp matching.
> See http://www.perl.com/pub/2000/05/p5pdigest/THISWEEK-20000528.html for a
> little discussion on the regexp engine, and how to enhance it.
> The perlre manpage can also help you.
> The ultimate source remains perl source code ;-)
>
> --
> Rafael Garcia-Suarez
------------------------------
Date: Thu, 15 Jun 2000 08:09:25 -0400
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: ODBC, MSSQL and Unix
Message-Id: <8iah5k$98q$1@news3.icx.net>
"Dan Wilga" <dwilgaREMOVE@mtholyoke.edu> wrote in message
news:dwilgaREMOVE-6FD47A.13285214062000@news.mtholyoke.edu...
> In article <3947B12F.4D1396D6@inu.net>, Bob Martin <bob@inu.net> wrote:
>
> > Need to use perl/DBI to talk to a MSSQL server on NT. Anyone know where
> > I can get a good (free is _very_ good) driver? Any other suggestions?
>
> That depends somewhat on what the client OS is. One source is OpenLink
> (www.openlinksw.com).
I use freeTDS (www.freetds.org) and DBD::Sybase
jay
------------------------------
Date: 16 Jun 2000 08:09:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl 5.6.0 & SCO
Message-Id: <8icjs2$7qj$1@orpheus.gellyfish.com>
On Wed, 14 Jun 2000 22:39:29 GMT Robert Young wrote:
> I compiled the 5.6.0 stable src with SCO OpenServer 5.0.5 and get to the
> "make test" part, where several errors occur. If I run the "./perl harness"
> functionality, I get a core dump. I haven't looked at the fns that didn't
> work yet. Anyone have any comments?
>
HAve you compiled 5.005.0[23] on the machine succesfully ? If not and you
are using the Openserver development kit you may need to get a patch for
the linker which fixes a bug in Dynamic Linking which Perl tickles quite
seriously - I cant remember the number of the patch properly but it is
something like RSS194 - you can get it from the SCO web site. I would be
surprised if 5.6.0 introduced any new problems for OpenServer as 5.005.03
built quite nicely after I got that fix.
I'll do a test compile on a machine at work when I get in and see what
happens.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 16 Jun 2000 09:26:35 +0200
From: Christian Meisl <meisl@amvt.tu-graz.ac.at>
Subject: Perl-Compiler for Windows?
Message-Id: <m3pupiqe6s.fsf@famvtpc59.tu-graz.ac.at>
Is there a possibility to compile a perl script for windows, in order
to run it on a machine where perl is _not_ installed?
Best regards,
Christian
--
Christian Meisl <meisl@amvt.tu-graz.ac.at> www.amft.tu-graz.ac.at
Dept. for Chemical Apparatus Design, Particle Technology and Combustion
------ The pure and simple truth is rarely pure and never simple -------
PGP fingerprint: DF48 2503 0411 F0EF 149C 851B 1EF0 72B9 78B6 034A
------------------------------
Date: Fri, 16 Jun 2000 09:49:42 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl-Compiler for Windows?
Message-Id: <3949f7ce.189436@news.skynet.be>
Christian Meisl wrote:
>Is there a possibility to compile a perl script for windows, in order
>to run it on a machine where perl is _not_ installed?
See <www.dynamicstate.com>. It's probably not actually compiled (I'd
think the script is in there as a text resource), but it ought to fit
your purpose well.
--
Bart.
------------------------------
Date: Fri, 16 Jun 2000 11:04:33 +0200
From: Johannes <gedichte@lycosmail.com>
Subject: Re: Posting Forms in IE
Message-Id: <3949EDA1.3DD2C60B@lycosmail.com>
There are tons of ways on how to do this.
A pretty simple way is to present an error page, telling the user, that he
should go back and fill out the missing values.
#/usr/bin/perl -w
use strict;
use CGI(param);
if (! param('field1')) {
send_error_page('missing filed1');
exit;
}
... # go on
sub send_error_page {
...# send a page with the error message
}
Rok Kodrun wrote:
> I'm having problems with posting a form:
> When browsing in Netscape, it works OK, but when in IE, pressing Enter
> key immediately posts the form.
> What to do?
> Is there a solution in CGI script, to go back to the form, if Enter was
> pressed or checking the fields if they are empty or something else?
> Since I'm completely new to PERL, how to check for certain fields if
> they where entered or not and go back to form?
> Please help
> Rok
------------------------------
Date: Fri, 16 Jun 2000 07:41:03 GMT
From: "Ing. R. Uittenbosch" <uittenb@natlab.research.philips.com>
Subject: Problem spawning process on winnt
Message-Id: <3949DA0F.8F99A725@natlab.research.philips.com>
Hello everybody,
The problem is as follows :
I want to start a lot of perl programs from within another one, but I do not
want to wait until the first finished to start the second and so on... On unix
it works just fine by putting it in the background, but on Winnt it keeps giving
problems.
I already tried the Win32::Process::Create method but it keeps coming back with
an error or it doesn't do anything?!?! What am i doing wrong???
The command is :
Win32::Process::Create($process,
"c:\\perl\\bin\\perl","$command",0,DETACHED_PROCESS,"$test_dir")
In the $command var are the perlprogramname and it's parameter listed.
When I put all in a batch file like :
<<< test.bat >>>
cd h:\projects\Validate\testdir
perl h:\Projects\Validate\Bin\realtest.pl parameter parameter
>>>
and start it like
Win32::Process::Create($process,"c:\test\test.bat","test.bat",0,DETACHED_PROCESS,".")
it does not give an error, but does not do anything either!!?!?!?!
Thanks
Robbert
--
Ing. R.B. Uittenbosch
Philips Research Laboratories - Semiconductors.
Building WAY2-70.
Prof. Holstlaan 4
5656 AA Eindhoven, The Netherlands
Phone : +31-(0)40-2742213
Fax : +31-(0)40-2744115
Email : uittenb@natlab.research.philips.com
------------------------------
Date: Fri, 16 Jun 2000 07:14:40 GMT
From: Abel Almazan <abel@inlander.es>
Subject: Problems creating file
Message-Id: <3949D3FE.910B3AA@inlander.es>
Hi,
I use this sentence:
open OUT,"> ../public_html/news_es.html";
and i want this to create a new file named news_es.html, and then write
on it.
But this sentence doesn't create the file if i execute the script from
browser.
If the file is created previously, then this sentence opens it and i can
write on.
What happens?? Problems of permissions??
Please answer me to my email address too. Thanx.
------------------------------
Date: Fri, 16 Jun 2000 10:02:58 +0200
From: Johannes <gedichte@lycosmail.com>
Subject: Re: Problems creating file
Message-Id: <3949DF32.4BA5C8CD@lycosmail.com>
This sound like a problem with the permissions, insert an error handling:
open OUT, "> ../public_html/news_es.html" or die "Can't create file: $!";
You can find the error messages in the error.date log file.
Abel Almazan wrote:
> Hi,
>
> I use this sentence:
>
> open OUT,"> ../public_html/news_es.html";
>
> and i want this to create a new file named news_es.html, and then write
> on it.
>
> But this sentence doesn't create the file if i execute the script from
> browser.
> If the file is created previously, then this sentence opens it and i can
> write on.
>
> What happens?? Problems of permissions??
>
> Please answer me to my email address too. Thanx.
------------------------------
Date: Fri, 16 Jun 2000 11:56:46 +0200
From: Per Weisteen <Per.Weisteen@hydro.com>
Subject: Problems installing perl5.6 on AIX 4.3.3
Message-Id: <3949F9DE.FB3EB08D@hydro.com>
Configure with default values and make seems to work ok.
Most of the tests completes ok, 99.8% or so.
I'm then trying to install DBI-1.13 but perl Makefile.PL
terminates with a core dump.
Previous version of Perl (5.005.003) worked ok.
Seems I'm getting different results evey time I'm running
'make test' ?
Using IBM C Compiler 4.3.0.0. Anyone done this with success
?
--
Per Weisteen !Internet support, Norsk Hydro !Email: Per.Weisteen@hydro.com
N-0246 Oslo, Norway !Phone: (+47) 2273 8227/ !Web: http://www.hydro.com/
------------------------------
Date: Fri, 16 Jun 2000 10:50:32 +0200
From: Johannes <gedichte@lycosmail.com>
Subject: problems with swig and/or MakeMaker
Message-Id: <3949EA58.D2FA9EA5@lycosmail.com>
I want to create a perl module for a really simple c++ library with only
one function.
This is the first time I used swig, so maybe my question is quite silly
and I just didn't understand how to use swig.
This is my header file (user_auth.hh):
class UserAuth {
public: static char* getID(char* member_name, char* password);
};
This is my swig file (user_auth.i):
%module user_auth
%{
#include user_auth.hh
%}
%include user_auth.hh
I start swig with the parameters:
swig -perl5 -c++ user_auth.i
Swig generates the following files:
user_auth.pm
user_auth_wrap.c
user_auth_wrap.doc
I missed the Makefile.pl, so I tried to create this file by my own,
inserting the following lines:
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'UserAuth',
'OBJECT' => 'user_auth.o user_auth_wrap.o'
);
Running "perl Makefile.pl", I end up with a Makefile that produced only
errors like:
make: Fatal error: Don't know how to make target `Makefile.PL'
Does anybody know what I have done wrong?
In the Makefile I found lines like:
TO_INST_PM = Makefile.pl \
lycos_user_auth.pm
How can I create the perl module?
Thanks a lot
Johannes
------------------------------
Date: Fri, 16 Jun 2000 10:15:08 +0100
From: Derek Fountain <nomail@hursley.ibm.com>
Subject: Random string required
Message-Id: <3949F01C.92FDD14D@hursley.ibm.com>
Has anyone got any suggestions for an efficient way to
create a string of random characters? I want to populate a
database with about a million random strings (to test
performance of the db search engine). Each string needs to
be between, say, 2 and 20 characters long, and contain the
basic ASCII character set characters. Quality of randomness
isn't important as long as there are no patterns which the
db indexing engine might be able to pick up on.
------------------------------
Date: Fri, 16 Jun 2000 11:22:32 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Random string required
Message-Id: <3949F1D8.B18E47A1@nospam.com>
Derek,
Derek Fountain wrote:
> Has anyone got any suggestions for an efficient way to create a
> string of random characters?
Get a big on-line book in PostScript format and read from it strings
having a random length.
Best regards,
Marco
------------------------------
Date: 16 Jun 2000 05:35:47 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Random string required
Message-Id: <slrn8kju9r.kp1.abigail@alexandra.delanet.com>
Marco Natoni (blah@nospam.com) wrote on MMCDLXXXI September MCMXCIII in
<URL:news:3949F1D8.B18E47A1@nospam.com>:
$$ Derek,
$$
$$ Derek Fountain wrote:
$$ > Has anyone got any suggestions for an efficient way to create a
$$ > string of random characters?
$$
$$ Get a big on-line book in PostScript format and read from it strings
$$ having a random length.
That of course will not pass any test for randomness. English words
and PostScript commands will appear far more often than you should
expect.
Assuming one wants strings with only printable ASCII characters,
each 2 to 20 characters long:
my $min = 2;
my $max = 20;
my $amount = 1_000_000;
my @letters1 = map {chr} 0x20 .. 0x7E;
my @letters2 = (@letters1, "");
my @strings = map {join "" =>
(map {$letters1 [rand @letters1]} 1 .. $min),
(map {$letters2 [rand @letters2]} $min + 1 .. $max)
} 1 .. $amount;
Note that the above gives far more strings of length less than 20 that
a truly random function would give.
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
------------------------------
Date: Fri, 16 Jun 2000 11:47:51 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Random string required
Message-Id: <3949F7C7.502DC573@nospam.com>
Abigail,
Abigail wrote:
>>> Has anyone got any suggestions for an efficient way to create
>>> a string of random characters?
>> Get a big on-line book in PostScript format and read from it
>> strings having a random length.
> That of course will not pass any test for randomness. English
> words and PostScript commands will appear far more often than
> you should expect.
This is right but, reading strings of random length, you can not
obtain PS commands or English words, just sequences of characters.
Instead, there are characters used more than other ones (e.g., the
space) but I do not figure if that is a so strong randomness requirement
for the OP problem: Really, databases contain characters with
frequencies related to the used language.
Best regards,
Marco
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3386
**************************************