[15743] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3156 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 25 00:05:41 2000

Date: Wed, 24 May 2000 21: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: <959227512-v9-i3156@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 24 May 2000     Volume: 9 Number: 3156

Today's topics:
        $mailCmd   = '/usr/lib/sendmail -t -n'; <passagewd@primus.ca>
    Re: @anything = <STDIN> has a problem on win98 systems  <kiera@nnickee.com>
    Re: @anything = <STDIN> has a problem on win98 systems  (Eric Bohlman)
    Re: @anything = <STDIN> has a problem on win98 systems  <kiera@nnickee.com>
    Re: Calling another perl script to run in the backgroun baeron@my-deja.com
    Re: Can't Knit Two Files Together <dan@tuatha.sidhe.org>
    Re: Can't Knit Two Files Together <godzilla@stomp.stomp.tokyo>
        cgi name-value pairs , special characters abhiyahin@my-deja.com
    Re: cgi name-value pairs , special characters (Eric Bohlman)
    Re: daemon programming (Steve Leibel)
    Re: Finding IP addresses+ <anmcguire@ce.mediaone.net>
    Re: Getting HTML source (Eric Bohlman)
    Re: Getting HTML source <thepoet1@arcormail.de>
    Re: How do you receive mail with sendmail? <tcells@Xcapmon.com>
        How does INC get into the Perl.exe <cgoehring@rcisd.com>
    Re: How to convert a long integer into hex (Ilya Zakharevich)
    Re: Passing an array to a regexp <thepoet1@arcormail.de>
        Perl on WindowsNT <chpshi@connection.com>
    Re: Perl on WindowsNT <jeff@vpservices.com>
        please "grade" my coding skills <trw@uakron.edu>
    Re: Q: getting my own process id? <bwalton@rochester.rr.com>
    Re: Q: getting my own process id? <bryan@overture.jpl.nasa.gov>
    Re: Q: getting my own process id? (Mike Stok)
    Re: Q: getting my own process id? (Tony L. Svanstrom)
        Sending e-mail <passagewd@primus.ca>
    Re: Sorting a Database (Eric Bohlman)
    Re: Where is the Perl 5.6 bug list? <cgoehring@rcisd.com>
    Re: Win32::Serial Enigma <jbuffNOjbSPAM@pacific.net.invalid>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 24 May 2000 23:53:52 -0300
From: "Michael" <passagewd@primus.ca>
Subject: $mailCmd   = '/usr/lib/sendmail -t -n';
Message-Id: <LD0X4.59$Xn2.1214@news1.tor.primus.ca>

Can anyone explain what the path could also be... this one isn't working.




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

Date: Wed, 24 May 2000 21:01:27 -0500
From: Kiera <kiera@nnickee.com>
Subject: Re: @anything = <STDIN> has a problem on win98 systems (mine at   least)
Message-Id: <4BC3AA7F5BCDC63C.72F726366D1D47C6.BCD88C85A56A30B9@lp.airnews.net>

On Wed, 24 May 2000 17:55:46 -0700, someone claiming to be Tom Phoenix
<rootbeer@redcat.com> said:

>On Wed, 24 May 2000, Kiera wrote:

>> I'm not sure I understand... like this?

>You're close. :-)

but no cigar, right? :)

>> 	$count{word} = $count{$word}++;

>That line isn't doing what you want, in two different ways.

doh!  I see it now.  I'll just go crawl back in my corner now...
errr... after a while :)

this one:
$count{$word} = $count{$word} + 1;
works, but throws back icky stuff:

three
three
STDIN> chunk 4.
Use of uninitialized value at chap5b.pl line 7, <STDIN> chunk 4.
Use of uninitialized value at chap5b.pl line 7, <STDIN> chunk 4.
throwaway line
three was seen 2 times

(of the two that actually do "work" this last one is the only one that
actually prints the "throwaway line" you suggested that I add...
and removing that throwaway line yields the following:
STDIN> chunk 2.
three was seen 2 times

what happened to the rest of the warning there?)

