[7867] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1492 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 17 18:17:40 1997

Date: Wed, 17 Dec 97 15:01:40 -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, 17 Dec 1997     Volume: 8 Number: 1492

Today's topics:
     Re: Part of a line <usenet-tag@qz.little-neck.ny.us>
     Password encription mgeorgeadis@fallschurch.esys.com
     Re: Password encription (brian d foy)
     perl for Win32 question (SasEz! Publications and Design)
     Re: Perl Implementation of Checksum? (Bart Lateur)
     Perl5.004_04 <ohp@pyrenet.fr>
     Re: Random access read/write possible in Perl? (Tad McClellan)
     references to globalise locally generatied filehandles (Matthias Fischmann)
     Re: references to globalise locally generatied filehand <bowlin@sirius.com>
     Reset of the 'each' function with the assignment operat kboutin@magi.com
     Reset of the 'each' iterator with the assignment operat kboutin@magi.com
     Re: Reset of the 'each' iterator with the assignment op (Chip Salzenberg)
     Return status after an exit statement <sa@denkart.be>
     Re: running perl with cgi on a NT? (Calle ]sman)
     searchable archive <bugaj@bell-labs.com>
     Sockets/HTTP Problem -- Anyone? <craig@xu1.medscape.com>
     Substitute without exceeding a defined string length <kassner@intershop.de>
     Re: Substitute without exceeding a defined string lengt <mconty@year.grain.cargill.com>
     Re: Substitute without exceeding a defined string lengt <beans@bedford.net>
     targeting a frame window with perl <shawn@wwgv.com>
     Re: Teaching programing <jack_h_ostroff@groton.pfizer.com>
     Re: Teaching programing <jack_h_ostroff@groton.pfizer.com>
     Re: Wacky idea: a PERL server (Chip Salzenberg)
     Re: What's your favorite UNIX pl-db? (Brad Johnson)
     Re: where did the newline come from? (Tad McClellan)
     Re: Which language pays most 17457 -- C++ vs. Java? (Mark Framness)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 Dec 1997 19:18:08 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Part of a line
Message-Id: <eli$9712171229@qz.little-neck.ny.us>

brian d foy <comdog@computerdog.com> wrote:
>    $line =~ m/Archivo:(.*?)<br>/;
>    $data = $1;

     ($data) = $line =~ /Archivo:(.*?)<br>/;

Is much more intuitive for the general case of N paren groups.
Eg:

     ($name,$data,$br) = $line =~ /(Archivo:)(.*?)(<br>)/i;

For some case where you want to accept and preserve wEiRd
CaPiTaLiZaTiOn.

In more recent versions of perl, you can substitute "undef" for
a variable name to discard that value rather than put in a used
only once placeholder that will trigger -w warnings.

:r! perl -we '$_="123"; ($one,undef,$three)=/(.)(.)(.)/; print "$one$three\n"'
13

Elijah
------
yet another fun undef trick


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

Date: Wed, 17 Dec 1997 10:51:49 -0600
From: mgeorgeadis@fallschurch.esys.com
Subject: Password encription
Message-Id: <882377046.196018186@dejanews.com>

I'll get right to the point ... I've developed a sequence of html pages
from perl scripts. The first of these html pages asks the user to enter
a user name and a password. When the user submits the info the password
field can be seen in the next page's URL. I need help in correcting this
problem as well as figuring a way to check the validity of the entered
password with the corresponding user name. Any advice would be greatly
appreciated. Thanks.

-MG

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 17 Dec 1997 12:36:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Password encription
Message-Id: <comdog-ya02408000R1712971236130001@news.panix.com>

In article <882377046.196018186@dejanews.com>, mgeorgeadis@fallschurch.esys.com wrote:

>I'll get right to the point ... I've developed a sequence of html pages
>from perl scripts. The first of these html pages asks the user to enter
>a user name and a password. When the user submits the info the password
>field can be seen in the next page's URL. 

that's an HTML/CGI problem.  someone in the

   comp.infosystems.www.authoring.*

groups may be able to help you.

>I need help in correcting this
>problem as well as figuring a way to check the validity of the entered
>password with the corresponding user name. Any advice would be greatly
>appreciated. Thanks.

your server might already have facilities for this.  check in a 
newsgroup devoted to your server.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 17 Dec 1997 14:24:44 GMT
From: sase@sasezdesyn.com (SasEz! Publications and Design)
Subject: perl for Win32 question
Message-Id: <34976ac7.106802151@news.theriver.com>

Hello everyone :) 
I have decided that I would like to expand my knowledge of perl and
CGI. I downloaded the newest version of perl and was hoping to play
with it offline for learning purposes. I run Win95 on my local
machines so I have discovered that I need the win32 version of perl.
The server that I use for myself and clients is Unix based. My
question is: If I use the perl for win32 offline to compile and
debug scripts, will they work on the Unix system also? I assume
there would be some differences; are there resources around that
tackle this subject specifically? I have read through the faq, read
the help/readme files that came with perl, read through the
newsgroup postings and more but I cannot find any direct information
on this topic. Any and all help or suggestions would be appreciated
greatly.
Thanks!
Kathy Burns

