[8079] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1698 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 21 21:07:51 1998

Date: Wed, 21 Jan 98 18:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 21 Jan 1998     Volume: 8 Number: 1698

Today's topics:
    Re: Basename with perl (NT) (Tad McClellan)
        Calling C from Perl <tack@ican.net>
    Re: Can anyone help me????????? <jong@mrc-lmb.cam.ac.uk>
    Re: Counting Backslashes (Tad McClellan)
    Re: crypt() vs. htpasswd - what's the diff? <neil@nsedley.dircon.co.uk-antispam>
    Re: crypt() vs. htpasswd - what's the diff? (Michael Budash)
    Re: crypt() vs. htpasswd - what's the diff? (Michael Budash)
    Re: crypt() vs. htpasswd - what's the diff? (Michael Budash)
    Re: crypt() vs. htpasswd - what's the diff? (Michael Budash)
    Re: crypt() vs. htpasswd - what's the diff? (brian d foy)
    Re: Determining file type <scriptabuser@127.0.0.1>
    Re: Determining file type (brian d foy)
    Re: FAQ too big (Was: Re: PERL forking) <dperdue@vec.net>
    Re: FORTRAN format, help! <mcohen@netaxs.com>
    Re: HTML perl scripts for Windows NT <none@nowhere.net>
    Re: HTML to MAIL <neil@nsedley.dircon.co.uk-antispam>
    Re: Logical 'and' in regex? <ptimmins@netserv.unmc.edu>
        Long integers in PERL <orinc@czech.net>
    Re: Long integers in PERL (brian d foy)
        LWP/SSLeay memory leak? (Kirby Hughes)
        perl & asp, activex <none@nowhere.net>
    Re: PERL+ODBC vs Delphi for webwork <skrishna@cisco.com>
        perl5 and Sybase dblibs <pperroud@interlog.com>
    Re: perl5 and Sybase dblibs (Martien Verbruggen)
        Trouble with a regex <mhammer@execpc.com>
    Re: Writing inetd apps in perl <vallon@pearl.fi.bear.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Jan 1998 16:09:40 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Basename with perl (NT)
Message-Id: <4nr5a6.ns8.ln@localhost>

Olivier (PAYS@FILNET.fr) wrote:
:  would like to use the same command as basename (UNIX)


Well, you can't use a Unix command on a non-Unix system.


You can do it in such a way that it will work on toys as well
as on real Operating Systems though.


use File::Basename;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 21 Jan 1998 20:08:38 -0500
From: Tack <tack@ican.net>
Subject: Calling C from Perl
Message-Id: <34C69C16.E0D501D7@ican.net>

I have (or will have, rather) a perl interpreter in my C program.  I
want to be able to execute perl scripts which can call functions
provided by the interpreter.  For example: (forgive my use of C++
comments)

// interpreter.c
// headers here ...
void MyFunc()
{
   // function perl script will call
}

void main( /* ... */ )
{
   // initialize perl interpreter 
   // run script
}

<-- snip -->

#!/usr/bin/perl
# myscript.pl
print "Calling C function MyFunc()";
&MyFunc();

<-- snip -->

Can anyone point me in the right direction and give me a few tips?  I am
very new to perl.  Please forward all replies to tack@ican.net

Thanks,
Jason "Tack"
tack@ican.net


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

Date: Wed, 21 Jan 1998 18:40:23 -0500
From: Jong <jong@mrc-lmb.cam.ac.uk>
To: seong@cse.bridgeport.edu
Subject: Re: Can anyone help me?????????
Message-Id: <34C68767.167E@mrc-lmb.cam.ac.uk>

