[13431] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 841 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 18 11:07:22 1999

Date: Sat, 18 Sep 1999 08:05:08 -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: <937667108-v9-i841@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 18 Sep 1999     Volume: 9 Number: 841

Today's topics:
    Re: $ENV{'REMOTE_USER'}; under Win32 (Kragen Sitaker)
    Re: Case insensitive SQL query makau@multimania.com
    Re: Checking for Modules in Perl (Kragen Sitaker)
        Does Larry Wall ever post here? makau@multimania.com
    Re: Encrypting (and decrypting) password (Kragen Sitaker)
    Re: Encrypting (and decrypting) password <jkline@one.net>
    Re: Encrypting (and decrypting) password (Kragen Sitaker)
    Re: Error in "Learning Perl, 2nd Edition" or Error in P (Kragen Sitaker)
    Re: Error in "Learning Perl, 2nd Edition" or Error in P (Larry Rosler)
        Help! (writing cgi/pearl/sendmail program) raynew@my-deja.com
    Re: Lambda calculus stuff in Perl (Kragen Sitaker)
    Re: List files in a dir <tchrist@mox.perl.com>
    Re: make in Windows 98 (Kragen Sitaker)
    Re: Making and using a DB. (Help!!!) <mattking@techie.com>
        Perl and Microsoft SQL Server? <jmulder@localhost.nl>
    Re: Perl Challenge <michael@shoebox.net>
    Re: Perl Challenge (elephant)
    Re: Perl Module for MS Access? <gellyfish@gellyfish.com>
    Re: Problem with XS and MakeMaker (Win98) <randy@theory.uwinnipeg.ca>
    Re: site search script <tech@tburg.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 18 Sep 1999 14:41:00 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: $ENV{'REMOTE_USER'}; under Win32
Message-Id: <0wNE3.18377$N77.1377183@typ11.nn.bcandid.com>

In article <Pine.HPP.3.95a.990918120503.12783A-100000@hpplus03.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On Sat, 18 Sep 1999, Kragen Sitaker wrote:
>>  You can try using ident.
>
>To someone who may be unfamiliar with the usenet meaning of "try", that
>answer seems a bit unfair.

It's the only answer to what I think his question was, insufficient as
it usually is.

>  An ident request, if it returns anything at
>all (which in my experience it usually won't, in a WWW context as I
>assume is the reference frame here)

It may, by the way, take a long time to return nothing at all -- a
few minutes -- if your victim^Wuser is behind a packet filter.

> returns a token, that sometimes
>might be a login identifier and sometimes something else (some of the
>machines that I manage return an encrypted string).  In the cases where
>the answer happens to look like a login identifier, there is absolutely
>no way to determine whether it's accurate or not. 

Right.  All you can know is that it's what 'root' on that machine wants
you to think the login name is.

By the way: can you even use ident from CGI?  Do you have a filehandle
open to the socket that you can getpeername() on?  Otherwise, you may
have a heck of a time telling the remote identd what connection you're
interested in.

>And so, as usual when anyone says "you can try" on usenet, it may mean
>something like "feel free to waste your time messing around with it, but
>it won't really work".

Heh :)  Yes, that's basically what I meant.  Otherwise I would have
said, "Use identd."

Well, it might work, depending on who his clients are and how they have
set up identd.  If they're all IRC operators from EFNet, who often have
identd set up to return real login names, it might work perfectly :)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 13:20:45 GMT
From: makau@multimania.com
Subject: Re: Case insensitive SQL query
Message-Id: <7s03j8$vi$1@nnrp1.deja.com>


> 2417 unread messages in comp.lang.perl.misc--read now [y/n]?
> The more the regulars get sucked into answer non-Perl questions,
> _to_which_better_resources_exist_elsewhere_, the less time they have
> to help people with Perl.