-
SasEz! Publications and Design ~ Kathy Burns
Professional Web Design, Hosting, and Maintenance
Is your business set up to make money 24 hours a day, 7 days a week?
http://www.sasezdesyn.com  mailto:sase@sasezdesyn.com
ICQ #828499 ~Check out our Free web design planning guide!~
-


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

Date: Wed, 17 Dec 1997 11:26:01 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl Implementation of Checksum?
Message-Id: <3497b5ac.11793715@news.tornado.be>

rsr@best.com (Roy S. Rapoport) wrote:

>(Basically, I need a way to compare two files to see if they're
>identical, and sum seems the quickest way to do it).

In the (odd chance) case that you want to check the uniqueness of JPEG
files, it's pretty easy, fast and reliable to extract the image
dimensions (see CPAN for the Image::size module), and compare those.

It's very rare for JPEG files to have both the same filesize and the
same dimensions.

HTH,
Bart.


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

Date: Wed, 17 Dec 1997 13:34:46 +0100
From: Olivier PRENANT <ohp@pyrenet.fr>
Subject: Perl5.004_04
Message-Id: <3497C6E6.2FFD@pyrenet.fr>

This is a multi-part message in MIME format.

--------------37712125B7C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi all,

I'm trying (very hard) to get perl5.004_04 compiled and working on
unixware 2.03.

I have a few errors that give me headakes!

1st) I just can't get the socket library or call working and I need it!
2nd) stat reported some weird error althought correctly linked
3rd) I cant make gdbm work


Attached are:

output of my config
outpout of make test

Hope you can help me.

Thanks

-- 
Olivier PRENANT             Tel:    +33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

--------------37712125B7C
Content-Type: text/plain; charset=us-ascii; name="perl.test"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perl.test"

base/cond...........ok
base/if.............ok
base/lex............ok
base/pat............ok
base/term...........ok
comp/cmdopt.........ok
comp/colon..........ok
comp/cpp............ok
comp/decl...........ok
comp/multiline......ok
comp/package........ok
comp/proto..........ok
comp/redef..........ok
comp/script.........ok
comp/term...........ok
comp/use............ok
cmd/elsif...........ok
cmd/for.............ok
cmd/mod.............ok
cmd/subval..........ok
cmd/switch..........ok
cmd/while...........ok
io/argv.............ok
io/dup..............ok
io/fs...............ok
io/inplace..........ok
io/pipe.............ok
io/print............ok
io/read.............ok
io/tell.............ok
op/append...........ok
op/arith............ok
op/array............ok
op/assignwarn.......ok
op/auto.............ok
op/bop..............ok
op/chop.............ok
op/closure..........ok
op/cmp..............ok
op/cond.............ok
op/delete...........ok
op/do...............ok
op/each.............ok
op/eval.............ok
op/exec.............ok
op/exp..............ok
op/flip.............ok
op/fork.............ok
op/glob.............ok
op/goto.............ok
op/groups...........ok
op/gv...............ok
op/inc..............ok
op/index............ok
op/int..............ok
op/join.............ok
op/list.............ok
op/local............ok
op/magic............ok
op/method...........ok
op/misc.............ok
op/mkdir............ok
op/my...............ok
op/oct..............ok
op/ord..............ok
op/pack.............ok
op/pat..............ok
op/push.............ok
op/quotemeta........ok
op/rand.............ok
op/range............ok
op/read.............ok
op/readdir..........ok
op/recurse..........ok
op/ref..............ok
op/regexp...........ok
op/repeat...........ok
op/runlevel.........ok
op/sleep............ok
op/sort.............ok
op/split............ok
op/sprintf..........ok
op/stat.............dubious
	Test returned status 0 (wstat 9, 0x9)
op/study............ok
op/subst............ok
op/substr...........ok
op/sysio............ok
op/taint............ok
op/tie..............ok
op/time.............ok
op/undef............ok
op/universal........ok
op/unshift..........ok
op/vec..............ok
op/write............ok
pragma/constant.....ok
pragma/locale.......ok
pragma/overload.....ok
pragma/strict.......ok
pragma/subs.........ok
pragma/warning......ok
lib/abbrev..........ok
lib/anydbm..........ok
lib/autoloader......ok
lib/basename........ok
lib/bigint..........ok
lib/bigintpm........ok
lib/checktree.......ok
lib/complex.........ok
lib/db-btree........skipping test on this platform
lib/db-hash.........skipping test on this platform
lib/db-recno........skipping test on this platform
lib/dirhand.........ok
lib/dosglob.........ok
lib/english.........ok
lib/env.............ok
lib/filecache.......ok
lib/filecopy........ok
lib/filefind........ok
lib/filehand........ok
lib/filepath........ok
lib/findbin.........ok
lib/gdbm............dubious
	Test returned status 0 (wstat 11, 0xb)
lib/getopt..........ok
lib/hostname........ok
lib/io_dup..........ok
lib/io_pipe.........ok
lib/io_sel..........dubious
	Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 11-21
	Failed 11/21 tests, 47.62% okay