Seong Y. Kim wrote:
> 
> Hello, whoever out there. . . . .
> 
> I am having a difficulty with programing  recursive subroutine.
> As you see this is my recursive subroutine.  It is supposed to make
> directory tree on initialized directory.  However I am having a
> difficulty to control "." and ".." dir.
> I will be really happy, if this question is solved, and i will be
> appreciated.
> Thanks. . ..
> 
> sub find_file_dir{
>     local ($locdir) = @_;
>     local (@locfile, $rdir);
>     local ($eone);
>     local (*OD);
>     chdir $locdir;
>     opendir(OD, $locdir) || die "can't open";
>     @locfile = readdir(OD);
>     foreach $eone (@locfile){
> 
>         if  (-d $eone){
>             unless ($eone == "." || $eone == ".."){


Should read  unless($eone eq '.' or $eone eq '..')

or 

unless($eone=~/^\.$/ or $eone =~/^\.\.$/)


etc,


Jong H. Park

>                 print "\n$eone\t\t:";
>                 &find_file_dir($eone);
>             }
>         }
> 
>         else {
>                 print "$eone\t";
>         }
>     }
>     chdir "..";
>     close (OD);
> 
>     print "\n";
> }

-- 

  !!!  Attention please  !!!  - Disaster struck me.

   I was burying all my emails since late Dec.

   Those were the mails to jpark@rascal.med.harvard.edu account.
    (I was forwarding all my mails to that account)

   ANY delay and silence of me during the time is due to that,
   NOT because of that I did not bother to respond.

   I feel very sorry about this.


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

Date: Wed, 21 Jan 1998 16:48:22 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Counting Backslashes
Message-Id: <mvt5a6.l49.ln@localhost>


wchrist@flagmail.wr.usgs.gov wrote:
: I am trying to search a data file and return any words that have a
: backslash(\) in them, along with a count of the number of backslashes.

[snip]

: This method works most of the time, but some words are coming back with
: the wrong count. A test run is listed below:

[snip]

: There does not appear to be any pattern to the problem; a word will have
: the wrong count while the next word (with the exact same backslash
: sequence) will be counted correctly. I have also tried using the "tr///"
: command with the same results.

: Any help will  be greatly appreciated.


A complete program that illustrates your problem will be greatly appreciated.


Seems like a small price to pay for free consulting to make it easy
for the consultant to answer the question.

Spend a few minutes to craft a complete, minimal program so that
the problem can be duplicated.

If we can't duplicate the problem, we can't be sure of the fix.

You can only hope for guesses then...



This works fine for me:

----------------------------
#!/usr/bin/perl -w
#               ^^ you should ALWAYS use this, 
#                  it complained when I ran your code...

while (defined($nline = <DATA>)) {
   chomp $nline;
   $offset = ($nline =~ s/\\/\\/g);
   print "$offset   $nline\n" if $offset;
}

__DATA__
C\%ezanne
Rup\-es
Changs\vong
Ch\uong Ch'\uol
Chr\%etien
Col\-on
Cr\:uger
Dar\%io
D'Arsonval
Daubr\%ee
de Sta\:el
Despr\%ez
Dun\%er
D\:urer
Dvor\%ak
----------------------------

outputs:

1   C\%ezanne
1   Rup\-es
1   Changs\vong
2   Ch\uong Ch'\uol
1   Chr\%etien
1   Col\-on
1   Cr\:uger
1   Dar\%io
1   Daubr\%ee
1   de Sta\:el
1   Despr\%ez
1   Dun\%er
1   D\:urer
1   Dvor\%ak


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 21 Jan 1998 23:06:29 -0000
From: "Neil Sedley" <neil@nsedley.dircon.co.uk-antispam>
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <34c67f78.0@newsread1.dircon.co.uk>

Yes you should be able to use crypt to build .htpasswd ( I do ). Check the
paths in your .htaccess file they MUST be the complete absolute path to your
 .htpasswd file NOT the server document path.

i.e. /usr/local/etc/httpd/htdocs/protected_dir/
not
/protected_dir/

which is how the server would refer to it.

Neil Sedley


Michael Budash wrote in message ...
>Hey all -
>
>Apologies if this is the wrong newsgroup, but here goes:
>
>I'm using crypt() to programmatically build an .htpasswd file based on the
>username and password passed to me from a web form script. The .htpasswd
>file is referenced by an .htaccess file in a directory (of course).
>However, when I try to view the directory's contents via a url enterd into
>a web browser, the expected authorization dialog tells me "Authorization
>Failed" after I enter the username and password.
>
>So... my question is: can I use crypt() to encrypt a password and yield
>the same results that the htpasswd command does? And if so, can I see an
>example?
>TIA -
>
>--
>Michael Budash, Owner * Michael Budash Consulting
>mbudash@sonic.net * http://www.sonic.net/~mbudash
>707-255-5371 * 707-258-7800 x7736




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