>> (again, where did it see "word" ???)

it saw it cuz I forgot the $ :)  (although it also saw my one's and
two's without any problems, but don't get me started on that track
again :)

>Does that give you a clue about the line above? (I'm not trying to be mean
>by withholding the answer; this is homework you're doing, after all. :-)

<smile>  I don't feel like you're being mean.  You helped me quite a
bit there :)   If I wanted the answers presented to me on a silver
tray I'd hire somebody to write my scripts for me  :)

>If you're still stuck, of course, you'll be welcome to ask again. Cheers!

I am and am not stuck at the same time :)
	$count{$word}++; with the throwaway line works and doesn't
actually print the throwaway line to the console, so that's what I'm
going to use.

I still think some mention of this should be in the docs somewhere (as
well as in any revisions to the book).

Thanks again, Tom.

Kiera



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

Date: 25 May 2000 01:18:36 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: @anything = <STDIN> has a problem on win98 systems (mine at least)
Message-Id: <8ghv1c$ijg$7@slb6.atl.mindspring.net>

Kiera (kiera@nnickee.com) wrote:
: Ok, ran into another problem while doing the exercises in "Learning
: Perl on Win32 Systems".

: chomp(@words = <STDIN>); # read the words, minus newlines
: foreach $word (@words) {
: 	$count{word} = $count{$word}++;
               ^^^^
Forget something there?  Perl stringifies barewords used as hash keys...

: }


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

Date: Wed, 24 May 2000 21:08:17 -0500
From: Kiera <kiera@nnickee.com>
Subject: Re: @anything = <STDIN> has a problem on win98 systems (mine at least)
Message-Id: <73E828EA92262328.EE3264D0E1FF1242.15D2C46DD7F91D6B@lp.airnews.net>

On 25 May 2000 01:18:36 GMT, someone claiming to be
ebohlman@netcom.com (Eric Bohlman) said:

>: chomp(@words = <STDIN>); # read the words, minus newlines
>: foreach $word (@words) {
>: 	$count{word} = $count{$word}++;
               ^^^^
>Forget something there?  Perl stringifies barewords used as hash keys...

Yup, I did :)
But even with the $, the line isn't correct.
$i = 5;
$i = $i++;
print $i;

>: }

<smile>
Kiera



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

Date: Thu, 25 May 2000 02:53:44 GMT
From: baeron@my-deja.com
Subject: Re: Calling another perl script to run in the background
Message-Id: <8gi4ji$d15$1@nnrp1.deja.com>

In article <ZzZW4.86787$h01.627519@news1.rdc1.mi.home.com>,
  clintp@geeksalad.org (Clinton A. Pierce) wrote:
> [Posted and mailed]
>
> In article <8ghmsc$3ic$1@nnrp1.deja.com>,
>
> Just because the browser sees a </html> tag doesn't necessarily mean
the
> page is done loading.  At least not any browser I've ever seen.  It
ain't
> over till the socket gets closed.
>
> So you wander off, exec() your new process...which is still connected
via
> the same socket as your original CGI program.  And the browser is
sitting
> at the other end of the socket waiting for mainscript.cgi to emit
> more web-type stuff.  Unix works like that, bud.  It's a feature.
>
> What you need to do is to disassociate the second process from the
> first (closing filehandles, etc..).  Read in the FAQ in section 8
under the
> question "How do I fork a daemon process?" for starters.
>

Ahh-  exactly, precisely, without error margin the answer I was looking
for.  I thank you and loudly sing your praises.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 25 May 2000 01:13:49 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Can't Knit Two Files Together
Message-Id: <h7%W4.92024$hT2.384886@news1.rdc1.ct.home.com>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Larry Rosler wrote:

>> Do not slurp entire files into arrays when line-at-a-time 
>> processing will suffice.

> Really. Some tech articles disagree with this.
> Why not Mr. Rosler? You have offered no explanation.
> No comparisons.