lib/io_sock.........dubious
	Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-5
	Failed 5/5 tests, 0.00% okay
lib/io_taint........ok
lib/io_tell.........ok
lib/io_udp..........dubious
	Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-3
	Failed 3/3 tests, 0.00% okay
lib/io_xs...........ok
lib/ndbm............ok
lib/odbm............ok
lib/opcode..........ok
lib/open2...........ok
lib/open3...........ok
lib/ops.............ok
lib/parsewords......ok
lib/posix...........ok
lib/safe1...........ok
lib/safe2...........ok
lib/sdbm............ok
lib/searchdict......ok
lib/selectsaver.....ok
lib/socket..........dubious
	Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-6
	Failed 6/6 tests, 0.00% okay
lib/soundex.........ok
lib/symbol..........ok
lib/texttabs........ok
lib/textwrap........ok
lib/timelocal.......ok
lib/trig............ok
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
lib/gdbm.t        0    11    ??   ??       %  ??
lib/io_sel.t      2   512    21   11  52.38%  11-21
lib/io_sock.t   255 65280     5    5 100.00%  1-5
lib/io_udp.t    255 65280     3    3 100.00%  1-3
lib/socket.t    255 65280     6    6 100.00%  1-6
op/stat.t         0     9    ??   ??       %  ??

--------------37712125B7C
Content-Type: text/plain; charset=us-ascii; name="perlconf"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perlconf"


Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=svr4, osvers=, archname=i386-svr4
    uname='unix_sv server 4.2mp 2.03 i386 x86at '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='/bin/cc', optimize='-O', gccversion=
    cppflags='-I/usr/include -I/usr/ucbinclude -I/usr/local/include'
    ccflags ='-I/usr/include -I/usr/ucbinclude -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='/bin/cc', ldflags ='-L/usr/ccs/lib -L/usr/ucblib -L/usr/local/lib -L/usr/gnu/lib'
    libpth=/usr/local/lib /usr/gnu/lib /shlib /lib /usr/lib /usr/ccs/lib /usr/ucblib
    libs=-lsocket -lnsl -lgdbm -ldbm -ldl -lld -lm -lc -lcrypt -lucb -lx
    libc=/shlib/libc.so.1, so=so
    useshrplib=true, libperl=libperl.so.404
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-Kpic', lddlflags='-G -L/usr/ccs/lib -L/usr/ucblib -L/usr/local/lib -L/usr/gnu/lib'


--------------37712125B7C--



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

Date: Wed, 17 Dec 1997 09:51:49 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Random access read/write possible in Perl?
Message-Id: <les876.2h1.ln@localhost>

hagani@worldnet.att.net wrote:
: Is there any way to perform a RANDOM ACCESS read or write in a perl
: script?  I know how to do sequential reads/writes, but they are far
: less efficient in many cases (eg., i want to read only the last XX
: bytes of a file)....

: Any thoughts?


   perldoc -f read


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


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

Date: 17 Dec 1997 15:16:05 GMT
From: fischman@dfki.uni-sb.de (Matthias Fischmann)
Subject: references to globalise locally generatied filehandles
Message-Id: <678qbl$smm$1@pf1.phil.uni-sb.de>

 Hi all,

Any hackers with experience in references out there?

I just tested a small example from perldata(1), but didn't
manage to make it run. what I need is a subroutine that get's
a filename and returns a filehandle (actually, it is a little
more complicated, but the problem lies here).

        sub newopen {
             my $path = shift;
             local *FH;  # not my!
             open (FH, $path) || return undef;
             return \*FH;
         }
         $fh = newopen('/etc/passwd');

this seems to run, but what am I supposed to do now? this does
not:

         print <$fh>;
         print <*fh>;  # silly?
         print <$$fh>;

maybe I just didn't get the meaning of typeglobs right. is *
not only a way of referencing a peace of data without caring
about bindings, scopes and all that, just hoping that perl gets
everything right? no, it can't be that, because that's what
\ and $ are for.

if you have a compact program that makes these mechanisms clear,
i am happy if you mail it to me, commented or not.

thanx a lot,
 Matthias




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

Date: Wed, 17 Dec 1997 09:31:12 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Matthias Fischmann <fischman@dfki.uni-sb.de>
Subject: Re: references to globalise locally generatied filehandles
Message-Id: <34980C60.53CEB50A@sirius.com>

Matthias Fischmann wrote:

> I just tested a small example from perldata(1), but didn't
> manage to make it run. what I need is a subroutine that get's
> a filename and returns a filehandle (actually, it is a little
> more complicated, but the problem lies here).

Try this code:

sub newopen {
    my $path = shift;
    my $handle = \*main::HANDLE;
    return open ($handle, $path) ? $handle : undef;
}
 
The key is to fully qualify the package name for the typeglob.
A package name other than main is acceptable and preferable.

-- Jim Bowlin


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