Date: Wed, 21 Jan 1998 15:22:34 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <mbudash-2101981522350001@d126.pm3.sonic.net>

In article <comdog-ya02408000R2101981741300001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

>> In article <mbudash-2101981401570001@d126.pm3.sonic.net>,
mbudash@sonic.net (Michael Budash) posted:
>> 
>> >So... my question is: can I use crypt() to encrypt a password and yield
>> >the same results that the htpasswd command does? And if so, can I see an
>> >example?
>> 
>> why not just try it and find out?  (you should discover that it 
>> yields the same results).  >> 
>> good luck :)
>> 

actually, i did, and they're different. could it be the "salt" i'm using
on the crypt() function?

>> for an example of how to use the crypt
>> function see the perlfunc man page.  remember to use the same 
>> salt in each case.

as far as the perlfunc man page, i am unfortunately laboring under a
system with no shell access, though i do have a couple workarounds.

**warning: potentially frustrating, if not stupid, question coming...

if i had a command line, what would i enter to see such a page?

tia -

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Wed, 21 Jan 1998 15:25:18 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <mbudash-2101981525180001@d126.pm3.sonic.net>

In article <34c67f78.0@newsread1.dircon.co.uk>, "Neil Sedley"
<neil@nsedley.dircon.co.uk-antispam> wrote:

>> Yes you should be able to use crypt to build .htpasswd ( I do ). Check the
>> paths in your .htaccess file they MUST be the complete absolute path to your
>> .htpasswd file NOT the server document path.
>> 
>> i.e. /usr/local/etc/httpd/htdocs/protected_dir/
>> not
>> /protected_dir/
>> 
>> which is how the server would refer to it.
>> 

hey...i think you're onto something here!...thanks, i'll try it and let you know

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Wed, 21 Jan 1998 15:34:19 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <mbudash-2101981534200001@d126.pm3.sonic.net>

In article <34c67f78.0@newsread1.dircon.co.uk>, "Neil Sedley"
<neil@nsedley.dircon.co.uk-antispam> wrote:

>> Yes you should be able to use crypt to build .htpasswd ( I do ). Check the
>> paths in your .htaccess file they MUST be the complete absolute path to your
>> .htpasswd file NOT the server document path.
>> 
>> i.e. /usr/local/etc/httpd/htdocs/protected_dir/
>> not
>> /protected_dir/
>> 
>> which is how the server would refer to it.
>> 

that did it - thanks!

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Wed, 21 Jan 1998 15:36:38 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <mbudash-2101981536390001@d126.pm3.sonic.net>

In article <comdog-ya02408000R2101981741300001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

>> In article <mbudash-2101981401570001@d126.pm3.sonic.net>,
mbudash@sonic.net (Michael Budash) posted:
>> 
>> >So... my question is: can I use crypt() to encrypt a password and yield
>> >the same results that the htpasswd command does? And if so, can I see an
>> >example?
>> 
>> why not just try it and find out?  (you should discover that it 
>> yields the same results).  for an example of how to use the crypt
>> function see the perlfunc man page.  remember to use the same 
>> salt in each case.
>> 
>> good luck :)

fyi, what i was doing wrong was _not_ using a full path in the .htaccess
file to the .htpasswd/.htgroup files. once i changed that, it worked
fine...

thanks as usual...

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Wed, 21 Jan 1998 19:02:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <comdog-ya02408000R2101981902350001@news.panix.com>
Keywords: from just another new york perl hacker

In article <mbudash-2101981522350001@d126.pm3.sonic.net>, mbudash@sonic.net (Michael Budash) posted:

>In article <comdog-ya02408000R2101981741300001@news.panix.com>,
>comdog@computerdog.com (brian d foy) wrote:
>
>>> In article <mbudash-2101981401570001@d126.pm3.sonic.net>,
>mbudash@sonic.net (Michael Budash) posted:

>>> >So... my question is: can I use crypt() to encrypt a password and yield
>>> >the same results that the htpasswd command does? And if so, can I see an
>>> >example?

>>> why not just try it and find out?  (you should discover that it 
>>> yields the same results).  >> 
>>> good luck :)

>actually, i did, and they're different. could it be the "salt" i'm using
>on the crypt() function?

are they different in the first two characters (the salt)?  check
the crypt man page for details (look on the web if need be)

>as far as the perlfunc man page, i am unfortunately laboring under a
>system with no shell access, though i do have a couple workarounds.

it's on the web too.

>if i had a command line, what would i enter to see such a page?

man perlfunc

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Wed, 21 Jan 1998 23:03:45 +0000
From: Mark Worsdall <scriptabuser@127.0.0.1>
Subject: Re: Determining file type
Message-Id: <DhC9YwAR7nx0EwyQ@worsdall.demon.co.uk>

In article <jMGlTRAHTqw0EwsN@worsdall.demon.co.uk>, Mark Worsdall
<scriptabuser@127.0.0.1> writes
>Now the program that has this file needs to work out what type of file
>it is, graphic, text, binary etc, then it will do this:-
>
>if (html or text) print "Content-type: text/html\n\n";
>if (graphic) print "Content-type: image/gif\n\n";
>(Here though I want it to display any image including jpegs etc)
>if (binary) force broswer to download

Turns out it was a damn site easier to use

print "Content-type: text/html,image/gif\n\n";
&display_file; # Read the file and print it
print "Location: $Config{'URL'}\n\n";

Seems to work!?
-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmasterATshadow.org.uk    
Home  :- shadowwebATworsdall.demon.co.uk
Any opinion given is my own personal belief...


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

Date: Wed, 21 Jan 1998 20:36:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Determining file type
Message-Id: <comdog-ya02408000R2101982036350001@news.panix.com>
Keywords: from just another new york perl hacker

In article <DhC9YwAR7nx0EwyQ@worsdall.demon.co.uk>, Mark Worsdall <hellNback@158.152.255.1> posted:

>print "Content-type: text/html,image/gif\n\n";
>&display_file; # Read the file and print it
>print "Location: $Config{'URL'}\n\n";
>
>Seems to work!?

what does that do?  what are you trying to make it do?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Wed, 21 Jan 1998 19:44:54 -0500
From: David <dperdue@vec.net>
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <34C69686.438FC05D@vec.net>

Tad McClellan wrote:
> 
> Bart Lateur (bart.mediamind@tornado.be) wrote:
> : "Kevin Hawley" <cbpkxh@arcochem.com> wrote:
> 
> : >I don't have 40 years to read the FAQ.

As a perl novice who has downloaded the FAQ, I think this is the most
absurd complaint that I have ever heard. If I want to learn, I'd welcome
the info. All of it.

Since I assume the originator of this thread is not using *nix, And I'll
assume a windows machine.

edit perl.faq
alt-s (search)
search for [search expression]
press <ENTER>

I hope this helps, --dp
If it won't load in the dos editor, almost all other word processors
have a search feature.


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

Date: Wed, 21 Jan 1998 20:14:40 -0500
From: Martin Cohen <mcohen@netaxs.com>
Subject: Re: FORTRAN format, help!
Message-Id: <34C69D80.5B0B@netaxs.com>

Charles Margolin wrote:
> 
> Ying Hu wrote:
[ skipped ]
> > FORTRAN format:
> > (A7,2X,F8.2,4X,I2,A7)
> >
> It depends on whether you want to read or write.
[ skipped ]
> For input, get each record into a scalar variable and use unpack
> with the 'A' or 'a' descriptor.  Then rely on Perl's automatic
> conversion of numeric strings into numbers.  See the format
> descriptions for pack, but be aware that the formats described
> as 'float', 'integer', etc. refer to binary data rather than
> printable strings of digits, decimal points, etc.
> 
> --
> Charles G. Margolin                   DSSD Internal Information Services
> cmargoli@world.northgrum.com          Northrop Grumman Corp. 0624/23
> margolin@acm.org                      Hawthorne, California 90250-3277