Agreed!
Wouldn't have said it better myself.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Sat, 18 Sep 1999 14:43:43 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Checking for Modules in Perl
Message-Id: <zyNE3.18379$N77.1377560@typ11.nn.bcandid.com>

In article <37E2F50C.E67DBB77@rochester.rr.com>,
Bob Walton  <bwalton@rochester.rr.com> wrote:
>Craig Vincent wrote:
>> Is there a way to have Perl check to see if particular modules are installed
>> without doing an exist check in the standard library directories?
>
>perl -Mmodulename

But that works by doing an exist check in the standard library directories.

From inside perl, you could also try eval { require "Bob.pm" } -- I
think.  I could be wrong about this.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 14:54:49 GMT
From: makau@multimania.com
Subject: Does Larry Wall ever post here?
Message-Id: <7s093m$4fv$1@nnrp1.deja.com>

I have seen Randal and Tom's posts in this newsgroup but never Larry's.

Does he ever post here? (just curious :O)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Sat, 18 Sep 1999 14:30:52 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Encrypting (and decrypting) password
Message-Id: <wmNE3.18366$N77.1375951@typ11.nn.bcandid.com>

In article <37E2E0B9.BF23E68@ingress.com>,
Ethan H. Poole <ehpoole@ingress.com> wrote:
>To try and do
>this on the client (browser) side would require the use of JavaScript and
>essentially nullify the value of the encryption altogether . . .
>Further, trying to encrypt browser
>side means the browser will have the very key necessary to decrypt, thus
>erasing your limited 'nuisance' resistance.

Remember, the use of the encryption here is so the user doesn't see
that he's sending back login and password in the URL.  He's not trying
to keep any secrets from the user, or from anybody else snooping the
connection.

>You are not limited to an 8 bit XOR encryption function.  You can create
>an encryption key of most any length (though sticking to multiples of 8
>bits will make your life simpler for obvious reasons).  You then
>encode/decode the string in blocks of however many bits/bytes your key
>is.  So a 40-bit key (5 bytes) would process 5 bytes of the string at a
>time, strings less than 5 bytes are padded with a known character to be
>chopped off during the decode routine (or you can store the length of the
>string and truncate anything beyond that length).

Yes, this is a reasonable idea.

>  To improve security,
>you can add the value of a corresponding byte (from the private unencoded
>string) from the previous block and add it to the current key byte
>(assuming you XOR the data block and the key block one byte at a time) and
>take the modulus of the two and XOR that with the data byte.

Improving security is a bit of a moot point.  If he wanted security, he
wouldn't be using XOR with predictable bit strings.  He'd be using real
cryptography.

>  This makes
>each block a partial product of the previous block and helps reduce the
>chance that a dictionary attack will prove fruitful (if you truly do
>independent blocks then it becomes fairly trivial to observe patterns in a
>data stream of sufficient length or blocks with sufficiently little
>entropy).

It's still fairly trivial, I think.  Dictionary attacks are moot; it's
trivial to figure the encryption algorithm and key out from two known
plaintexts here.

>You could do something such as that.  One simple method would be to take
>the value of time() (i.e. seconds since 1970) and subtracting (or adding)
>some arbitrary value to it.  The actual arbitrary value is stored in your
>script, and, if the script is properly secured, is likely 'secure enough'
>for what you propose (e.g. a scenerio where there is a little value to a
>break-in and worst-case damage would be embarassment with little or no
>financial risk at stake).  By decoding this value and adding back your
>'correction factor' you can add simple expiratory capability to your
>script (expire a sessionid which has been idle for a period of time).

Actually, time() is seconds since 1969.

It should be noted that you'll have to include in the URL (or remember
by some other method) which value of time() you're using.

It is no longer obvious to me how to crack the method you're proposing,
but I have a strong hunch that it is utterly trivial to a real
cryptographer.

>Now, if we were discussing the storage of 'sensitive' data, such as credit
>card info, you would want to use (at a minimum) a public-key encryption
>method.