Slurping the entire file into memory when it's going to be processed line
by line is generally wasteful of memory. It takes about
((# lines * 22) + filesize) * 2 + (# lines * 8) bytes, as a low-ball
estimate. If the files are small this doesn't matter, but if they're of
any significant size you'll chew up a big chunk of memory needlessly.

Whether this is a problem depends on your system, but memory can generally
be put to good use somewhere else, especially on a multiuser machine. If
you're on your own workstation or personal machine it's less of an issue,
but if you're sharing the machine it's a waste.

					Dan


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

Date: Wed, 24 May 2000 18:54:30 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Can't Knit Two Files Together
Message-Id: <392C87D6.379834FF@stomp.stomp.tokyo>

Dan Sugalski wrote:
 
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > Larry Rosler wrote:
 
> >> Do not slurp entire files into arrays when line-at-a-time
> >> processing will suffice.
 
> > Really. Some tech articles disagree with this.
> > Why not Mr. Rosler? You have offered no explanation.
> > No comparisons.
 
> Slurping the entire file into memory when it's going
> to be processed line by line is generally wasteful of
> memory. It takes about 
> ((# lines * 22) + filesize) * 2 + (# lines * 8) bytes,
> as a low-ball estimate. If the files are small this 
> doesn't matter, but if they're of any significant size
> you'll chew up a big chunk of memory needlessly.
 
> Whether this is a problem depends on your system,
> but memory can generally be put to good use somewhere
> else, especially on a multiuser machine. If you're on 
> your own workstation or personal machine it's less of 
> an issue, but if you're sharing the machine it's a waste.


Yours is a very responsible and well written
explanation on this topic. This is a mature
approach to a topic, compared to simply
commanding and demanding people do something
with no explanation and, in the process, 
insulting another. Your efforts are both
noted and saved to my scrapebook.

Some thoughts on this and please correct me
if I am offbase. I am thinking along the line
of what an F operator does during a file open,
and applying this, perhaps incorrectly, to the
mechanics of file opening. When Perl opens a 
file for a read, its contents are dumped into
the core process. Use of 'while' causes Perl 
to mechanically split the file apart into single 
lines, then read them into program processing, 
one at time. Later, a program reassembles those
lines. Seems, in many but not all circumstances,
slurp would be more efficient by not forcing
Perl to mechanically dissect a file for one
line at a time input, if I have this mechanical
process understood correctly.

If not, it does seem if Perl holds a file
open, reading it one line at time while
processing is taking place, there might
be some risk in having a file open longer
than needed? This would be circumstances
for using lock / unlock as opposed to
what some say, "Always use lock / unlock."

I should qualify, I really know very little
about the deep dark hidden secrets of the
actual 'mechanics' of Perl within core. 
I am surmising based on what I have read 
over years pertaining to this notion.

Nonetheless, in my previous article, my data
appears as such:

01ABS02|fr|80|Code client inexistant.||||||
01ABS03|fr|80|Devis client inexistant.||||||
01ABS04|fr|80|Client correspondant à la racine inexistant.|3|C||||

 ...and another data base, the same format and
size, but in English.

I was told, more like 'commanded' to use
while instead of slurping. This seems a
bit irrational for a data base file well
under one kilobyte, or even ten kilobytes.
Might be slurp is faster for smaller files?

I understand your point on large files. If
you are opening megabyte files, it would
make sense to pull it in, a little at time,
if this is actually what takes place, in
a mechanical sense.

I don't benchmark but slurping seems to be
a lot less effort, less coding, along with 
less risk involved than using 'while' which 
can lead to a theoretical infinite loop, if 
a slight syntax error is made. Slurping and
a foreach tends to avoid this risk. In an
overall viewpoint, I suspect slurping is
most appropriate for correct circumstances,
as is 'while' for correct circumstances.

To promulgate absolute non-use of slurp,
seems very poor advice.


Godzilla!


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

Date: Thu, 25 May 2000 01:27:08 GMT
From: abhiyahin@my-deja.com
Subject: cgi name-value pairs , special characters
Message-Id: <8ghvgu$9pg$1@nnrp1.deja.com>

I am having this problem with one of my perl scripts. I will appreciate
any help, feedback or suggestion.

Problem Description:

Code is:
 ...
$key = 'AIDS/HIV';
$list .= "<br><a href=\"dd.pl?n=$nextCnt&c=$key&s=c\">Next 20
choices</a>";
 ...

Script is dynamically creating an html page  with url link in it.  Url
link got cgi name value pairs. One of cgi value is AIDS/HIV.
Dynamically created url link is like this:

<a href="dd.pl?n=21&c=AIDS/HIV&s=c">.

When I click on this link from browser, it works just fine. Meaning it
makes http connection to server and brings back data.
But when I click on it from Palm device, it generates following http
connection:

"GET / dd.pl?s=c&c=AIDS/dd.pl?n=21&c=%27AIDS/HIV%27&s=c HTTP/1.0" 200
354 "

I don't know why its repeating url after that 'forward slash' in
AIDS/HIV.

I am having similar problems with $key =  "BRAIN+TUMOR";  i.e. any
special character.


Thanks,
Ravi


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 May 2000 01:51:49 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: cgi name-value pairs , special characters
Message-Id: <8gi0vl$ijg$10@slb6.atl.mindspring.net>

abhiyahin@my-deja.com wrote:
: Script is dynamically creating an html page  with url link in it.  Url
: link got cgi name value pairs. One of cgi value is AIDS/HIV.
: Dynamically created url link is like this:
: 
: <a href="dd.pl?n=21&c=AIDS/HIV&s=c">.

That's an invalid URL.  You need to escape the slash.  Use URI::Escape.


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

Date: Wed, 24 May 2000 19:00:03 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: daemon programming
Message-Id: <stevel-2405001900320001@192.168.100.2>

In article <392c67ed.3200439@news.ncf.carleton.ca>, toastman@mindless.com wrote:

> Hi,
> 
> Where is a good place I can start learning about daemons and how to
> program them? (When I use the word 'daemon' I mean a program that runs
> in the background, which performs a task at specific intervals; please
> correct me if I am using the wrong word for the wrong meaning.)
> 


There is a classic that no network programmer should be without.  It's
Unix Network Programming by W. Richard Stevens.  The examples are in C, I
hope that's not a stopper for anyone, this is one of the really good
software books.

Steve L


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

Date: Wed, 24 May 2000 22:39:54 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Finding IP addresses+
Message-Id: <Pine.LNX.4.21.0005242203450.22671-100000@hawk.ce.mediaone.net>

On 24 May 2000, Dave Vandervies wrote:

+ In article <8ghjgl$k4l$1@spinner.corpeast.baynetworks.com>,
+ Brandon Metcalf <bmetcalf@baynetworks.com> wrote:
+ >rootbeer@redcat.com writes:
+ >
+ > > Does it match 2130706433? I can telnet to that address; can you? :-)
+ > > 
+ > > I can generally find something interesting at this URL, although some
+ > > browsers don't work properly with it.
+ > > 
+ > >     http://3427256387/
+ >
+ >I tried searching a few places but didn't come up with anything.  How
+ >do these purely numerical addresses translate to the octet addresses?
+ 
+ Write it in hex, and then just put dots between the octets.  Converting
+ the individual octets from hex back to decimal might make it easier to
+ recognize.

Huh?  3427256387 in hex is 0xcc47c843!!!
This will do the job:

#!/usr/bin/perl -w
use strict;

my $dec_addr = 3427256387;
my $addr = pack('i10', $dec_addr);
my @octets = unpack('C4', $addr);
print +join('.', reverse(@octets)), "\n";

Outputs:

204.71.200.67

A lookup yields:

sh-2.03$ nslookup 3427256387
Server:  elpxy01.ce.mediaone.net
Address:  24.131.128.11

Name:    www2.yahoo.com
Address:  204.71.200.67

That looks OK to me.

Regards,

anm
-- 
/*-------------------------------------------------------.
| Andrew N. McGuire                                      |
| anmcguire@ce.mediaone.net                              |
`-------------------------------------------------------*/



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

Date: 25 May 2000 01:12:14 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Getting HTML source
Message-Id: <8ghule$ijg$5@slb6.atl.mindspring.net>

nfsite@my-deja.com wrote:
: That's one doubt I have... If I find a module that is very usefull for
: me, how can I use it in my site? I'm not the webmaster or the "root" of
: the server where my site is.... How can I "say" to perl so that he uses
: the modules I want? By environment variables?
: (Sorry for this confuse post, but it's late and I'm tired)

perlfaq8 has a good deal to say on this subject.



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

Date: Thu, 25 May 2000 00:36:40 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Getting HTML source
Message-Id: <ohlhg8.5pn.ln@usenet-autoren.de>

Jeff Zucker <jeff@vpservices.com> schrob:
> nfsite@my-deja.com wrote:
>> 
>> I only need to get the source of an HTML page into an var.
>> FOr example:
>> 
> You need to use the LWP (libnet) modules. 

It's libwww, libnet only provides basic services as ftp, telnet,
etc.

Regards
Christian


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

Date: Thu, 25 May 2000 14:00:37 +1000
From: "tcells" <tcells@Xcapmon.com>
Subject: Re: How do you receive mail with sendmail?
Message-Id: <7u1X4.109$az6.4020@nsw.nnrp.telstra.net>


Mace wrote in message <392c6e1e_1@news3.calweb.com>...
>I understand how to send mail using sendmail, but how would you receive it
>and save it to a text file?
>

Use you aliases db to create and alias for the script.  Send the mail to
your perl script alias and have your script do what ever it needs.  If you
have majordomo installed, look at the way which it's set up eg:

majordomo: "| /var/majordomo/wrapper majordomo"

>Thanks,
>
>Mace
>
>




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

Date: Wed, 24 May 2000 19:02:37 -0700
From: chuck <cgoehring@rcisd.com>
Subject: How does INC get into the Perl.exe
Message-Id: <392C89BD.46F887F8@rcisd.com>

Hi everybody,

I'm doing my first build of perl 5.6.0 and have a problem I can't
resolve.  Every time I build, I get a repeat of the @INC ADDED to the
@INC.  After studying the makefile and others, I looked in config.h
(entries listed down below) and all looks ok.  During my first build, I
did not have PERL5LIB set, and I ended up with a path from the source
directory tree in the @INC array.  So, I set PERL5LIB hoping this would
fix it. Now, I get more dups added with each build (perl -V is below).

Platform is Windows NT.  I'm building using the provided make files and
Makefile.PL scripts as opposed to using the CPAN.pm shell or the PRK
tools.

I've been reading a lot but haven't been able to determine if @INC is
"put in the exe" from the header at compile time, read from a Config.pm
file at run time, copied from the PERL5LIB variable or discovered at run
time via some internal algorithm.  Can someone clarify this for me.

This perl will mainly be used on a mod_perl server, so I could modify it
in the startup script, but I might have a need to run non-CGIs on the
server.

Anybody have some advice for me.

Thanks in advance.

Chuck Goehring
cgoehring@rcisd.com

====================================================
The entries in the makefile are:

INST_DRV = c:
INST_TOP = $(INST_DRV)\perl
INST_VER = \5.6.0
INST_ARCH = \$(ARCHNAME)
CCTYPE  = MSVC60
CCHOME  = d:\vs\vc98
CCINCDIR = $(CCHOME)\include
CCLIBDIR = $(CCHOME)\lib
EXTRALIBDIRS =c:\libs

====================================================
Environment variables are as follows:

Path=c:\perl\5.6.0\bin;c:\perl\5.6.0\bin\MSWin32-x86;c:\bin;D:\Oracle\Ora81\bin;

C:\Program
Files\Oracle\jre\1.1.7\bin;C:\WINNT\system32;C:\WINNT;D:\VS\Common\To
ols\WinNT;D:\VS\Common\MSDev98\Bin;D:\VS\Common\Tools;D:\VS\VC98\bin;
PERL5LIB=C:/perl/5.6.0/lib/MSWin32-x86;C:/perl/5.6.0/lib;C:/perl/site/5.6.0/lib/

MSWin32-x86;C:/perl/site/5.6.0/lib;
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 7 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0703

Everything is on c: drive in c:\src or c:\perl\5.6.0 or c:\perl\site.

====================================================
perl -V reports:

Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=unde
f
    useperlio=undef d_sfio=undef uselargefiles=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='cl', optimize='-O1 -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
-DPERL_MSVCRT_RE
ADFIX'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize
=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release
-libpath:"c:\perl\5.6.0
\lib\MSWin32-x86\CORE"  -machine:x86'
    libpth=d:\vs\vc98\lib c:\libs
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32
 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib wsoc
k32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-libpath:"c:
\perl\5.6.0\lib\MSWin32-x86\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options:
  Built under MSWin32
  Compiled at May 22 2000 12:41:37
  %ENV:

PERL5LIB="C:/perl/5.6.0/lib/MSWin32-x86;C:/perl/5.6.0/lib;C:/perl/site/5.6.0/lib/MSWin32-x86;C:/perl/site/5.6.0/lib;"

  @INC:
    C:/perl/5.6.0/lib/MSWin32-x86
    C:/perl/5.6.0/lib/MSWin32-x86
    C:/perl/5.6.0/lib
    C:/perl/site/5.6.0/lib/MSWin32-x86
    C:/perl/site/5.6.0/lib/MSWin32-x86
    C:/perl/site/5.6.0/lib
    c:/perl/5.6.0/lib/MSWin32-x86
    c:/perl/5.6.0/lib
    c:/perl/site/5.6.0/lib/MSWin32-x86
    c:/perl/site/5.6.0/lib
    .


====================================================
In config.h some of the difines are listed as

#define ARCHLIB "c:\\perl\\5.6.0\\lib\\MSWin32-x86"  /**/
#define ARCHNAME "MSWin32-x86"  /**/
#define BIN "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/
#define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/

#define PRIVLIB "c:\\perl\\5.6.0\\lib"  /**/
#define PRIVLIB_EXP (win32_get_privlib("5.6.0")) /**/

#define SITEARCH "c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86"  /**/

#define SITELIB "c:\\perl\\site\\5.6.0\\lib"  /**/
#define SITELIB_EXP (win32_get_sitelib("5.6.0")) /**/



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: 25 May 2000 01:32:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to convert a long integer into hex
Message-Id: <8ghvru$945$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Steffen Beyer 
<sb@engelschall.com>],
who wrote in article <8g0t3m$h1f$1@solti3.sdm.de>:
> Note: The advantage of the Bit::Vector module is that it works with
>       numbers of ANY size and that it is optimized for speed (it is
>       written in C, internally, and uses very efficient algorithms;
>       for instance it uses a divide-and-conquer algorithm for conversions
>       to and from decimal which should be the fastest possible around).

Note that Math::Pari v2.0018 (which is available for several days
already) finally overloads bitwise operations and large binary numbers.

 $var = 0b010101001010101010111101001010010010101001010101010010100101010;

Ilya


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

Date: Thu, 25 May 2000 00:41:50 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Passing an array to a regexp
Message-Id: <erlhg8.5pn.ln@usenet-autoren.de>

Ben Hambidge <newsmay2000@ordinate.co.uk> schrob:
> I have the following condition:
> if ( $x =~ /^[one|two|three|four]/ ) { ...}
> However, I would like to test for values in an array; for example:

> @array = ( "one", "two", "three", "four" );

> Can I now write the regexp to pull out the values of the array
> instead, making the regexp flexible depending on the values in the
> array at the time?

if( map{ $x =~ /^$_/ } @arrray ) {...}

HTH
Christian


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

Date: Wed, 24 May 2000 22:48:14 -0400
From: "Alex Shi" <chpshi@connection.com>
Subject: Perl on WindowsNT
Message-Id: <392c94e4@news.connection.com>

Hi all,

I have been doing lo't of perl on UNIX platform, and it is very
basic that you have to specify the location of perl interpretor
at the first line of your script. But I'd like to know what should
I say at the first line if the script is on NT platform?

I am currently involved in a project with NT platform. I read
a perl script on NT. Its first line says "# flush stdout buffer"
-- What does this mean?

Thanks for all answers!

Alex




-- 
--------------------------------------------------
Please visit http://www.stonix.com

Please subscribe to our E-commerce newsletter:
  subscribe-ecdigest@stonix.com?subject=Subscribe

Join Our E-commerce Survey to get $10 credit!
  http://www.stonix.com/cgi-bin/load_survey.pl

Get your free email at http://stonix.zzn.com
--------------------------------------------------



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

Date: Wed, 24 May 2000 20:03:17 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Perl on WindowsNT
Message-Id: <392C97F5.A64F042E@vpservices.com>

Alex Shi wrote:
> 
> I have been doing lo't of perl on UNIX platform, and it is very
> basic that you have to specify the location of perl interpretor
> at the first line of your script. But I'd like to know what should
> I say at the first line if the script is on NT platform?

The shebang is not used by win32 systems to find the perl interpreter
when running a script from the command line.  That is done instead
either through file associations (NT,2000), or through invoking the
script with perl <scriptname> (win9x).  BUT the line is scanned to look
for flags so if you are running with -w or -T or others, you should put
a shebang line in as you would on NIX.  The other caveat is that some
lame windoze web servers ignore the shebang line, but others (notably
apache) DO use the shebang line to find the perl interpreter even on
win32 platforms so it needs to be an accurate path to the executable for
CGI scripts written for those webservers.  Another place the shebang
line comes in handy is if you are using a win32 version of emacs which
can dump you into perl-mode by recognizing the shebang.  So although you
can get away without a shebang in some circumstances, you need it in
others and it never hurts, so personally, I always use one.

> I am currently involved in a project with NT platform. I read
> a perl script on NT. Its first line says "# flush stdout buffer"
> -- What does this mean?

It probably is a comment for the next line.  Wait a sec, my crystal ball
is clearing, ah yes, the next line of that srcript is: $|++;

-- 
Jeff


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

Date: Wed, 24 May 2000 22:56:36 -0400
From: "Todd W" <trw@uakron.edu>
Subject: please "grade" my coding skills
Message-Id: <8gi4li$1m8$1@kira.cc.uakron.edu>

greetings,

Ive been working with perl now for about 6 months. My father raised me
around computers but he was always just a hobbyist. I will begin working on
my CS systems bachellors degree this fall.

Recently I read the "What's wrong with this picture?" article by Mark-Jason
Dominus at http://www.perl.com/pub/2000/04/raceinfo.html and found it
interesting, but I couldnt completely follow because the documentation on
the Getopt::Std module was a little bland for someone of my experience (i.e.
i didnt get it) and thought mabye I should post a little snippet of my own.

I had to make sure a date was a valid date without DateCalc. My free web
host wont install modules by request. After I finished I thought this might
be a good snippet of code to see what the more seasoned programmers think.
Please point your browser at http://gozips.uakron.edu/~trw3/test.txt to view
the script. Its only one k long. I was just wondering if I tied up all the
loose ends, or if I would be making a mistake selling a piece of code like
this. All replies are very muck appreciated

Todd




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

Date: Thu, 25 May 2000 01:41:24 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Q: getting my own process id?
Message-Id: <392C84FD.FB1D5977@rochester.rr.com>

"Thomas Åhlen" wrote:
> 
> What is the easiest way for a perlscript to get it's own process id?
> Running on linux or unix.

$$

see perlvar
> 
> -Thomas Å
-- 
Bob Walton


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

Date: 24 May 2000 18:07:41 -0700
From: Bryan D Howard <bryan@overture.jpl.nasa.gov>
Subject: Re: Q: getting my own process id?
Message-Id: <7c7lcjsahu.fsf@overture.jpl.nasa.gov>

"Thomas Åhlen" <thomas2@dalnet.se> writes:
> What is the easiest way for a perlscript to get it's own process id?
> Running on linux or unix.

Please make a habit of reading the documentation rather than asking
really basic questions.

perldoc perlvar

{Bryan}
-- 
Bryan D Howard <Bryan.D.Howard@jpl.nasa.gov>
SRTM/GDPS System Administrator
Jet Propulsion Laboratory, Pasadena CA, USA


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

Date: Thu, 25 May 2000 02:13:48 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Q: getting my own process id?
Message-Id: <slrn8ip32t.d4t.mike@ratdog.stok.co.uk>

On Thu, 25 May 2000 00:45:45 GMT, Thomas Åhlen <thomas2@dalnet.se> wrote:
>What is the easiest way for a perlscript to get it's own process id?
>Running on linux or unix.

If you check the perlvar man page (maybe by using perldoc) then you will find:

       $PROCESS_ID

       $PID

       $$      The process number of the Perl running this
               script.  You should consider this variable read-
               only, although it will be altered across fork()
               calls.  (Mnemonic: same as shells.)

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |
GPG PGP Key 1024D/059913DA         | Fingerprint      0570 71CD 6790 7C28 3D60
stok@colltech.com (CT - work)      |                  75D2 9EC4 C1C0 0599 13DA


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

Date: Thu, 25 May 2000 05:04:55 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Q: getting my own process id?
Message-Id: <1eb68qj.1gs9iuw1f085qdN%tony@svanstrom.com>

Thomas Åhlen <thomas2@dalnet.se> wrote:

> What is the easiest way for a perlscript to get it's own process id?
> Running on linux or unix.

Du måste betala extra för det. ;-)


     /Tony
PS Du har reda fått svaren du behöver från de andra. :-)
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
 DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82  78A6 647F F247 9363 F1DB
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©1999  <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Wed, 24 May 2000 23:37:24 -0300
From: "Michael" <passagewd@primus.ca>
Subject: Sending e-mail
Message-Id: <jo0X4.58$Xn2.1281@news1.tor.primus.ca>