I would add one suggestion:  On input using a F8.2 (or similar) format
spec.,
I look for a decimal point in the character form of the input field.  If
there
is one, I just let the numeric conversion take place.  But, if not, then
I
divide by 100 (for Fn.2) or the scale corresponding to the number of
implied
decimal places.
-- 
Martin Cohen, 900 Valley Rd #D203, Melrose Park, PA 19027-3228,
mcohen@acm.org


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

Date: Wed, 21 Jan 1998 19:28:00 -0600
From: adam <none@nowhere.net>
Subject: Re: HTML perl scripts for Windows NT
Message-Id: <34C6A0A0.EF78293B@nowhere.net>

faq you!


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

Date: Wed, 21 Jan 1998 23:16:44 -0000
From: "Neil Sedley" <neil@nsedley.dircon.co.uk-antispam>
Subject: Re: HTML to MAIL
Message-Id: <34c681e2.0@newsread1.dircon.co.uk>

%input is an associative array, you are trying to use it in a scalar
context. You will have to access it so that it returns scalar values.

try

foreach $var ( keys( %input ) ) {
    send (S,"$var = $input{$var}\n",0);
}

Neil Sedley

PS There is nothing wrong with using cgi-lib.pl

S Newberg wrote in message <01bd26ac$6e0602c0$825f04d1@dos>...
>I am having some trouble with a lil perl script that sends contents from an
>HTML input, but I can't seem to get it to mail those contents. I can get it
>to mail, but the origonall contents I read in never show.
>
>I am a novice perl programmer and appreciate any suggestions. The output at
>the bottom is definately what I am doing wrong. I found the script and
>fixed many bugs, but can't get the origonall %input to be outputed to the
>message body of the Email message.
>
>
>####Snipped------------------
>
># get the input from the form into the associative array %input.
>&ReadParse(*input);
>
>&domail;            #try to send the mail
>
>if ($status)            #send the client an html page with
>   {
> &respond_ok;
>   }
> else
>   {
> &respond_notok;
>   }
>
>
>##snipped to output section --------------------
>
>sub sendmail
>  # talk SMTP to the mail hub. Fail if anything goes wrong.
>  #
>  # $mailfrom = email address this is from: i.e. root@domain.com
>  # $mailfromname = real name of sender: i.e. Root User
>  # $mailto = email address this is to: i.e. root2@otherdomain.com
>  # $subject = Message Subject
>  #
>  {
>#&tracein('sendmail');
>if (&get_reply()){
> send (S,"HELO localhost\n",0);
>  if (&get_reply()){
>   send (S,"MAIL FROM: <$mailfrom>\n",0);
>    if (&get_reply()){
>     send (S,"RCPT TO: <$mailto>\n",0);
>      if (&get_reply()){
>       send (S,"RCPT TO: <$postmaster>\n",0);
> if (&get_reply()){
>   send (S,"DATA\n",0);
>   send (S,"From: <$mailfrom> ($mailfromname)\n",0);
>   send (S,"Errors-To: $postmaster\n",0);
>   send (S,"Reply-To: $mailfrom\n",0);
>   send (S,"Subject: $subject\n",0);
>   send (S,"\n",0);
>   send (S,"message body\n",0);
>   send (S,%input,0); ##  THIS IS WHERE I CAN"T GET THE OUTPUT
>   send (S,"\r\n.\r\n",0);
>   }
>   if (&get_reply()){
>     send(S,"QUIT\n",0);
>     if (&get_reply())
>

>       $status = 1;
>       }
>     }
>   }
> }
>     }
>  }
>  return($status);
>  }
>
>
>




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

Date: Wed, 21 Jan 1998 10:08:10 -0600
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: Logical 'and' in regex?
Message-Id: <34C61D6A.5244@netserv.unmc.edu>

Chipmunk wrote:
> 
> Eli the Bearded wrote:
> >
> > has never seen the hip owls book in a bookstore
> 
> I bought it at Border's Bookstore in Ann Arbor.
> 
> Chipmunk

I bought it at a Barnes and Noble in Omaha ... the most important book I
purchased in all of 1997 (out of 15 or 20 technical books purchased in
the past year or so).