Date: Wed, 17 Dec 1997 13:40:31 GMT
From: kboutin@magi.com
Subject: Reset of the 'each' function with the assignment operator '=' ?
Message-Id: <3496f319.1675294456@news.istar.ca>

I am getting confused about the behaviour of the 'each' function combined
with the assignment '=' operator.  The "each iterator" of a hash seem to
get reset if this hash is assigned subsequently to something in a list
context (e.g.: to an @array or to a %hash).  I thought that only a call to
the "keys" function could reset this iterator (that and a complete
sequence through the elements of the hash with each)!  Is there a
description of this "behavior" in the standard documentation (Camel book,
Panther Book, ...)?  Anyone has an explanation?

Examples follow:

EXAMPLE 1

WORKS FINE! Walks through the items of hash %a and successively hash %b.
Note how two separate 'each iterator' are maintained for %a and %b

#!/opt/bin/perl -w

%a = ('a','1','b','2','c','3');
# Assignment removed from here

while ( ($key,$value) = each %a) {

  %b = %a;  # and placed in the loop AFTER the call to 'each'

  print "KEY=$key :: VALUE=$value\n";

  while (($key2,$value2) = each %b ) {
    print "K=$key2 , V=$value2    ";
    last if $value2 == 2;
  }
  print "\n";
}

EXAMPLE 2

DOES NOT WORK!  Loops infinitely in the first while loop since the 'each
iterator' of %a is reset every time the assignment "%b = %a" is done.
Note also the the iterator for %b seem seem to get reset too.

##!/opt/bin/perl -w

#%a = ('a','1','b','2','c','3');
#%b = %a;   # Assignment before the call to 'each'

#while ( ($key,$value) = each %a) {

#  print "KEY=$key :: VALUE=$value\n";

#  while (($key2,$value2) = each %b ) {
#    print "K=$key2 , V=$value2    ";
#    last if $value2 == 2;
#  }
#  print "\n";
#}





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

Date: Wed, 17 Dec 1997 13:35:28 GMT
From: kboutin@magi.com
Subject: Reset of the 'each' iterator with the assignment operator '=' ?  Ooops!
Message-Id: <3497d3fb.5464307@news.istar.ca>

I made a mistake when I did the cut & paste of my previous posting.  I
interchanged the two examples.   Here it is again but in the correct form.
Sorry for the inconvenience...

Karl Boutin

ORIGINAL POSTING >>>

I am getting confused about the behaviour of the 'each' function combined
with the assignment '=' operator.  The "each iterator" of a hash seem to
get reset if this hash is assigned subsequently in list
context (e.g.: to an @array or to a %hash).  I thought that only a call to
the 'keys' function could reset this iterator (that and a complete
sequence through the elements of the hash with each)!  Is that normal behavior?
Is there a
description of this "behavior" in the standard documentation (Camel book,
Panther Book, ...)?  Anyone has an explanation?

Examples follow:

EXAMPLE 1

WORKS FINE! Walks through the items of hash %a and successively hash %b.
Note how two separate 'each iterator' are maintained for %a and %b

#!/opt/bin/perl -w

%a = ('a','1','b','2','c','3');
%b = %a;   # Assignment before the call to 'each'

while ( ($key,$value) = each %a) {

  print "KEY=$key :: VALUE=$value\n";

  while (($key2,$value2) = each %b ) {
    print "K=$key2 , V=$value2    ";
    last if $value2 == 2;
  }
  print "\n";
}

EXAMPLE 2

DOES NOT WORK!  Loops infinitely in the first while loop since the 'each
iterator' of %a is reset every time the assignment "%b = %a" is done.
Note also the the iterator for %b seem seem to get reset too.

#!/opt/bin/perl -w

%a = ('a','1','b','2','c','3');
# Assignment removed from here

while ( ($key,$value) = each %a) {

  %b = %a;  # and placed in the loop AFTER the call to 'each'

  print "KEY=$key :: VALUE=$value\n";

  while (($key2,$value2) = each %b ) {
    print "K=$key2 , V=$value2    ";
    last if $value2 == 2;
  }
  print "\n";
}





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

Date: Wed, 17 Dec 1997 14:25:48 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Reset of the 'each' iterator with the assignment operator '=' ?  Ooops!
Message-Id: <678nc5$rl$1@cyprus.atlantic.net>

According to kboutin@magi.com:
>EXAMPLE 2
>
>DOES NOT WORK!  Loops infinitely in the first while loop since the 'each
>iterator' of %a is reset every time the assignment "%b = %a" is done.

"Well, don't do that, then."

It's not a bug.  The iterator is documented to be fragile.
-- 
Chip Salzenberg               - a.k.a. -               <chip@pobox.com>
|| Perl Training from Stonehenge Consulting Services: (503) 777-0095 ||
         "Aarrrr!  Sixteen men on a dead Dodge Dart!"  // MST3K


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

Date: Wed, 17 Dec 1997 16:13:56 +0100
From: "Sven Akkermans" <sa@denkart.be>
Subject: Return status after an exit statement
Message-Id: <678qj0$2ur$1@news3.Belgium.EU.net>