You would want to use (at a minimum) a strong encryption method.
"public-key encryption" is not a level of strength.  It is an attribute
of certain encryption algorithms: the key used to encrypt is not the
key used to decrypt.

There are insecure public-key encryption algorithms, too, like
Hellman-Merkle.  You wouldn't want to use one of those.

>  The script would encode everything with its stored public key
>while you retain the private key in a secure location and supply it to the
>script only when you have a screen that needs to have the data decrypted.

That is probably a good idea, if it is feasible.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 10:48:34 -0400
From: Joe Kline <jkline@one.net>
Subject: Re: Encrypting (and decrypting) password
Message-Id: <37E3A642.482A3274@one.net>



Kragen Sitaker wrote:
> 
> In article <37E2E0B9.BF23E68@ingress.com>,
> Ethan H. Poole <ehpoole@ingress.com> wrote:
> >To try and do

<SNIP>

> >You could do something such as that.  One simple method would be to take
> >the value of time() (i.e. seconds since 1970) and subtracting (or adding)

<SNIP>

> Actually, time() is seconds since 1969.

From perlfunc:
-------------
time 
    Returns the number of non-leap seconds since whatever time the
system considers to be the epoch (that's 00:00:00, January 1, 1904 for
MacOS, and 00:00:00 UTC, January 1, 1970 for most other systems).
Suitable for feeding to gmtime() and localtime().
-------------

joe


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Sat, 18 Sep 1999 14:50:39 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Encrypting (and decrypting) password
Message-Id: <3FNE3.18384$N77.1375612@typ11.nn.bcandid.com>

In article <37E3A642.482A3274@one.net>, Joe Kline  <jkline@one.net> wrote:
>> Actually, time() is seconds since 1969.
>
>time 
>    Returns the number of non-leap seconds since whatever time the
>system considers to be the epoch (that's 00:00:00, January 1, 1904 for
>MacOS, and 00:00:00 UTC, January 1, 1970 for most other systems).
>Suitable for feeding to gmtime() and localtime().

Oops.  So it's either seconds since 1903, local time, or seconds since
1969, UTC.  Sorry.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 14:11:00 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Error in "Learning Perl, 2nd Edition" or Error in Perl port specific to Windows or ?
Message-Id: <U3NE3.18336$N77.1373609@typ11.nn.bcandid.com>

In article <x7r9jwa2s8.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>in a known context (which this is) that is fine. i am not saying it is
>good in all cases. and you are losing track of my original point of
>using each before the sort. you can handle the boundary conditions any
>way you wish if you know the data range.

You can also handle them if you don't know the data range.

$key =~ s/\002/\002\004/g;
$key =~ s/\001/\002\003/g;
$key =~ s/\000/\002\002/g;
push @whatever, "$key\001 has value $value\n";