Patrick Timmins
U. Nebraska Medical Center


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

Date: 21 Jan 1998 21:32:48 GMT
From: Petr Barta <orinc@czech.net>
Subject: Long integers in PERL
Message-Id: <6a5pi0$vil$1@marvin.czech.net>



Hallo,
	I have a simple question (as a PERL newbie): What is the largest
usable integer in PERL? I do some computation in PERL (only adding and
distracting) and have a problems with some limit overflow. Is it possible to
declare some variables as "long integers" with extended range?

			Thanks for any help,  

- -- 
- ------------------------------------------------------
Petr Barta                              Czech-Net
tel.: +420 2 20385444 (work)            Argentinska 38
http://orin.czech.net           170 00  Praha 7
E-mail: Petr.Barta@czech.net            Czech Republic
PGP key: http://orin.czech.net/pgp.asc
- ------------------------------------------------------
P.S.: Prijimam cestinu v ISO-8859-2.



Version: 2.6.3ia
Charset: noconv

iQCVAwUBNMZpfMqJKi0u2dslAQFWegQAjA7+f6szIdNl32MBPcZ2EuKkUzYV0Ek3
qzxJd8mSrGPXOYH9cb9W2FCA0ddFN2i1WnQPhvnp7c2X4OpCPBCF8nufDbBX44Qk
GwahgFKhb70O83uiYlAj/jnlBDH1NUlcKzs4cHUjg4YfcA1UjeNyo/HpIXTZKzSW
sfdeWVF3B/E=
=XHzf
-----END PGP SIGNATURE-----


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

Date: Wed, 21 Jan 1998 19:04:54 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Long integers in PERL
Message-Id: <comdog-ya02408000R2101981904540001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6a5pi0$vil$1@marvin.czech.net>, Petr Barta <orinc@czech.net> posted:

>        I have a simple question (as a PERL newbie): What is the largest
>usable integer in PERL? I do some computation in PERL (only adding and
>distracting) and have a problems with some limit overflow. Is it possible to
>declare some variables as "long integers" with extended range?

kinda depends on the underlying architecture...

there is a big integer module somewhere on CPAN, if you want to 
use really big numbers.  remember that Perl has scalars, not number
types.

-- 
brian d foy                                  <comdog@computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: 21 Jan 1998 17:19:00 -0700
From: kirbyh@primenet.com (Kirby Hughes)
Subject: LWP/SSLeay memory leak?
Message-Id: <6a639k$ltb@nntp02.primenet.com>

The following program will eat memory until you run out.
s/https/http/ and the problem goes away.  I cannot track down the problem
so far.  Any ideas?

-Kirby

---cut----
#!/usr/local/bin/perl -w
 
use strict 'vars';
use LWP::UserAgent;
 
while (1) {
  get_http();
  sleep 2;
}
 
sub get_http {
  my ($req, $res);
  my $ua = new LWP::UserAgent;
  $ua->agent("Mozilla/3.01 (X11; I; SunOS 5.5.1 sun4m)");
  $req = new HTTP::Request GET => "https://site/";
  $res = $ua->request($req);
}


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

Date: Wed, 21 Jan 1998 19:10:49 -0600
From: adam <none@nowhere.net>
Subject: perl & asp, activex
Message-Id: <34C69C99.98A40053@nowhere.net>

does anybody know of, or can point me to, any information about using
perl with asp pages and activeX. whether asp pages can call perl, or,
this is the important issue, whether perl can talk with activex. 
	 thanks in advance


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

Date: Wed, 21 Jan 1998 17:03:41 -0800
From: sk <skrishna@cisco.com>
To: Jeffery Chow <jefferyc@unixg.ubc.ca>
Subject: Re: PERL+ODBC vs Delphi for webwork
Message-Id: <Pine.SUN.3.95.980121165858.7304A-100000@skrishna-sun.cisco.com>


As somebody already suggested, you will be able to do this with
IntraBuilder Standard ($99) or Professional (~ $300). This comes with
native drivers for Paradox. I would go with the Pro version because it is
upgraded to 1.5. You can even try it out for 30 days with IntraBuilder in
21 days book which comes with an eval copy of IB Client/Server.
-- Sridhar



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