I have the script working except for a small problem that the e-mail portion
won't send the e-mail to the recipient. Any ideas?




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

Date: 25 May 2000 01:14:30 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Sorting a Database
Message-Id: <8ghupm$ijg$6@slb6.atl.mindspring.net>

jzoetewey@my-deja.com wrote:
: I've got a fixed length database that I need to be able to sort by any
: field in the database.  I've read perldoc's information on sort as well
: as checking a couple books, but I find myself confused about how to go
: about sorting the database.

Do you actually need to sort the database itself, or just to retrieve 
records in a particular order?  If the latter, take a look at Jeff 
Zucker's DBD::RAM (in fact, it could be adapted if you had to do the former).



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

Date: Wed, 24 May 2000 19:10:00 -0700
From: chuck <cgoehring@rcisd.com>
Subject: Re: Where is the Perl 5.6 bug list?
Message-Id: <392C8B78.EB740842@rcisd.com>


I found this one.  Don't know if there are others.

bugs.activestate.com



sergei_kucherov wrote:

> Does a bug list for Perl 5.6 exist?
> I could not find it on the web.
>
> I would like to look at it before I report a bug.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Wed, 24 May 2000 18:11:50 -0700
From: jbuff <jbuffNOjbSPAM@pacific.net.invalid>
Subject: Re: Win32::Serial Enigma
Message-Id: <0ae8b062.f3520025@usw-ex0103-024.remarq.com>

In article <EnYW4.999$ux.191273@newshog.newsread.com>, "Justin"
<jcamp@cmj.com> wrote:
>I'd like to run a background process in 98 which would consist
of a perl
>script using the Win32::serialport module, which would scan all
the
>characters coming in and going out of the serial port.

I'd set up another PC with two serial ports to listen to the
datastream flowing both ways. You'd need a little hardware jig
to patch it in line externally, but your chances of sucessfully
logging both data streams without affecting them would be a lot
higher.

--jbuff


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

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


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