(You can simplify this if it's OK to print out nulls.)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 07:46:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Error in "Learning Perl, 2nd Edition" or Error in Perl port specific to Windows or ?
Message-Id: <MPG.124d459d5996ce74989f9a@nntp.hpl.hp.com>

In article <x7r9jwa2s8.fsf@home.sysarch.com> on 18 Sep 1999 07:15:51 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
> 
>   BL> Uri Guttman wrote:
>   >> i would assume the user of such a sophisticated trick would know to not
>   >> use the same char in the keys as is used to separate them from the rest
>   >> of the printed string. a simple fix for your example would be to
>   >> surround the key in the string with some quotes or other chars not in
>   >> the key.
> 
>   BL> No. The problem is that you assume that space, the first caharacter in
>   BL> what you add, sorts before any character that may be in the string.
> 
> in a known context (which this is) that is fine. i am not saying it is
> good in all cases. and you are losing track of my original point of
> using each before the sort. you can handle the boundary conditions any
> way you wish if you know the data range. i am not making global
> assumptions here. e.g. a local context is the ENV case where the keys
> cannot contain = (a known restriction) so you can assume things will
> sort fine.

To respond more directly to Bart's criticism about the assumption that 
'space' sorts before any character that may be in the string:

That is likely to be a robust assumption, because the only characters 
that sort below 'space' are control characters.  If the programmer knows 
enough about the characteristics of the data to know that they contain 
no control characters, there can't be a problem.

Calling this 'a bug waiting to happen' is the same kind of Puritan 
argument Benjamin Franz has been pushing about *always* using four-digit 
years.  As responsible programmers, we should be free to introduce (and 
to document) efficiencies based on knowledge of the data.

This freedom underlies our use of the null character "\0" to separate 
variable-length sortkeys in the packed sort.  If there might be null 
characters in the data, use a different approach; the null separator is 
easier and faster.

Please save the straitjackets for where they are needed.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Sat, 18 Sep 1999 12:27:12 GMT
From: raynew@my-deja.com
Subject: Help! (writing cgi/pearl/sendmail program)
Message-Id: <7s00es$v45$1@nnrp1.deja.com>

I also need help with  writing  a cgi/pearl/sendmail program
to take a mail sent to my domain like xxx.yyy.zzz@mydomain.com
keeping the:

Subject:

and

body of message

as is and resend any attachments

BUT

Reply-To:

and

From:

change to myname@mydomain.com

and send it to: xxx@yyy.zzz

(using my host  smtp server via sendmail)

I would even be willing to pay.
Everybody says it is simple.
But not for me,
Thanks,
Ray




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Sat, 18 Sep 1999 14:52:00 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Lambda calculus stuff in Perl
Message-Id: <kGNE3.18385$N77.1377445@typ11.nn.bcandid.com>

In article <37E2F84B.528EAFF0@home.com>,
Rick Delaney  <rick.delaney@home.com> wrote:
>That's not the canonical form for a quadratic.
>
>    0 = V + (L - 1)X + AX^2

Thanks!  I am infinitely grateful.

>Looks like it will stop.  :-)

Yep.  I'll take the time, when I have some, to figure out which values
of the parameters will make it not stop.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: 18 Sep 1999 06:50:55 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: List files in a dir
Message-Id: <37e38aaf@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, lee.lindley@bigfoot.com writes:
:If this is truly a common idiom, please point me to additional
:reading material.

It is.  And I shall.

--tom