Date: 22 Jan 1998 00:02:16 GMT
From: "Patrick Perroud" <pperroud@interlog.com>
Subject: perl5 and Sybase dblibs
Message-Id: <01bd26ca$9fb17b60$6b01a8c0@pperroud.interlog.com>

I posted an article to comp.lang.perl.misc back in Oct 97, asking if there
was a 
perl beast that could give me access to both our Sybase and Oracle db's.

I received several responses pointing me to the CPAN sites (Thank-you very 
much by the way) . I downloaded perl5.004_04-tial4, DBI-0.90, 
DBD::Oracle-0.47, DBD::Sybase-0.04
compiled, tested and installed the modules.

The only problem I have is DBD::Sybase uses ctlibs, I am running Sybase 4.x

which uses dblibs.

Oracle and perl are installed on a Sun Ent3000 running solaris 2.5.1 and 
Sybase is installed on a sun sparc running 4.1.x.

I had a look at the CPAN sites and noticed that sybperl-2.08 under MEWP 
includes modules for Sybase::DBlib, Sybase::BCP, Sybase::sybperl, 
Sybase::CTlib. The readme indicates I require perl5.002.

My question is if I get sybperl-2.08 can I install Sybase::DBlib running 
perl5.004_04-trial4 and is there anything special I need to do?

Does this use the DBI?

Thanks again,

pp.



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

Date: 22 Jan 1998 01:06:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl5 and Sybase dblibs
Message-Id: <6a6637$5h6$1@comdyn.comdyn.com.au>

In article <01bd26ca$9fb17b60$6b01a8c0@pperroud.interlog.com>,
	"Patrick Perroud" <pperroud@interlog.com> writes:

> The only problem I have is DBD::Sybase uses ctlibs, I am running Sybase 4.x
> 
> which uses dblibs.

That is indeed a problem.

> My question is if I get sybperl-2.08 can I install Sybase::DBlib running 
> perl5.004_04-trial4 and is there anything special I need to do?

You should be able to. According to the README, it supports some
versions of Sybase 4. You might want to download the module, and look
in the README file, like I did. That might be a good idea.

> Does this use the DBI?

No. it's built straight on the Sybase ct and db libraries. A big
disadvantage will be that your Oracle and Sybase code will now be
different. You can either write a DBD for Sybase that uses the DB
library, or upgrady Sybase to a version 10 or up. Otherwise, you will
not have a single interface to both databases,

You don't mention your platform, but if it's something that supports
ODBC, you might want to think about using that as an interface to your
databases (DBI also has an ODBC driver)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


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

Date: Wed, 21 Jan 1998 13:10:10 -0600
From: Mike Hammernik <mhammer@execpc.com>
Subject: Trouble with a regex
Message-Id: <6a5h0h$t6k@newsops.execpc.com>

I have a list of ip addresses that I'm trying to pull out the ones that
contain a particular range in the last digits.  A list of
192.168.120.101
192.168.116.94
192.168.133.10
192.168.121.30
etc

I would like to obtain only the group of ip address that in the last
field contain numbers from 01 to 30. expressions thatare like
192\.168\.*\.[01-39] of course match 139 as well as 39. In going through
Mastering regex book and my perl books I have been unable to find a way
to do this. I've even gone through all my copies of postings in the hope
I would find one that asked this question before,
Your time and help is greatly appreciated

Thanks
Hammer


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

Date: 21 Jan 1998 18:06:43 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Writing inetd apps in perl
Message-Id: <x6en2gpmnp8.fsf@pearl.fi.bear.com>

john -r s <johnrs@dc.net> writes:

>     $direc = (<NS>);
>     $listing = `ls $direc`;
>     print NS "$listing";
>     exit;

I thought inetd sets up STDIN/STDOUT for you.  You only need to get peer 
stuff if you want to know who you are talking to?

Have you tried:

$direc = <>;
$listing = `ls $direc`;
print NS "$listing";

?

Of course, you realize that I could ask for directory "; rm /any/file", but 
you already knew that. :-)

-- 
-Justin
vallon@bear.com


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1698
**************************************

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