This is a multi-part message in MIME format.

------=_NextPart_000_000C_01BD0B06.C68A3EA0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_000D_01BD0B06.C68A3EA0"


------=_NextPart_001_000D_01BD0B06.C68A3EA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

In the signal handler of my program, I have a line saying:

exit(-2)

However, when I ask the exit code in the originating shell, I get a =
value of 0.

I have looked at this problem with the perl debugger and it seems that =
after the exit call he still has to do some cleaning up destroy  and =
therefore apparently the exit status is changed.=20
Is there a way to prevent this?

Thanks for all help.

Sven Akkermans

sa@denkart.be

------=_NextPart_001_000D_01BD0B06.C68A3EA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE>
<!--
body, PRE, BLOCKQUOTE, a, MENU, dd, UL, DT, dir, ADDRESS, h1, h2, h3, =
h4, h5, h6, HR
{
font-family: "Arial";
font-size: 12pt;
color: 000000;
}
-->
</STYLE>

<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY background=3Dcid:000301bd0afe$64b50dc0$53894ac1@pcsa.denkart.be=20
bgColor=3D#ffffff>
<DIV>Hello,</DIV>
<DIV>&nbsp;</DIV>
<DIV>In the signal handler of my program, I have a line saying:</DIV>
<DIV>&nbsp;</DIV>
<DIV>exit(-2)</DIV>
<DIV>&nbsp;</DIV>
<DIV>However, when I ask the exit code in the originating shell, I get a =
value=20
of 0.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have looked at this problem with the perl debugger and it seems =
that=20
after the exit call he still has to do some cleaning up destroy&nbsp; =
and=20
therefore apparently the exit status is changed.&nbsp;</DIV>
<DIV>Is there a way to prevent this?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for all help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Sven Akkermans</DIV>
<DIV>&nbsp;</DIV>
<DIV><A =
href=3D"mailto:sa@denkart.be">sa@denkart.be</A></DIV></BODY></HTML>

------=_NextPart_001_000D_01BD0B06.C68A3EA0--

------=_NextPart_000_000C_01BD0B06.C68A3EA0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <000301bd0afe$64b50dc0$53894ac1@pcsa.denkart.be>

R0lGODlhFAAUAPcAAP//////zP//mf//Zv//M///AP/M///MzP/Mmf/MZv/MM//MAP+Z//+ZzP+Z
mf+ZZv+ZM/+ZAP9m//9mzP9mmf9mZv9mM/9mAP8z//8zzP8zmf8zZv8zM/8zAP8A//8AzP8Amf8A
Zv8AM/8AAMz//8z/zMz/mcz/Zsz/M8z/AMzM/8zMzMzMmczMZszMM8zMAMyZ/8yZzMyZmcyZZsyZ
M8yZAMxm/8xmzMxmmcxmZsxmM8xmAMwz/8wzzMwzmcwzZswzM8wzAMwA/8wAzMwAmcwAZswAM8wA
AJn//5n/zJn/mZn/Zpn/M5n/AJnM/5nMzJnMmZnMZpnMM5nMAJmZ/5mZzJmZmZmZZpmZM5mZAJlm
/5lmzJlmmZlmZplmM5lmAJkz/5kzzJkzmZkzZpkzM5kzAJkA/5kAzJkAmZkAZpkAM5kAAGb//2b/
zGb/mWb/Zmb/M2b/AGbM/2bMzGbMmWbMZmbMM2bMAGaZ/2aZzGaZmWaZZmaZM2aZAGZm/2ZmzGZm
mWZmZmZmM2ZmAGYz/2YzzGYzmWYzZmYzM2YzAGYA/2YAzGYAmWYAZmYAM2YAADP//zP/zDP/mTP/
ZjP/MzP/ADPM/zPMzDPMmTPMZjPMMzPMADOZ/zOZzDOZmTOZZjOZMzOZADNm/zNmzDNmmTNmZjNm
MzNmADMz/zMzzDMzmTMzZjMzMzMzADMA/zMAzDMAmTMAZjMAMzMAAAD//wD/zAD/mQD/ZgD/MwD/
AADM/wDMzADMmQDMZgDMMwDMAACZ/wCZzACZmQCZZgCZMwCZAABm/wBmzABmmQBmZgBmMwBmAAAz
/wAzzAAzmQAzZgAzMwAzAAAA/wAAzAAAmQAAZgAAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAFAAUAEAIQwBJCBxI
sKBBAAgTKlyYUCDDhwsdQpwoceLDihYjksh4cSNHjR9BhmzocSQAjCFRflTJkWVGlxZhUiw5UiZE
gzhzBgQAOw==

------=_NextPart_000_000C_01BD0B06.C68A3EA0--



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

Date: 17 Dec 1997 18:21:02 +0100
From: md4calle@mdstud.chalmers.se (Calle ]sman)
Subject: Re: running perl with cgi on a NT?
Message-Id: <w7psorrophd.fsf@fraggel50.mdstud.chalmers.se>

Jim Bowlin <bowlin@sirius.com> writes:

> 
> Calle ]sman wrote:
> > 
> > I wonder if someone want to share experience with running
> > some cgi-scripts on a NT-webserver.
> 
> I have PWS (M$), WebSite (O'Rielly), Xitami (Imatix) and
> Jigsaw (W3C) running on my NT.  All were free. I don't
> know if Jigsaw does Perl CGI since it is entirely Java based.
> The other three do and I have gotten most of Lincoln Stein's
> demo's from CGI.pm  running under each server.
great, I shall see if I can download and try them out.

I heard that one has to create a .com file that runs the perlscript, 
otherwise it would be bad security?
Doesn't it work if i do a simple .bat file, that calls the perlscript?
or is that bad security as well?

how do I create such an .com file?

all best,

/Calle

**************************************************************************
*         *         My homepage about the author Tom Holt:               *
*        /_\        http://www.mdstud.chalmers.se/~md4calle/holt/        *
*     { ~._.~ }                                                          *
*      (  Y  )      other things like OnLine Guitar Archive linkpage     *
*     ( )~*~( )     and heaps of musiclinks can be found at              *
*     (__)-(__)     http://www.mdstud.chalmers.se/~md4calle/             *
**************************************************************************



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

Date: Wed, 17 Dec 1997 13:43:10 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: searchable archive
Message-Id: <34981D3E.59E2@bell-labs.com>

Is there a (searchable) archive of comp.lang.perl.misc, preferably
with a web interface?  I searched on comp.lang.perl.misc in
AltaVista and at perl.com and found stuff but not what I was 
hoping to find... 

Thanks.

LL+P,
Stephan

 
-- 
  
                    "Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj                      bugaj@bell-labs.com
Member of Technical Staff                        (908) 949-3875
Multimedia Communication Research Dept.     Rm. 4F-601, Holmdel
Bell Labs of Lucent Technologies   www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website:     http://www.cthulhu-dynamics.com/stephan  
---------------------------------------------------------------
    STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
           "Do submarines swim?" - E.W. Dijkstra


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

Date: Wed, 17 Dec 1997 11:08:27 -0500
From: Craig Pearlman <craig@xu1.medscape.com>
Subject: Sockets/HTTP Problem -- Anyone?
Message-Id: <3497F8FB.69E6559C@xu1.medscape.com>

I don't do this newsgroup thing much anymore, mostly due to lack of
time, but sometimes you just run into one of those problems where you
have to see if anyone else has a clue...

What I've been trying to do is write a script that will function
(somewhat) as a proxy server for HTTP requests.  The idea is to be able
to log to a file the headers both to and from the browser and Web server
to try to track down a rather annoying problem we've been having.

The major problem is that I can't get the information to come back to
the browser (does the same thing in Netscape 4 or MSIE 3).  I can get it
to log to the file properly, or at least come close.  Unfortunately,
this means that I can't really test things well since I need the
interaction with the Web browser to trigger the things I want to do.

Basically, the script sets up a server process which waits for
connections from the Web browser (sitting on the local machine on port
80).  This then writes the request header to the log file and passes
that along to the Web server through another socket.  The Web server
then responds back, the proxy will log that information and also pass
that to the browser.  Ideally, the script sits between the browser and
the server to log each transaction while allowing the browser and server
to interact normally.

Some notes: This is written for Perl-Win32 (NT).  The Web server in
question is Netscape Enterprise Server 3.0 if that matters to anyone.
As mentioned above, the browser in question has apparently made no
difference.

Some more notes: I'd say I was generally pretty good at this Perl thing,
but my command over sockets and networking is somewhat below the level
of my other skills (mostly, the multi-socket thing is killing me).
There's probably a chance I'm missing something rather obvious.  The
script is mostly based on examples from Camel2 (it might appear
familiar).

I'm attaching the script below (it's not that long) so you can give it a
once (or twice) over.  There's a chance that what's there currently is a
bit of a mess since I've been toying with the thing in the vain attempt
to get it to work right.

Any input anyone can give me would be greatly appreciated.  IF YOU CAN,
PLEASE RESPOND VIA E-MAIL TO craig_pearlman@mail.medscape.com -- I DON'T
CHECK NEWSGROUPS ALL THAT OFTEN.

Thanks.

----

#!/usr/local/bin/perl5
#OK, I know that's not needed in Win32, but I like to keep things
consistent...

require 5.002;
use Socket;
require "flush.pl";

$host_out = 'www.medscape.com';
$port = 80;

$iaddr_out = inet_aton($host_out);
$paddr_out = sockaddr_in($port, $iaddr_out);
$proto = getprotobyname('tcp');

open LOGFILE, ">>web.log" or die "No log: $!\n";

socket (PROXY, PF_INET, SOCK_STREAM, $proto) or die "No in socket:
$!\n";
setsockopt(PROXY, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) or die
"setsockopt: $!\n";
bind(PROXY, sockaddr_in($port, INADDR_ANY)) or die "Bind!: $!\n";
listen(PROXY,SOMAXCONN) or die "Listen!: $!\n";