% man perlfaq4
 ....

  How do I expand function calls in a string?

    This is documented in the perlref manpage. In general, this is
    fraught with quoting and readability problems, but it is
    possible. To interpolate a subroutine call (in list context)
    into a string:

        print "My sub returned @{[mysub(1,2,3)]} that time.\n";

    If you prefer scalar context, similar chicanery is also useful
    for arbitrary expressions:

        print "That yields ${\($n + 5)} widgets\n";

    Version 5.004 of Perl had a bug that gave list context to the
    expression in `${...}', but this is fixed in version 5.005.

    See also ``How can I expand variables in text strings?'' in
    this section of the FAQ.


% man perlref
 ....

       Here's a trick for interpolating a subroutine call into a
       string:

           print "My sub returned @{[mysub(1,2,3)]} that time.\n";

       The way it works is that when the @{...} is seen in the
       double-quoted string, it's evaluated as a block.  The
       block creates a reference to an anonymous array containing
       the results of the call to mysub(1,2,3).  So the whole
       block returns a reference to an array, which is then
       dereferenced by @{...} and stuck into the double-quoted
       string. This chicanery is also useful for arbitrary
       expressions:

           print "That yields @{[$n + 5]} widgets\n";


From the Fourth Chapter in the Book of the Camel:

    Here's a trick for interpolating the value of a subroutine call into
    a string:

	print "My sub returned @{[ mysub(1,2,3) ]} that time.\n";

    It works like this.  At compile time, when the @{...} is seen within
    the double-quoted string, it's parsed as a block that will return
    a reference.  Within the block, there are square brackets that will
    create a reference to an anonymous array from whatever is in the
    brackets.  So at runtime, mysub(1,2,3) is called, and the results
    are loaded into an anonymous array, a reference to which is then
    returned within the block.  That array reference is then immediately
    dereferenced by the surrounding @{...}, and the array value is
    interpolated into the double-quoted string just as an ordinary array
    would be.  This chicanery is also useful for arbitrary expressions:

	print "That yields @{[ $n + 5 ]} widgets\n";

    Be careful though.  The inside of the square brackets is supplying
    a list context to its expression.  In this case it doesn't matter,
    although it's possible that the above call to mysub() might care.
    When it does matter, a similar trick can be done with a scalar
    reference.  It just isn't quite as pretty:

	print "That yields ${ \($n + 5) } widgets.";


From the First Chapter in the Book of the Ram:

  Interpolating Functions and Expressions within Strings

  Problem

    You want a function call or expression to expand within a
    string. This lets you construct more complex templates than
    with simple scalar variable interpolation.

  Solution

    You can break up your expression into distinct concatenated
    pieces:

        $ANSWER = $VAR1 . func() . $VAR2;   # scalar only

    Or you can use the slightly sneaky `@{[ LIST EXPR ]}' or `${
    \(SCALAR EXPR ) }' expansions:

        $ANSWER = "STRING @{[ LIST EXPR ]} MORE STRING";
        $ANSWER = "STRING ${\( SCALAR EXPR )} MORE STRING";

  Discussion

    This code shows the two techniques in action. The first line
    shows concatenation, while the second shows the expansion
    trick:

        $phrase = "I have " . ($n + 1) . " guanacos.";
        $phrase = "I have ${\($n + 1)} guanacos.";

    The first technique builds the final string by concatenating
    smaller strings, avoiding interpolation but achieving the same
    end. Because `print' effectively concatenates its entire
    argument list, if we were going to `print $phrase', we could
    have just said:

        print "I have ",  $n + 1, " guanacos.\n";

    When you absolutely must have interpolation, you need the
    punctuation-riddled mess that is the second example from the
    Solution. Because only `@', `$', and `\' are special within
    double quotes and backquotes,[FOOTNOTE: Well, most backquotes.
    As with `m//' and `s///', the `qx()' synonym is not subject to
    double-quote expansion if its delimiter is single quotes!
    `$home = qx'echo home is $HOME';' would get the shell $HOME
    variable, not one in Perl.] the only way to force our
    arbitrary expressions to expand is by expanding a `${}' or
    `@{}' whose block contains a reference.

    You can do more than simply assign to a variable after
    interpolation. It's a general-purpose mechanism that can be
    used in any double-quoted string. For instance, this shows how
    you can build a string with an interpolated expression and
    pass the result to a function:

        some_func("What you want is @{[ split /:/, $rec ]} items");

    You can interpolate into a here document. This example shows
    how:

        die "Couldn't send mail" unless send_mail(<<"EOTEXT", $target);
        To: $naughty
        From: Your Bank
        Cc: @{ get_manager_list($naughty) }
        Date: @{[ my $now = `date`; chomp $now; $now ]} (today)

        Dear $naughty,

        Today, you bounced check number @{[ 500 + int rand(100) ]} to us.
        Your account is now closed.

        Sincerely,
        the management
        EOTEXT

    Expanding backquotes (``) is particularly challenging,
    because you would normally end up with spurious newlines. By
    creating a braced block following the `@' within the `@{[]}'
    anonymous array dereference, as we did in the last example,
    you can create private variables.

    Although these techniques work, it's almost always clearer and
    easier on the reader to simply break your work up into several
    steps or store everything in temporary variables.

    In version 5.004 of Perl, `${\ EXPR }' wrongly evaluates
    `EXPR' in list instead of scalar context. This bug is fixed in
    version 5.005.

-- 
    echo "Your stdio isn't very std."
            --Larry Wall in Configure from the perl distribution


------------------------------

Date: Sat, 18 Sep 1999 14:49:24 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: make in Windows 98
Message-Id: <UDNE3.18381$N77.1377942@typ11.nn.bcandid.com>

In article <MPG.124de6894c25a19d989cd1@news-server>,
elephant <elephant@squirrelgroup.com> wrote:
>NB: some modules also require a compiler .. unfortunately for you - you 
>can't get those for free on Microsoft OSs

Actually, you can get gcc for Win32.  I don't know how well it works
with ActiveWare Perl.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Fri Sep 17 1999
52 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Sat, 18 Sep 1999 15:27:53 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Making and using a DB. (Help!!!)
Message-Id: <7s01u0$ahu$1@news.uk.ibm.com>

OK. I have the package and I have installed it, and have it working. All the
changes have been made to the scripts so that the new format will be read
and written. The problems I was having with the SDBM_File are not present
here (i.e. all the data is now showing up). The file sizes have increased
greatly, but that no problem (perhaps that is the problem with the SDBM_File
though). This still leaves me with a couple of questions:

1. Are there any problems is 'gotchas' I need to be aware of with this DB
system? (PPM reports "DB_File [1.67]: Perl5 access to Berkeley DB version
1.x" when running a 'ppm info' aginst the package)

2. Are there an software products that can read (and possibly edit) these DB
files on DOS or Windowz?

Thanks,
Matt
Eric Bohlman <ebohlman@netcom.com> wrote in message
news:7rs94i$b24@dfw-ixnews6.ix.netcom.com...
> DB_File is available for ActivePerl and can be installed with PPM.





------------------------------

Date: 18 Sep 1999 12:17:12 GMT
From: Johan Mulder <jmulder@localhost.nl>
Subject: Perl and Microsoft SQL Server?
Message-Id: <7rvvs8$9gh$1@enterprise.cistron.net>

Hi there,

I found a module (DBD::FreeTDS) that seems to connect to a mssql7 
database server. But when I try to fetch data with an sql statement
it just doesn't give me anything. Am I doing something wrong or does
the module just not work?

I built the module on a FreeBSD 2.2.8 box for your information..

Here's my (bit crappy) perl program:
use DBI;
use strict;

my $DATABASE = "dmr2000";
my $PORT = "1433";
my $DBHOST = "dbserver";
my $user = "username";
my $password = "password";

my $dsn = "DBI:FreeTDS:database=$DATABASE;host=$DBHOST;port=$PORT";
my $dbh = DBI->connect($dsn, $user, $password);

my $sth = $dbh->do("SELECT * FROM tblland");

my @rs;

do {
  while (@rs = $sth->fetchrow) {
    printf "@rs\n";
    printf;
  } while ($sth->{more_results});



------------------------------

Date: 18 Sep 1999 04:58:52 -0800
From: Michael Fowler <michael@shoebox.net>
Subject: Re: Perl Challenge
Message-Id: <87hfks1ilv.fsf@beowulf.one.eth>

makau@multimania.com writes:

[snip]

> $text=~s/('|")/${{"'"=>"\\'",'"'=>'\\"'}}{$1}/eg;

[snip]


If this was an attempt at a Perl Obfuscation Contest entry, it falls
far short.  If this was a veiled question as a challenge, it's
somewhat insulting.

If it was a question

$text =~ s/(['"])/\\$1/g;

would be both faster and easier to read.

-- 


Michael
--
There isn't a mome rath alive that can outgrabe me.
--


------------------------------

Date: Sun, 19 Sep 1999 00:46:11 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Perl Challenge
Message-Id: <MPG.124e349d7646f32a989cd5@news-server>

makau@multimania.com writes ..
>I challenge you to tell me what this piece of cde does :-)
>
>$text=~s/('|")/${{"'"=>"\\'",'"'=>'\\"'}}{$1}/eg;
>
>I doubt you'll find out easily :)

I doubt that you have any idea about the level of perl knowledge in this 
newsgroup .. I'm certainly no guru .. but I worked out what it did AND 
how it did it very easily in - at a guess - 15 seconds .. the 
knowledgable people of the group would take roughly 10% longer than the 
time it takes them to read it

btw - the following does the same thing - only three times quicker

  $text =~ s/['"]/\\$&/g;

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: 18 Sep 1999 13:53:15 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Module for MS Access?
Message-Id: <7s05gb$1n7$1@gellyfish.btinternet.com>

In comp.lang.perl.misc jdkronicz@my-deja.com wrote:
> Hi. I am relatively new to Perl and I am looking to use
> it to develope a website with an Access Database.  I know
> there are Perl modules for databases like Sybase (Syperl)
> and Oracle (Oraperl) but I can't find one on CPAN for
> Access.  Is there one?  Should I use one of the more
> generic database modules?  How can I get more information
> and / or code examples of how to create an interface to the
> database using Perl?
> 

There are many reasons why you dont want to use MS Access in a real live
web situation - these are largely down to the fact that it is only really
desktop database and is not suitable for heavy multiuser applications.

However that said you will need to use one of DBD::ODBC (preferred if you
are going to change to a proper database later) or Win32::ODBC both of
these modules are abailable from the activestate repository using PPM.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 18 Sep 1999 08:47:38 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Problem with XS and MakeMaker (Win98)
Message-Id: <7s05kl$nom$1@canopus.cc.umanitoba.ca>


Andreas Hagelberg <tlb@algonet.se> wrote in
    message news:37E366A5.F34F8D98@algonet.se...
[...]
> Anyway, I've configured Perl to use MS Visual C++ (I've got both Borland
> and MSVC installed, but I primarily use Borland, but since Perl is
> intended to use MSVC I thought it best to use that one). But still
> there's problems. Now I get the following message:
[..]
> C:\program\Perl\lib\CORE\win32.h(59) : fatal error C1083: Cannot open
> include file: 'windows.h': No such file or directory
>
> Obviously MakeMaker can't find the MSVC's include-directory and
> windows.h. I've looked in and searched Config.pm for a line that tells
> MakeMaker where to find all includes, but I can't seem to find it. I've
> tried to change 'incpath', 'libpth', 'locinpth', 'loclibpth' and some
> others, but nothing.
[...]
Hi,
   For me, it was enough to change libpth and incpath. Before
building the module, did you run a script called Vcvars32.bat,
in something like \Vstudio\VC98\Bin? That sets up some
environment variables VC++ likes.

best regards,
Randy Kobes





------------------------------

Date: Sat, 18 Sep 1999 09:12:18 -0400
From: "Robert W. Byrd" <tech@tburg.net>
Subject: Re: site search script
Message-Id: <37E38FB2.7DABD068@tburg.net>

James William Carlson wrote:
> 
> Hello,
> 
> I have a site that I would like to index and search. I've looked around a
> bit, but I haven't found a script that meets my needs. That is, because a
> number of my pages are database driven, an indexer that simply analyzes
> the static HTML won't do me any good. I need an indexing script that
> creates a real http spider, to properly invoke my pages.  Has any one
> seen/used such a script? I suppose that I could write one myself (a
> mediocre one, that is) but time doesn't permit it, and I'd rather not
> reinvent the wheel.
> Any suggestions would be greately appreciated.
> 
> Thanks,
> 
> Jim

Check on Freshmeat (www.freshmeat.net). I'm almost certain I saw
something
there that will do what you are looking for.

 .rob.

-- 
Robert W. Byrd | Completely Computer Friendly
tech@tburg.net | 67-B Oxford St., Tillsonburg, ON CA N4G 2G3
------------------------------------------------------------
We are dyslexic of Borg; prepare to have your ass laminated.


------------------------------

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 841
*************************************


home help back first fref pref prev next nref lref last post