[15874] in Perl-Users-Digest
Perl-Users Digest, Issue: 3287 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 8 06:05:30 2000
Date: Thu, 8 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: <960458713-v9-i3287@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 8 Jun 2000 Volume: 9 Number: 3287
Today's topics:
<< Problems with Net::SMTP >> <nickp@flyingpig.com>
Re: @INC <gellyfish@gellyfish.com>
Re: change priority <gellyfish@gellyfish.com>
Re: connect() timeouts in perl nobull@mail.com
Re: Crypt-DES won't compile <gellyfish@gellyfish.com>
Re: Crypt-DES won't compile <compton@unicc.org>
Re: Dynamic IP <gellyfish@gellyfish.com>
Re: E-mail-based PERL discussion group <gellyfish@gellyfish.com>
Re: exists() on sub-hash creates a key in super-hash <szhzp2@no.spam.com>
Re: Finding partial match (Csaba Raduly)
Re: General failure reading device (Win32) <gellyfish@gellyfish.com>
Re: localtime <gellyfish@gellyfish.com>
Re: Moving from Unix to NT - sending mail <blah@nospam.com>
Re: Net::Ping keeps returning 0? <gellyfish@gellyfish.com>
Re: Obtaining stats of a remote file (Philip 'Yes, that's my address' Newton)
Re: Perl and memory consumption (Andrew Johnson)
Re: perl cgi problem. thax in advance. <bill.kemp@wire2.com>
Re: perl cgi problem. thax in advance. <raphaelp@nr1webresource.com>
Re: Perl Crypt function <gellyfish@gellyfish.com>
Re: PERL DBI module to connect to MS-Access databases? <gellyfish@gellyfish.com>
Re: PERL DBI module to connect to MS-Access databases? <gellyfish@gellyfish.com>
Re: reading contents of an ASCII file (Villy Kruse)
Re: reading contents of an ASCII file (Bart Lateur)
Re: Ruby -- A better OO Perl than Perl? Python 3000 fea <gellyfish@gellyfish.com>
Re: shell command <gellyfish@gellyfish.com>
Solution needed for 'simple' task. <ra_jones@my-deja.com>
Re: String is a float... <jupepe@jyu.fi>
Re: System() & PID (Steve Leibel)
Re: Text Sorting Question <abe@ztreet.demon.nl>
Re: use DBI <gellyfish@gellyfish.com>
Re: using 'exists' in a program to test for keys in a h (Anno Siegel)
Re: using POP3 & STMP through a proxy server... <gellyfish@gellyfish.com>
Re: Variable Syntax in SQL in DBI <jupepe@jyu.fi>
Re: Variable Syntax in SQL in DBI <jupepe@jyu.fi>
Re: Where is @INC in ActiveState Perl for Win32 ??????? <founder@pege.org>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Jun 2000 10:18:21 +0100
From: Nick Porter <nickp@flyingpig.com>
Subject: << Problems with Net::SMTP >>
Message-Id: <i5oujs4187vm4e0b0jia42vo1t08m3rm1a@4ax.com>
Greetings from the confused!!
First up, I'm new to Perl so any of you out there that can't handle
newbies with dumb questions should stop reading now.
Right, I've been trying to get a little script to work that will
automagicly send me an email after it has confirmed that our daily
backup passed without a hitch.
I've got the .log parser part sorted out okay but just don't seem to
be able to get the Net::SMTP command to work. Admittedly I'm
completely new to object orientated programming but I have been
reading the books so don't believe myself to be completely clueless.
Also, I'm on an NT box.
Here's my script;
----
use Net::SMTP;
$hitcounter = 0;
@date = localtime;
$day = $date[3];
$month = ++$date[4];
$year = $date[5]+1900-2000;
$today = sprintf ("%1.1d/%1.1d/%2.2d", $month, $day, $year);
%option = ("Debug","1");
$smtp = Net::SMTP->new(192.168.0.1,%option);
print $smtp
$smtp->Net::hello();
# Open the log file
open (LOGFILE,"daily.log")||die "AwoooGarrr!! failed to open the log
file: $!\n";
# Find the 'Verify completed' lines and check them to see if the match
todays date.
while (<LOGFILE>)
{
if ($_ =~ /Verify completed on .+\/.+\/.. at .+:.+:.+\./)
{
@words = split (" ",$_);
if ($words[3] eq $today)
{
$hit = 1;
print "HIT!!\n";
}
}
}
if ($hit == 0)
{
print "Miss!!\n";
}
print "\nEND!!\n";
exit;
-------
The main problem I am getting is that the constructor;
$smtp = Net::SMTP->new(192.168.0.1,%option);
just doesn't seem to be working.
when it gets to the line
$smtp->Net::hello()
I get the error "Can't use an undefined value as a symbol reference at
line 22" which sort of implies to me that the 'new' didn't work. I was
expecting to get some sort of debug info from the 'new' option hash
but when I try and print $smtp it contains nothing.
What the *%&$ am I doing wrong? Any help pointing me in the right
direction will bring a shower of gratitude!!!
------------------------------
Date: 8 Jun 2000 08:24:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: @INC
Message-Id: <8hnhn2$bh3$1@orpheus.gellyfish.com>
On Sun, 04 Jun 2000 22:11:29 -0600 scott thomason wrote:
> ..You can check the contents like this:
>
> print "INC contents:\n", join("\n", @INC), "\n";
>
> If you need to modify it to include a path to your_module.pm, you can either do:
>
> #!/usr/bin/perl -Imy_module_dir
>
> ...or if you need to be fancier you can try:
>
> BEGIN {
> push(@INC, "my_module_dir");
> }
Or if you want to use the method that is provided for this purpose and
described in the documentation:
use lib 'whateverdirectory';
/J\
--
Mmmm, purple.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:16:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: change priority
Message-Id: <8hnh8u$a1u$1@orpheus.gellyfish.com>
On Wed, 7 Jun 2000 21:04:12 +0400 Roman Chumakov wrote:
> I need to low priority for executing a perl script.
>
> How a perl script can do it itself?
> May a perlscript to low itself priority? If yes - How?
>
Most people will use setpriority a builtin function documented in the
perlfunc manpage.
/J\
--
It's not easy to juggle a pregnant wife and a troubled child, but somehow
I managed to fit in eight hours of TV a day.
--
fortune oscar homer
------------------------------
Date: 08 Jun 2000 10:17:31 +0100
From: nobull@mail.com
Subject: Re: connect() timeouts in perl
Message-Id: <u9pupslefo.fsf@wcl-l.bham.ac.uk>
Dr. Ari D Jordon DD <docurizen@my-deja.com> writes:
> Is there any way to change how long connect() waits before giving
> up?
Not in a portable way. However you can abort the connect() before it
gives up.
perldoc -q timeout
perldoc IO::Socket
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 8 Jun 2000 07:59:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Crypt-DES won't compile
Message-Id: <8hng9b$6oc$1@orpheus.gellyfish.com>
[ nonexistent comp.lang.perl removed ]
In comp.lang.perl.misc Noah Couture <noah@coutureconsulting.com> wrote:
>
> I'm trying to install the Crypt-DES-1.0 module on a Solaris 5.7 machine. I
> get this error:
>
> sh-2.03$ make
> gcc -c -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL
> E_OFFSET_BITS=64 -O -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC -I/us
> r/local/lib/perl5/5.6.0/sun4-solaris/CORE DES.c
> DES.xs: In function `XS_Crypt__DES_crypt':
> DES.xs:50: `sv_undef' undeclared (first use in this function)
> DES.xs:50: (Each undeclared identifier is reported only once
> DES.xs:50: for each function it appears in.)
> *** Error code 1
> make: Fatal error: Command failed for target `DES.o'
>
When you run Makefile.PL you will need to run it as :
perl Makefile.PL POLLUTE=1
So it defines the 5.005 symbols that have changed for 5.6.0 .
/J\
--
Let me handle this, Marge, I've heard 'em all. ''I like you as a
friend.'' ''I think we should see other people.'' ''I don't speak
English.'' ''I'm married to the sea.'' ''I don't wanna kill you, but I
will.'' ... Six simple words: I'm not gay, but I'll learn.
--
fortune oscar homer
------------------------------
Date: Thu, 08 Jun 2000 11:03:01 +0200
From: Ray Compton <compton@unicc.org>
To: Noah Couture <noah@coutureconsulting.com>
Subject: Re: Crypt-DES won't compile
Message-Id: <393F6144.8909BC72@unicc.org>
I found that I needed to define this... somewhere along the line 'sv_undef'
became PL_sv_undef.
#define sv_undef PL_sv_undef /* Add this in DES.xs after the last #include */
That 1 line ought to do the trick
/rayc
Noah Couture wrote:
> Hello,
>
> I'm trying to install the Crypt-DES-1.0 module on a Solaris 5.7 machine. I
> get this error:
>
> sh-2.03$ make
> gcc -c -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL
> E_OFFSET_BITS=64 -O -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC -I/us
> r/local/lib/perl5/5.6.0/sun4-solaris/CORE DES.c
> DES.xs: In function `XS_Crypt__DES_crypt':
> DES.xs:50: `sv_undef' undeclared (first use in this function)
> DES.xs:50: (Each undeclared identifier is reported only once
> DES.xs:50: for each function it appears in.)
> *** Error code 1
> make: Fatal error: Command failed for target `DES.o'
>
> I also had to change
>
> #incldue <machine/types.h>
> to
> #include <sys/types.h>
>
> in des.h, and change u_int to uint in several places DES.xs.
>
> Any help will be greatly appreciated.
>
> thanks
> noah
--
Ray Compton [compton@unicc.org, rayc@wanadoo.fr]
There is water at the bottom of the ocean - David Burn
------------------------------
Date: 8 Jun 2000 08:58:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dynamic IP
Message-Id: <8hnjm9$i00$1@orpheus.gellyfish.com>
On Tue, 6 Jun 2000 21:33:58 -0400 Edward Grinvald wrote:
> Hello all!!
> I have a dial up connection, and therefore a dynamic ip. I was wondering if
> there is a way to get that new ip into a var in a perl script without
> parsing output from something like ifconfig.
>
In the first instance you will want to look at perlfaq9 :
How do I find out my hostname/domainname/IP address?
But if you are using pppd then there is probably no need to use any program
to do this as most implementations will make the IP available to a script
(ip-up here) that it runs on completing the connection - you should read
the manpage for pppd or ask in a newsgroup about your OS for more
information on this.
/J\
--
I can't believe it! Reading and writing actually paid off!
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 09:29:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: E-mail-based PERL discussion group
Message-Id: <8hnli5$o4d$1@orpheus.gellyfish.com>
On Tue, 06 Jun 2000 22:58:03 GMT killerapps@my-deja.com wrote:
> To subscribe, send mail to
> list@claustrophobic.com
> and in the body of the message, put
> join perl
>
Why ? I get enough e-mail from idiots already thanks.
/J\
--
Friendship is far more tragic than love. It lasts longer.
--
fortune oscar homer
------------------------------
Date: Thu, 8 Jun 2000 08:29:49 +0200
From: Vincent <szhzp2@no.spam.com>
Subject: Re: exists() on sub-hash creates a key in super-hash
Message-Id: <Pine.LNX.4.21.0006080816040.3502-100000@w01b04vc.flur.zuerich.ubs.ch>
Clinton, Ala and Anton,
Thanks for your comments. I got it. What a shame that autovivification
isn't context aware.
I found Hash::NoVivify from Brent B. Powers which I might use.
Cheers,
Vincent
--
Vincent Zocca
Vincent.Zocca@UBS.com
Usual disclaimer:
Opinions expressed here are explicitly my own and not of UBS!!!
------------------------------
Date: 8 Jun 2000 09:15:13 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: Finding partial match
Message-Id: <8F4D630E9quuxi@193.82.145.131>
06 Jun 2000: A formal bug report was sent to Seti@Home, because the
following message originated from jdg28@pantheon.yale.edu (John
Gehman) was reported as containing signs of intelligence:
>If I understand your question properly, you are trying to replace
>the following line with just 'Melissa' (without quotes), extracted
>from the line, and you're using the if ... line to do it.
>
>: >>> Virus 'Melissa' found in file filename
>: if( s/.* (Virus|Virus fragment|Identity) [\'`\[]([^\'\]]).*/$2/ )
^^^^^^^^^^^
Opops, finger trouble ! That should have been ([^\'\]]*)
Of course, I should've used (?: ) for the first parens.
I've recently rewritten that line as
if(s/.*\s(Virus|Virus fragment|Identity)\s+[\'`](.*)\'\s+found.*/$2/)
I was copying the original line (still there, commented out) and that's
when my eyes slipped to the new version, and .* made its appearance.
[snip]
As I'm thinking more and more about this, it looks less defined every
time. A RE can restart matching any number of times; which one do I
want ? Probably the one from the very beginning of $_
Perhaps the question I'm really asking is WHY DIDN'T THIS RE MATCH THAT
LINE ? (yes, I'm shouting; at Perl, not you :-)
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: 8 Jun 2000 09:09:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: General failure reading device (Win32)
Message-Id: <8hnkb5$k3t$1@orpheus.gellyfish.com>
On Wed, 7 Jun 2000 15:14:58 GMT Vince Wilding wrote:
> Using ActiveState Build 522 on Win98 (This NEVER happened on NT) I get
> a "General failure reading device" error (no device mentioned!) when I
> try to do a file OPEN. Sometimes I see the light come on on the A:
> drive, even though I don't reference it anywhere in the code. I give it
> a cupla "f"'s and it goes on its merry way. I've tried the "/f" switch
> for COMMAND.COM but that doesn't help.
>
You havent got a Virus Checker installed have you ? I seem to recall
of this being behind some similar problem - you might want to check
at Deja News <http://www.deja.com/home_ps.shtml> for more.
/J\
--
I'll handle this... the only danger in space is if we land on the terrible
Planet of the Apes... wait a minute. Statue of Liberty... THAT WAS OUR
PLANET! YOU MANIACS! YOU BLEW IT UP! DAMN YOU! DAMN YOU ALL TO HELL!
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:18:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: localtime
Message-Id: <8hnhbj$ab0$1@orpheus.gellyfish.com>
On 7 Jun 2000 16:12:44 GMT Neil Kandalgaonkar wrote:
> In article <8hlqpa$cm9$1@usenet01.srv.cis.pitt.edu>,
> J. Joseph Yusko <boogiemonster@usa.net> wrote:
>>can anyone assist me with this problem. I have the following line of code.
>> my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
>>and appears as Wed-Jun-7-2000. I'd also like to append the time. how would
>>i go about that? any help would be greatly apprecated.
>
> It sounds like you don't know perl but are trying to modify a script.
> What this is basically doing is taking the scalar (formatted) results
> of the function localtime, splitting on whitespace, and taking fields 0,
> 1,2, and 4, and joining them by '-'.
>
> See perldoc -f localtime, perldoc -f split, perldoc -f join.
>
> Or, just use $date = localtime; , if you don't need a precise format.
Or look at the strftime entry in the POSIX manpage.
/J\
--
Mmmm, forbidden donut.
--
fortune oscar homer
------------------------------
Date: Thu, 08 Jun 2000 10:30:41 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Moving from Unix to NT - sending mail
Message-Id: <393F59B1.BD89E8B5@nospam.com>
Ben,
Ben Hambidge wrote:
> I have to move my CGI script from a Unix web server to a WinNT
> server. I send mail by piping to /usr/lib/sendmail
> using open(MAIL,"|/usr/lib/sendmail $recipient"); What do I need to
> do to acheive the same effect in Windows?
You have to find an SMTP mailer for Windows that accepts commands from
its standard input or, changing your script, via command line (such as
"postie", for example).
Best regards,
Marco
------------------------------
Date: 8 Jun 2000 09:27:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Net::Ping keeps returning 0?
Message-Id: <8hnlda$nkc$1@orpheus.gellyfish.com>
On Wed, 7 Jun 2000 01:42:55 +0200 Helza wrote:
> Hi,
>
> After reading some post for the problems i had (pinging a server to see if
> its online) i got the suggestion to use the net::ping command.
>
> The problem is that i tryed using it but for some unknown reason it always
> returns 0 to me, even though i'm 100% sure the ip/server is online..
> Nomatter what I try
>
>
> Any suggestions? :)
>
> I use the following code:
> ----
>
> #!/usr/bin/perl
>
> use Net::Ping;
>
> $host = "216.147.115.199";
> $p = Net::Ping->new();
> $retval = $p->ping($host,5);
> $p->close();
>
If you use the default tcp 'ping' the host that you are testing must
have the 'echo' service enabled. Windows machines and securely
administered Unix machines are unlikely to have this enabled. For
reliability you should use a proper icmp ping for which you will need
root privilege (under unix anyway). If you are running this i the CGI
environment as you appear to be then you might want to read the perlsec
manpage and then run the program setuid.
/J\
--
Son, a woman is a lot like a... a refrigerator! They're about six feet
tall, 300 pounds. They make ice, and... um... Oh, wait a minute. Actually,
a woman is more like a beer. They smell good, they look good, you'd step
over your own mother just to get one! But you can't stop at one. You
wanna drink another woman!
--
fortune oscar homer
------------------------------
Date: Thu, 08 Jun 2000 07:28:26 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: Obtaining stats of a remote file
Message-Id: <393f4315.132100343@news.nikoma.de>
On Wed, 07 Jun 2000 16:07:43 +0800, "Jason Q."
<jason@generationterrorists.com> wrote:
> Is it possible, via a Perl script, to obtain info (equivalent of Perl's
> "stat" function) of a file that is on a remote server?
Depends on how you connect to that remote server -- different methods
give you different amounts of information. (SMB? NFS? FTP? HTTP? e-mail?
thought reading? Tempest attack?)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 08 Jun 2000 07:21:48 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Perl and memory consumption
Message-Id: <gQH%4.3629$55.46049@news1.rdc1.mb.home.com>
In article <393F2FB9.C6C9A9E3@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Andrew Johnson wrote:
>
> (others contributed, some snippage)
>
> > I suppose you think that by using 'date' in an unrelated
> > context and thinly disguising it as humor, you can distract
> > me into admitting that bloat and efficiency (or how fast they
> > get loaded) might matter when comparing dates -- well, I'm not
> > falling for it.
>
> Actually, I am being nice to you with hopes of
> giving you a smile, perhaps even a laugh. Sadly,
Actually, that was *my* intent -- merely extending the pun on
comparing dates by bringing 'bloat' and 'getting loaded' into the
same alternate context, thinly disguised as a claim that I wouldn't
be tricked into admitting such a basis for comparing dates (at least
I thought it was thinly disguised).
> it does truly appear you are not programmed for
> either of those enjoyable personal events.
Sadly, you seem intent on misreading people's intentions to the point
of brushing everyone and everything you come across with the same
tired old stroke. To wit:
> "Humor Not Allowed. Hatred Welcomed."
ouch?
later,
andrew
--
Andrew L. Johnson http://members.home.net/perl-epwp/
well, take it from an old hand: the only reason it would be easier
to program in C is that you can't easily express complex problems
in C, so you don't. -- Erik Naggum, on comp.lang.lisp
------------------------------
Date: Thu, 8 Jun 2000 08:44:05 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: perl cgi problem. thax in advance.
Message-Id: <960450350.3377.0.nnrp-03.c3ad6973@news.demon.co.uk>
Peng wrote in message <7xH%4.2208$vT6.296201@news1.telusplanet.net>...
>
>Hi,all. Does anyone know how to let perl cgi achieve the following task?
>When a button is pushed, instead of giving the feedback to the same window,
>the cgi program pops out a new window and display message there. I will be
>very appreciated if someone can tell me how to use perl to do that.
The answer to this probably lies in either the HTML or Javascript of the
page that calls the CGI script, rather than the perl its self.
------------------------------
Date: Thu, 8 Jun 2000 11:21:03 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: perl cgi problem. thax in advance.
Message-Id: <8hnogj$vl$1@news.online.de>
inside the <form> tag, add target="_blank" and the CGI Script will make the
results go inside a separate window!
Peng <peng@cs.ualberta.ca> wrote in message
news:7xH%4.2208$vT6.296201@news1.telusplanet.net...
>
> Hi,all. Does anyone know how to let perl cgi achieve the following task?
> When a button is pushed, instead of giving the feedback to the same
window,
> the cgi program pops out a new window and display message there. I will be
> very appreciated if someone can tell me how to use perl to do that.
>
> Thax a lot.
>
> peng wang
>
>
>
------------------------------
Date: 8 Jun 2000 08:08:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Crypt function
Message-Id: <8hngpf$8de$1@orpheus.gellyfish.com>
On Wed, 07 Jun 2000 14:35:43 GMT Ala Qumsieh wrote:
>
> GuruMuhk <gurumuhk@my-deja.com> writes:
>
>> and for examples my password is
>> $pass = 'thisismypass';
>> $encryptedpass = 'Fd\.lfdkjdsf'; <- fake I came up with for examples..
>>
>> if ( crypt( $pass, $encryptedpass ) eq $encryptedpass )
>> {
>> print "worked\n";
>> }
>>
>> this works perfectly, but if I set $pass to
>> 'thisismypassANDTHISISIGNORED';
>>
>> this will also show as a valid password,
>> and I also tried adding random chars at my linux login prompt and it
>> also saw my password as valid even though I added extra chars after the
>> password..
>>
>> so I was just wondering if this was normal or not, is it ?
>
> Yes it is. crypt(), which is derived from the unix command of the same
> name, only looks at the first 8 characters of your key. It takes the
> lowest 7 bits of each of these characters to create a 56-bit key, which
> is used to repeatedly encrypt a constant string (usually a string of
> zeros). At the end, this results in an encrypted password of 13
> characters, the first two of which are the specified salt.
>
Just for interest I might mention that the crypt() used by SCO openserver
to encrypt password when presented with a password of longer than eight
characters will produce an encrypted password of longer than 13 characters.
It doesnt however mention this in the manpage.
/J\
--
Go ahead and play the blues if it'll make you happy.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:51:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PERL DBI module to connect to MS-Access databases?
Message-Id: <8hnjav$gr0$1@orpheus.gellyfish.com>
On Wed, 07 Jun 2000 03:44:44 GMT Edwin A. Jukniewicz wrote:
> BY the way, I should mention, I'm running PERL on a Linux/Intel box.
> RH V6.2
>
I might add to my previous comment that if you dont have a Windows
machine available to you then you are stuffed. Ask in the newsgroup
comp.databases.ms-access why.
/J\
--
The only thing that the artist cannot see is the obvious. The only thing
that the public can see is the obvious. The result is the Criticism of
the Journalist.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:50:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PERL DBI module to connect to MS-Access databases?
Message-Id: <8hnj80$ghb$1@orpheus.gellyfish.com>
On Wed, 07 Jun 2000 03:41:54 GMT Edwin A. Jukniewicz wrote:
> Hello,
>
> Is anybody aware of any PERL DBI module to connect to MS-Access
> databases?
> Or any way at all using PERL?
>
On a Win32 system you will need to use DBD::ODBC, if you are on another
sort of OS then you will still need to access the database on a Windows
machine via dbiproxy and DBD::Proxy on the other machine.
/J\
--
Dear Lord: The gods have been good to me. For the first time in my life,
everything is absolutely perfect just the way it is. So here's the deal:
You freeze everything the way it is, and I won't ask for anything more. If
that is OK, please give me absolutely no sign. OK, deal. In gratitude,
I present you this offering of cookies and milk. If you want me to eat
them for you, give me no sign. Thy will be done.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:43:29 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: reading contents of an ASCII file
Message-Id: <slrn8jun5g.4jc.vek@pharmnl.ohout.pharmapartners.nl>
On Wed, 7 Jun 2000 22:16:13 +0200,
Raphael Pirker <raphaelp@nr1webresource.com> wrote:
>Hi,
>
>I would like to read the contents of an ASCII text file into a variable. The
>file has many lines, so a singe OPEN won't do. Any hints?
>
Assume you won't try that and a 100 Megabyte file ;-)
Villy
------------------------------
Date: Thu, 08 Jun 2000 08:53:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: reading contents of an ASCII file
Message-Id: <3941441d.1097456@news.skynet.be>
Abigail wrote:
>But I see you know more about Perl than I do. I would never have thought
>of opening a file more than once just to read it!
Probably just to doublecheck to see if he read it correctly.
--
Bart.
------------------------------
Date: 8 Jun 2000 08:12:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Ruby -- A better OO Perl than Perl? Python 3000 features available now?
Message-Id: <8hnh0v$95u$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Conrad Schneiker <schneiker@jump.net> wrote:
> The purpose of this note is simply to let such people know about Ruby.
And I thought you were just trolling for flames.
/J\
--
We'll die together, like a father and son should.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:45:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: shell command
Message-Id: <8hnivd$fla$1@orpheus.gellyfish.com>
On Wed, 7 Jun 2000 17:54:40 +1000 Michael Roper wrote:
>> when i try to run this in my browser, only this can be shown,
>> "This is the result:: " ...$result doesn't give any value.
>>
>> i tried looking at the error log, it says there;
>> "Cannot open /dev/sda"
>>
>> but i tried running it in shell command line: ./result.cgi
>> this is the result::
>> Disk /dev/sda: 255 heads, 63 sectors, 1111 cylinders
>> .....
>> ..... and etc....
>>
>> it would mean that /dev/sda can be seen. I need to see those data
>> produced by that command. But why is it that when I run it in the
>> browser, it cannot see /dev/sda. And I need to run it thru a browser.
>
> If you change file permissions for /dev/sda (eg chmod a+rx /dev/sda in
> shell) this problem should go away.
>
I really dont think you need or want to set the executable bits on a
block special file, also you might to think long and hard about making
it world readable as this will allow anyone to read the contents of
any file on that disk regardless of the permission of that file - this
includes /etc/shadow, peoples private PGP keys, .netrc or .fetchmailrc
that may can contain passwords and sundry other stuff that the legion
of crackers and miscellaneous computer vandals will be most pleased to
obtain.
You might instead consider making reading the perlsec manpage and then
making this single program setuid , thereby creating a single manageable
point of potential insecurity rather than a great gaping barn door.
/J\
--
Mmmm, sacrilicious.
--
fortune oscar homer
------------------------------
Date: Thu, 08 Jun 2000 09:17:19 GMT
From: ra jones <ra_jones@my-deja.com>
Subject: Solution needed for 'simple' task.
Message-Id: <8hnoal$imj$1@nnrp1.deja.com>
I have a list of terms, which in practice can vary in length between 1
and a lot. Here is 4:
@list = ("A","B","C","D");
$N = @list
I want the script to print 'A, B, C and D'. If there were 1 item, print
'A', if 2 then print 'A and B'. If twenty, then 'A, B, C, D ... and T'.
I am exploiting the $list[$N] property, and can get the script to print
$list[0] and $list[$N-1] ie first and last items, but I cannot get it to
print the middle items of the list with the commas & 'and' in the
correct place. Have tried 'while', 'foreach ($list(@list)', and 'for ($i
= 0; $i < ($N-1); $i++)', and variations of each, but so far nothing has
worked. In truth, I don't know which function is most suitable for this
task. Can anyone suggest a solution?
--
ra jones (posted via deja.com)
address for e-mail reply:
rajones(at)mail(dot)com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Jun 2000 08:11:54 GMT
From: Juha-Pekka Peltomaki <jupepe@jyu.fi>
Subject: Re: String is a float...
Message-Id: <8hnkga$f3v$2@mordred.cc.jyu.fi>
Johan Henriksson <jhe@realsoftware.cjb.net> wrote:
: from: Johan Henriksson, Sweden jhe@realsoftware.cjb.net
: Hi guys! I have this little problem:
: $the_string="1.2";
: @my_variables = split($the_string);
: The first is not there in reality. Split won't work here!
Hi Johan!
$string = "4.5.6.7";
$number = 4.5;
In perl it's possible to split scalar variable even if it's a number
because a variable which have one value is so called scalar (variable).
You don't need cast anything.
@res1 = split /\./, $string;
@res2 = split /\./, $number;
print "@res1" . "\n" . "@res2" . "\n";
In Perl point is so called special variable so you must put backslash
before it.
Now the results are:
4 5 6 7
4 5
I Hope this helps you!
- Name: Juha Peltomäki.
------------------------------
Date: Thu, 08 Jun 2000 02:35:30 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: System() & PID
Message-Id: <stevel-0806000236020001@192.168.100.2>
In article <393F0521.96B5494C@rochester.rr.com>, Bob Walton
<bwalton@rochester.rr.com> wrote:
> "J. Lundell" wrote:
> ...
> > Is there a way on NT to create a new process and capture the Process ID
> > of this new process via Perl?
> ...
> > -Jim, 3M
> ...
> perldoc -f fork
I must admit I'm not a fan of this particular style of nonresponsiveness.
1) Typing "perldoc -f fork" is more keystrokes than "yes" or "no," and
thereby lacks the Perl virtue of laziness.
2) The question is about NT. Mr Lundell in all likelihood already knows
about fork() and doesn't happen to recall whether it's implemented on NT
or not. I don't remember either. It wasn't implemented when I tried it a
couple of years ago, but I vaguely recall reading that it's been
implemented recently. It's the kind of thing you either know or don't,
it's not such a big f-in' deal that people have to bust the guy's chops
for asking.
I put it to the assembled multitudes. What's wrong with just telling the
guy "yes" or "no" or "version X supports fork() on NT?" I understand the
reasoning that if someone gives out information that can be looked up,
then Perl programmers around the world will throw away all their reference
materials in favor of posting their questions to this group.
I'd suggest rather that if people sometimes just answered the question,
even if the information is available elsewhere, that 1) this newsgroup
would be a friendlier place, and 2) most people would still look things
up, and the world really would not go to hell in a handbasket any faster
than it already is.
Well that's my two cents about it. On some technical newsgroups people
give both a reference to the documentation AND the correct answer,
demonstrating both erudition and grace.
Steve L
------------------------------
Date: Thu, 08 Jun 2000 11:10:51 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Text Sorting Question
Message-Id: <0koujsk47qsqnbdlc92puv25ain0ig0p8q@4ax.com>
On Wed, 7 Jun 2000 17:27:23 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
> In article <s8ftjsgu8nns8jppavechqke610l9r8th2@4ax.com> on Wed, 07 Jun
> 2000 23:58:27 +0200, Abe Timmerman <abe@ztreet.demon.nl> says...
>
> ...
>
> > If sorting this thing is the main objective, use Schwartzian-Transform
> > or Rosler/Guttman-Transform.
>
> That's Guttman-Rosler Transform, as in GReaT!
Sorry about that, I wasn't sure. But I'll remember now!
(Or do you prefer 'packed-default sort'?)
--
Good luck,
Abe
------------------------------
Date: 8 Jun 2000 08:21:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: use DBI
Message-Id: <8hnhi7$b0u$1@orpheus.gellyfish.com>
On Mon, 05 Jun 2000 15:04:38 -0700 Yann Ramin wrote:
> beer_girl@bigfoot.com wrote:
>>
>> I wrote a perl script that accesses mySQL and the script is executed
>> through a web browser (and it works great). Now I need to run it from
>> the command line and I get all kinds of syntax errors. Some of them
>> are:
>>
>> here's the code:
>>
>> use DBI;
>> ($db) = DBI->connect('DBI:mysql:DatabaseName, $dbusername);
>>
>> here's the corresponding errors:
>> syntax error in file ParseEmail.cgi at line 66, next 2 tokens "use DBI"
>> syntax error in file ParseEmail.cgi at line 82, next 2 tokens "->"
>>
>> All this works just great if it's run through a web browser. What's
>> going on?!?
>>
>> It's running on FreeBSD using Perl5
>>
>
> 1. You're sure you are running it through perl not sh? Is there a magic
> line in the file?
>
*I'm* sure that it is Perl because that is a Perl diagnostic message. I
would say tha it is more likely that the Perl that is being run is not
Perl 5.
/J\
--
Friendship is far more tragic than love. It lasts longer.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 08:48:15 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: using 'exists' in a program to test for keys in a hash
Message-Id: <8hnmkf$g5n$1@lublin.zrz.tu-berlin.de>
Bart Lateur <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:
>Anno Siegel wrote:
>
>>>This effectively says that the way you access %hash is governed by
>>>functions defined in SDBM_File.pm. Specifically, in your case, if you
>>>try to use exists() on a hash entry, Perl will go and find the EXISTS
>>>method in SDBM_File and execute it, instead of executing the built-in
>>>exists() function. Apparently, this method is missing for some reason.
>>
>>...the reason being that the underlying database mechanism doesn't
>>support entries of just a key with no value. This is true for all of
>>the databases supported by perl. The closest you get is a key with an
>>empty string for a value, so there is no difference between exists()
>>and defined(). Implementors have variously decided to provide exists()
>>as an alias for defined() or not.
>
>This is nonsense.
>
>Isn't it obvious that you should be able to test if a key is in a
>database at all? After all, that is what exists() is for? exists returns
>false iff key not found.
Nonsense or not, that's the way it is. It even gets worse. Cross-
checking the three *_File modules available to me, I find:
- NDBM_File
exists() not implemented
- DB_File
exists() implemented and equivalent to defined()
- SDBM_File
exists() implemented, but always returns true
From a purely logical point of view (as opposed to practical), even
the behavior of SDBM_File is defensible. Since the case of an existing
key without a (defined) value simply doesn't happen, nothing can stop
an implementation to act as if every possible key existed in a database,
only waiting to be given a value.
Anno
------------------------------
Date: 8 Jun 2000 08:02:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: using POP3 & STMP through a proxy server...
Message-Id: <8hngf1$7bh$1@orpheus.gellyfish.com>
On Wed, 07 Jun 2000 00:02:46 GMT Evan Pfeuffer wrote:
> i'm trying to use the POP3 & STMP client classes from behind a firewall.
> Do they support and interface for this?
No. Nor could or should they. You will need to speak to whoever
administers the firewall.
/J\
--
Marge, I agree with you -- in theory. In theory, communism works. In
theory.
--
fortune oscar homer
------------------------------
Date: 8 Jun 2000 09:00:18 GMT
From: Juha-Pekka Peltomaki <jupepe@jyu.fi>
Subject: Re: Variable Syntax in SQL in DBI
Message-Id: <8hnnb2$kou$1@mordred.cc.jyu.fi>
Hi Gabe!
Here is one possible answer to your question.
my $sth = $dbh->prepare("SELECT picid FROM pics WHERE picid = ?")
or die $dbh->errstr;
Remember that statement handles are children of their corresponding
database handle ($dbh).
Now you can pass an integer variable to the SQL query
in a statement handle ($sth).
$sth->execute(5) or $sth->errstr;
There is bind_param() method in which you can give the
the parameter types of your SQL variables.
Now you can "fetch" the data from your SQL database. For example:
while (@data = $sth->fetchrow_array())
{
my $pics = $data[1];
# use $pics variable
}
There is also fetcrow_arrayref() ja fetchrow_hashref() methods
which are faster.
Gabe <grichards@flashcom.net> wrote:
: How do I pass a variable to the SQL in a statement handle in DBI?
: $get = $dbh->prepare("SELECT picid FROM pics LIMIT $start, 5");
Try excellent DBI Book from O'Reilly:
Programming the Perl DBI.
I hope this helps,
Juha Peltomäki, jupepe@jyu.fi.
------------------------------
Date: 8 Jun 2000 09:12:25 GMT
From: Juha-Pekka Peltomaki <jupepe@jyu.fi>
Subject: Re: Variable Syntax in SQL in DBI
Message-Id: <8hno1p$kou$2@mordred.cc.jyu.fi>
Gabe <grichards@flashcom.net> wrote:
: How do I pass a variable to the SQL in a statement handle in DBI?
: $get = $dbh->prepare("SELECT picid FROM pics LIMIT $start, 5");
: I've also tried:
: my $query = qq{SELECT picid FROM pics WHERE eventid = ? LIMIT $start, 5};
: $get = $dbh->prepare($query);
Hi Gabe!
Here is one possible answer to your question.
At first use only SELECT query and give SQL parameters later.
my $query = qq{SELECT picid FROM pics WHERE eventid = ?};
Below $sth is a statament handle which is the childred of database
handle ($dbh). In one database handle you can give multiple
statement handles.
my $sth = $dbh->prepare($query) or die $dbh->errstr;
$eventid = 5;
$sth->execute($eventid);
You can use bind_param() method in which you can give
SQL datatypes also.
At the end fetch your data with fetchrow_array method:
while (@data = $sth->fetchrow_array()) {
my $picid = $data[1];
print "$picid\n";
}
And finish your connection:
$sth->finish; # not necessary but good practice.
$dbh->disconnect;
I Hope this helps!
Juha Peltomäki, jupepe@jyu.fi.
------------------------------
Date: Thu, 8 Jun 2000 09:59:05 +0200
From: "Mösl Roland" <founder@pege.org>
Subject: Re: Where is @INC in ActiveState Perl for Win32 ???????
Message-Id: <393f5491$0$53618@SSP1NO17.highway.telekom.at>
"Neo-X" <jaggers295@hotmail.com> wrote in message
news:k1D%4.2078$O4.51686@news1.rdc1.tn.home.com...
> Try typing in "perl -h" at the command line. It will tell you that the
@INC
> array can be modified by typing in
perl -Idirectory -Idirectory -Idirectory
> .... at the command line.
>
> So in your case it would be
> "perl -Ic:/progra~1/perl/lib -Ic:/progra~1/perl/site/lib".
>
> Note also that perlfaq8 also answers your question and gives some
> alternative ways of setting the @INC directories, including the win32
> environment variables PERL5LIB or PERLLIB.
I set it at run time
$path::base = $ENV { "PATH::BASE" };
if ( ! $path::base ) { $path::base = "C:/base" }
push ( @INC, "$path::base/" );
push ( @INC, "$path::base/wsc" );
--
Mösl Roland http://www.pege.org
Clear targets for a confused civilization
http://www.BeingFound.com
web design and seminars
+43 699 17343674
------------------------------
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 3287
**************************************