while (accept CLIENT, PROXY) {
    socket (SERVER, PF_INET, SOCK_STREAM, $proto) or die "No out socket:
$!\n";
    connect (SERVER, $paddr_out);

    while (<CLIENT>) {
        print LOGFILE;
        printflush ('SERVER', $_);
    }

    while (<SERVER>) {
        print LOGFILE;
        printflush ('PROXY', $_);
    }

    close SERVER;
    close CLIENT;
}

--
Craig Pearlman
craig_pearlman@mail.medscape.com
Medscape Systems
http://www.medscape.com




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

Date: Wed, 17 Dec 1997 12:00:28 +0100
From: Dirk Kassner <kassner@intershop.de>
Subject: Substitute without exceeding a defined string length
Message-Id: <3497B0CC.B01@intershop.de>

Salute

I want to quote some sql wildcards in a string for a sql query:

    my ($SqlParameter) = 'Roedel_Doedel%';

    $SqlParameter =~ s/([_%\^\[\]])/[$1]/g;  # results in
'Roedel[_]Doedel[%]'

But the result of this substitution should not exceed a defined length,
that means, I want do all possible replacement and interrupt if the
length is reached
(to leave more wildcards unquoted):

    1 while (length($SqlParameter) < $LENGTH and s/([_%\^\[\]])/[$1]/); 
    # don't work but make clearer what I mean may be
    # (because the chars are still in the string and would be replaced
again and again)

The resulting string than could look like: 'Roedel[_]Doedel%' if the
last wildcard
couldn't be substituted.

I have an uggly solution, looping through the string chars and
working with substr(), but hope there is an easier and nicer way.

Thanks for your help

Dirk


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

Date: Wed, 17 Dec 1997 08:30:38 -0600
From: Mark Conty <mconty@year.grain.cargill.com>
Subject: Re: Substitute without exceeding a defined string length
Message-Id: <3497E20E.459F@year.grain.cargill.com>

Couldn't you just use substr()?
-- 
Mark Conty                             mark_conty@cargill.com (work)
Cargill Grain Division                            mdc@isd.net (home)
CGD/LYNX Server Support        <><               Phone: 612/984-0503


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

Date: 17 Dec 97 15:10:53 GMT
From: Tom <beans@bedford.net>
Subject: Re: Substitute without exceeding a defined string length
Message-Id: <3497eb7d.0@news3.paonline.com>

Dirk Kassner <kassner@intershop.de> writes: > Salute
> 
> I want to quote some sql wildcards in a string for a sql query:
> 
>     my ($SqlParameter) = 'Roedel_Doedel%';
> 
>     $SqlParameter =~ s/([_%\^\[\]])/[$1]/g;  # results in
> 'Roedel[_]Doedel[%]'
> 
> But the result of this substitution should not exceed a defined length,
> that means, I want do all possible replacement and interrupt if the
> length is reached
> (to leave more wildcards unquoted)
>...

This might be  only slightly less ugly than your substring solution:

-Tom

####################################################### 

@SQLParameter = split(//, 'Roedel_Doedel%');
$max = 15;

$len = $#SQLParameter;

foreach $x (0..$#SQLParameter) {
  ( $len < $max ) || last;
  ($SQLParameter[$x] =~ s/([_%\^\[\]])/[$1]/) && ($len += 2);
}

$SQLParameter = join ('',@SQLParameter);

print $SQLParameter;

########################################################


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

Date: Wed, 17 Dec 1997 12:48:44 -0600
From: Shawn Tolivar <shawn@wwgv.com>
Subject: targeting a frame window with perl
Message-Id: <34981E8B.83BA10E6@wwgv.com>

is there a way to use perl to target an html frame without using the <a
href> tag?



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

Date: Wed, 17 Dec 1997 11:41:46 -0500
From: "Jack H. Ostroff" <jack_h_ostroff@groton.pfizer.com>
Subject: Re: Teaching programing
Message-Id: <349800CA.8DD@groton.pfizer.com>

Janos Blazi wrote:
> 
> I have to teach programing to 15-years old pupils. Is PERL a good language
> to start with? Our "authorities" seem to prefer PASCAL, but PASCAL seems to
> be absolutely dead and the first steps in PERL are perhaps easier than the
> first steps in C. Or should I take BASIC (oh horror!)?
> 
> THIS IS NOT A JOKE!
> 
> Janos Blazi
> (jblazi@wuerzburg.netsurf.de)

Hopefully you are really trying to teach them programming, and not
teaching them
to write programs.  As many others have pointed out, PASCAL is well
designed for 
teaching.  The point is not teaching any particular language - it is
teaching
how to choose a language for a particular task, and how to best use
whatever
language is chosen, even if it is not the best.  Data structures and
control
structures are far more important than what type of brackets or whether
the 
"if" goes before or after.  It is essential to understand what you are
doing, 
and the various possible ways of doing it.  I know much of the
frustration I have
with reading this group is seeing questions about why perl is failing or
giving
an error message, when it is clear that the author doesn't have a real
grasp of
what s/he is really trying to do.  Perhaps you can even include a taste
of several
languages in the course, just to give a hint of what's in the real
world.

Good luck, and do let us know what you finally decide.

Jack (jack_h_ostroff@groton.pfizer.com)


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

Date: Wed, 17 Dec 1997 11:30:16 -0500
From: "Jack H. Ostroff" <jack_h_ostroff@groton.pfizer.com>
Subject: Re: Teaching programing
Message-Id: <3497FE18.32AB@groton.pfizer.com>

Tushar Samant wrote:
> 
> merlyn@stonehenge.com writes:
> >paper before that, and hacked my HP-41C a bit.  (I'm probably dating
> >myself here... but if I don't, who will? :-)
> 
> Dang! So Perl doesn't get you dates either!
> 
> Foiled again!

(I suppose I could be shot for this but...)
Aren't there several modules (on CPAN, of course) you can use to get and 
manipulate dates?  :-)


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

Date: Wed, 17 Dec 1997 14:38:31 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Wacky idea: a PERL server
Message-Id: <678o3v$ub$1@cyprus.atlantic.net>

According to Dave Sill <dsill@sws5.ctd.ornl.gov>:
>Perl is nifty, but it's just too expensive to start up a new perl
>process to handle a quick job like munging/matching mail/news headers
>on a busy SMTP/NNTP server. Has anyone ever thought about the
>possibility of running perl in a client/server mode ...

That would open up a whole metric ton of worms WRT security.

Much better to figure out how to reduce the startup time.
-- 
Chip Salzenberg               - a.k.a. -               <chip@pobox.com>
|| Perl Training from Stonehenge Consulting Services: (503) 777-0095 ||
         "Aarrrr!  Sixteen men on a dead Dodge Dart!"  // MST3K


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

Date: 17 Dec 97 19:44:28 GMT
From: bgjohnso@unix.amherst.edu (Brad Johnson)
Subject: Re: What's your favorite UNIX pl-db?
Message-Id: <34982b9c.0@amhnt2.amherst.edu>

twod@not.valid wrote:
: Brad Johnson (bgjohnso@unix.amherst.edu) wrote:
: : The shql module seems to be nice, but how do I implement that
: : in Perl?  How do I construct an equivalent to the DB->SQL command
: : in ODBC?  Can the ODBC.pm module be used in Unix on text files?

: I'm not an ODBC fan, so ..

: Are you aware of the DBI and DBD-<insert several unix dbs here> modules ?

: Have a peek at www.hermetica.com for moredetails.

Thanks.  This looks exactly like what I need.
I have a feeling I'm going to subscribe to the mailing list now.

--bradj.
------------------------Nullus Oppidenda Est--------------------------
brad johnson (bgjohnso@unix.amherst.edu)    'Disc, God, Country, Pork'
http://www.amherst.edu/~bgjohnso/             'Chickens! No Cynics!'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


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

Date: Tue, 16 Dec 1997 23:19:35 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: where did the newline come from?
Message-Id: <7dn776.sc4.ln@localhost>

brian d foy (comdog@computerdog.com) wrote:

[snip]

: but i would have done something like:

:       $num_date  = m/^(\d+)/;
                   ^
                   ^ typo here. Should be  =~


:    my $num_month = $1;

: so that the original input is unchanged, and the program flow is a bit
: more clear.


That's OK if $num_date has already been proven to start with digits
(ie. it is guaranteed to match).

If it doesn't start with digits, then $num_month will get $1
from the _previous_ match. 

That might be Not Good  ;-)



[ Randal pointed this out to me once. 
  Since then, I manage to remember it most times.
]


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


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

Date: 17 Dec 1997 19:08:55 GMT
From: framness@EMIRATES.NET.AE (Mark Framness)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <679807$8gm@ws1.emirates.net.ae>

In message <34958D16.190C@gsg.eds.com> - "Shmuel (Seymour J.) Metz"
<nospam@gsg.eds.com>Mon, 15 Dec 1997 12:03:34 -0800 writes:
#>

#>> C provides the needed primitives to do anything you need.  
#>
#>You got this wrong; C does not have the needed primitives to handle
#>sets, do string matching, do record-oriented I/O, etc., except in the
#>trivial sense that anything can be simultated on anything else.

What do you mean sets?  As in the mathematical sense?  String matching?  Huh? 
what do strcmp, strstr etc do?

It seems to me that the first statement is accurate.  You just have to do more
work in C & C++ to do the same things in other languages.


Take Care!

postmaster@[127.0.0.1]  
Spam booby trap!!!

FROM:  Mark Allen Framness
HOME:  framness@.NO_SPAM.EMIRATES.NET.AE
WORK:  m477@NO_SPAM.ugru.uaeu.ac.ae
HTTP:  http://netnet.net/~farmer/index.html

URL for comp.lang.c NG:  http://www.eskimo.com/~scs/C-faq/top.html

To reply via e-mail, delete the given reply to address and delete the NO_SPAM
from the above addresses.
					&
All standard disclaimers apply.  Anyone who says otherwise is itching for a
fight.



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

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

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