[7715] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1341 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 19 06:17:51 1997

Date: Wed, 19 Nov 97 03:00:31 -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, 19 Nov 1997     Volume: 8 Number: 1341

Today's topics:
      Re: Solaris & Irix Satan  surabaia@hotmail.com
     Re: 2 quicks questions, really <zenin@best.com>
     Re: Atomic operations (was Re: exclusive file rights) (Jeremy D. Zawodny)
     cgi newbie stuck... <flare@mindless.com>
     Check and automatically send a zip <tufgar@golden.net>
     Re: Check and automatically send a zip (Abigail)
     Re: Connecting to Oracle twod@not.valid
     Re: exclusive file rights (Jeremy D. Zawodny)
     help : installing perl 5.004 on Linux 2.0.0 <stephane.cohen@vz.cit.alcatel.fr>
     Re: how do i append todays date to the end of a filenam (Tina Marie Holmboe)
     Re: How many elements in a %HASH ? <usenet_post@bradfitz.com>
     Re: How to retrieve a .gif-file from a website? <zenin@best.com>
     Re: I want to count the number of same items on a list! (Jeremy D. Zawodny)
     ignore above... <flare@mindless.com>
     Re: Initiating Write from a CGI (Tina Marie Holmboe)
     Re: Looking for flat database modules... <zenin@best.com>
     Re: modules, ignoring Tom Phoenix (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: split problems <wtansill@erols.com>
     Re: PerlScript under WinNT (Jeremy D. Zawodny)
     Re: Q: How many elements in a %HASH ? <zenin@best.com>
     Re: question on perl runtime (Jeremy D. Zawodny)
     Re: Returning a hash from an XSUB? <zenin@best.com>
     Re: Returning information from an nslookup ?? (Jeremy D. Zawodny)
     Re: returning value of executed program <tex@collegenet.com>
     Re: Searching a WORD 6 DOC by line line number (Jim Michael)
     Searching for cgi-script for redirect from one domain t <hubert.nelke@cww.de>
     Re: sequence point? <bnelson@netcom.com>
     Sorting datas in hash of arrays <gigabyte@generation.net>
     Re: split problems <wtansill@erols.com>
     Split <cadavis@spam.eos.ncsu.edu>
     Re: What's the difference between AnyDBM_File and GDBM_ <zenin@best.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 19 Nov 1997 04:22:09 -0600
From: surabaia@hotmail.com
Subject:  Re: Solaris & Irix Satan 
Message-Id: <879934503.1593@dejanews.com>

In article <64hg91$4os$1@bone.globalone.no> art@kether.broomstick.com

>You must have a very old version of S.A.T.A.N.  Get a newer one from
>wietse's site ftp.win.tue.nl  The error is because the script expects
>perl 4, and you have perl 5 on the systems.

Just downloaded Satan 1.1.1 from Wietse's site. Running against
Perl 5.004_02 and Netscape 3.0 the problem IS still there.
I even tried to remove all "mailto:" from the source, to no avail:
the problem just shows up in another place. Is there any hope that
downgrading to Perl 5.003 could fix the problem?

Thank you in anyway.

-------------------------------------------------------------------
> Error message from Netscape 3.0:
>
> syntax error at /tmp/MO...pl line 2, near "HEAD>"
> Bareword found where operator expected at /tmp/MO...pl line 3, near
> "<TITLE>Initialization"
> (Missing operator before SATAN?)
> In string, @fish now must be written as \@fish at /tmp/MO...pl line
> 3, near "TITLE>

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


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

Date: 19 Nov 1997 10:49:16 GMT
From: Zenin <zenin@best.com>
Subject: Re: 2 quicks questions, really
Message-Id: <879936709.772681@thrush.omix.com>

Alan <ahecker@interport.net> wrote:
: Now, I've been having a hell of a time trying to get this to work out.
: First, I tried:
: ($loop, $b, $text, $t) = (\d)\:\\(\w)(.*)\\(*);

	Close, you need to delimit the regular expression:

	($loop, $b, $text, $t) = m/(\d)\:\\(\w)(.*?)\\(*)/;

	Or, better yet, to comment it nicely for later:

	($loop, $b, $text, $t) = m{
	    (\d)        # loop
	    \:\\(\w)    # B
	    (.*?)       # text
	    \\(*)       # T
	}x;

	Hope this helps!

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 19 Nov 1997 01:52:14 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Atomic operations (was Re: exclusive file rights)
Message-Id: <347b45d5.80815496@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Tue, 18 Nov 1997 13:54:23 -0600, Cameron Dorey
<camerond@mail.uca.edu> wrote:

>James Richardson wrote:
>> 
>> [snip]
>> The test for the file, and the subsequent creation of the file
>> is not an
>> atomic action. This is undergrad 1st year stuff...
>[detailed 1st yr undergrad stuff snipped]
>
>James, thank you (and Jeremy, thank you for your email explaining atomic
>processes), now, how would I know what processes on a Win95 machine are
>atomic, i.e., where would I look, not so much gimmee the answer (but if
>you want to tell me, who am I to argue)?

To be honest, I'm not sure which operations on the Win32 platform are
atomic. I'd guess that you'd need to look in some of the Microsoft
documentation for the Win32 API or something similar.

HOWEVER, you may be in luck.

If you use flock() on a Win32 system it appears to work right. [Note
that I've only *tested* this on NT, but I suspect it works on 95 as
well.]

Using flock(), you can lock the files that you need to mess with.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 19 Nov 1997 17:42:47 +0800
From: "winston khoo" <flare@mindless.com>
Subject: cgi newbie stuck...
Message-Id: <64uca9$2en$1@newton.pacific.net.sg>

    i'm struck with the following msg appears when i submit the form...

403 Forbidden

Your client does not have permission to get URL /cgi/Webimport.pl from this
server.


Help is greatly appreciated!





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

Date: Tue, 18 Nov 1997 20:37:45 -0500
From: The Tufgars <tufgar@golden.net>
Subject: Check and automatically send a zip
Message-Id: <347242E8.DED52F59@golden.net>

I'm trying to write a perl script so that if everything checks out, perl
will automatiaclly start sending a zip to a persons browser without them
having to click on a link to recieve the file.  How would I do this?



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

Date: 19 Nov 1997 03:13:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Check and automatically send a zip
Message-Id: <slrn674me6.kcu.abigail@betelgeuse.wayne.fnx.com>

The Tufgars (tufgar@golden.net) wrote on 1541 September 1993 in
<URL: news:347242E8.DED52F59@golden.net>:
++ I'm trying to write a perl script so that if everything checks out, perl
++ will automatiaclly start sending a zip to a persons browser without them
++ having to click on a link to recieve the file.  How would I do this?

Try ESP.


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|(11+?)\1+$/'


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

Date: 19 Nov 1997 09:13:59 GMT
From: twod@not.valid
Subject: Re: Connecting to Oracle
Message-Id: <64uakn$lg8$5@vnetnews.value.net>

: I think he's short a compiler, in which case he needs to join the dbi-users
: mailling list and ask for a binary. The mailling list is described in the
: README.

Has anyone tried to use a port of the gcc compiler for win32, such as the 
cygnus port  to compile such modules ?

I've always used VC++, but would be interested in hearing any experiences 
people have has of to compile DBI/DBD-Oracle modules with a win32
port of gcc.

In the meantime, maybe I'll download a copy myself ..

IAP

--
You have mistakenly entered section 26 of disinformation superhighway 9.
Monitored by Main F[ao]rce Patrol. Fatalities this year = 57. Leave now.
I am using anti-spam measures, please replace 'not.valid' with 'value.net'


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

Date: Wed, 19 Nov 1997 03:10:27 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: exclusive file rights
Message-Id: <348157ea.85444823@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Wed, 19 Nov 1997 01:33:06 GMT, syarbrou@ais.net (Steve) wrote:

>So where are we at here.  Will flock(fileheader, #) work?  In my
>implementations of it on a Sun machine, it does not seem to work.  My
>site gets about 30,000+ hits a day.  If I set flock(DATA,2) || print
>DATA2 "Error";, it never prints error to the file.  This would make me
>assume the file lock is never working.  Does the above logic hold?  I
>still end up with empty logs and stuff using flock(), so I have to
>assume if a local copy of the script works, but a live one will clear
>itself in a matter of minutes to an hour, that I am still getting
>collisions.

The recent discussions on this topic have prompted me to post a patch
to the perlfunc documentation for flock(). The intent of my patch is
to be more clear about the danger of assuming that flock() magically
locks files.

Right now, the proposed addition looks like this:

---

On many platforms (including most versions or clones of Unix), Locks
established by flock() are B<merely advisory>.  This means that files
locked with flock() may be modified by programs which do not also use
flock().  Windows NT and OS/2, however, are among the platforms which
supply mandatory locking.  See your local documentation for details.

---

But it is currently being hashed out among the Perl5-Porters.

Somehow we need to get across the point that file locking isn't as
easy as it might seem...

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 19 Nov 1997 09:02:46 +0100
From: Stephane Cohen <stephane.cohen@vz.cit.alcatel.fr>
Subject: help : installing perl 5.004 on Linux 2.0.0
Message-Id: <34729D25.4850@vz.cit.alcatel.fr>

Help !

I cannot "make" perl 5.004_4 whith "dynamic loading" option on my Linux
machine (gcc 2.7.xx).

The Configure phase wanted a "libdl.so" for linking that I can't find.

I think this the origin of my problem, but I can't find any "libdl.so"
in 
ftp://tsx-11.mit.edu:/pub/linux/packages/GCC/

Can anyone send me any tips ?

Thanks.

stephane.cohen@vz.cit.alcatel.fr


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

Date: 19 Nov 1997 10:43:48 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: how do i append todays date to the end of a filename?
Message-Id: <64uft4$kb0$4@news1.sol.no>

In article <34727D18.8C0063A3@technologyxchange.com>,
	Andrew Ellerton <andrewe@technologyXchange.com> writes:

> Portable Shmortable. The man just wanted to get the date and append it
> to a string for goodness sake.  Who said anything about making sure it
> works on every damn UNIX system or non-UNIX system...

  Asking or not asking; there is a virtue in giving answers that _are_
portable. After all, if is not all that hard - Tom gave one quite nice,
and short, answer which should cover most instances. Andrew gave another.
Here is yet a third:

 $Timestamp = sprintf("%02d%02d_%02d%02d",  (localtime(time))[2,1,3,4,5]) ;


  Abit more verbose, but creating a timestamp which should be fairly
portable. Even under DOS, where 8+ filenames are rather frowned upon, this
would degrade rather nicely.

--
 Tina Marie Holmboe                          tina@mail.scandinaviaonline.se

 The opinions expressed above are mine, and should in no way or under any
 circumstances be associated with Scandinavia Online AB unless this disclaimer
 is explicitly revoked. Not that they'd want to.... >:)


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

Date: Tue, 18 Nov 1997 18:57:16 -0800
From: "Brad Fitzpatrick" <usenet_post@bradfitz.com>
Subject: Re: How many elements in a %HASH ?
Message-Id: <64tkhl$9pt$1@glisan.hevanet.com>

>is there a simple way to tell how many elements a hash holds?

    #!/usr/bin/perl
    %myhash = ('key1' => 'value1',
               'key2' => 'value2'  );

    print scalar(keys %myhash);


No doubt there are other ways but this is better than what you were doing.


Hope this helps,
Brad

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"If I had something witty to say it would go here." - me
 Brad Fitzpatrick, bradfitz@bradfitz.com
 http://www.bradfitz.com/




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

Date: 19 Nov 1997 10:14:34 GMT
From: Zenin <zenin@best.com>
Subject: Re: How to retrieve a .gif-file from a website?
Message-Id: <879934627.420075@thrush.omix.com>

Calle <rowanfan@algonet.se> wrote:
: Hi, I wonder if it's possibly with the libwww to retrieve binaryfiles,
: for example a gif-image?
: how is it done?

	RTFM...boy some of you people are lazy... :-/

	use LWP::Simple;

	$myGifData = get "http://www.somehost.com/foobar/image.gif"
	    or die "Can not get image.gif!";

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 19 Nov 1997 02:00:16 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: I want to count the number of same items on a list!
Message-Id: <347d4809.81379828@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Tue, 18 Nov 1997 18:09:52 -0500, Jetumele <jetumele@microtec.net>
wrote:

>Hello, PLEASE HELP ME!!! :)
>
>    I want to count the number of same items on a list!  exemple:
>
>
>I have a list like:
>
>apple
>banana
>orange
>apple
>appel
>orange
>banana
>apple
>...

Store them in a hash.

You may benefit from a read of the Perl FAQ (found on www.perl.com).
This question is explicitly covered there.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Wed, 19 Nov 1997 18:10:03 +0800
From: "winston khoo" <flare@mindless.com>
Subject: ignore above...
Message-Id: <64udtd$3tg$1@newton.pacific.net.sg>

i got the perismission done....but i still encounter this error when i
submit my form :(
anything wrong wiff the script file?
or my web server doesn't support scripting?




500 Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, flare@mindless.com and inform them
of the time the error occurred , and anything you might have done that may
have caused the error.
Error: HTTPd: malformed header from script
/usr/local/etc/httpd/htdocs/infofax/cgi/Webimport.cgi



begin 666 Webimport.pl
M(R$O=7-R+V)I;B]P97)L#0HC(&-H96-K(&9O<B!T:&4@4$]35"!M971H;V0-
M"FEF("@D14Y6>R=215%515-47TU%5$A/1"=](&5Q("=03U-4)RD-"@T*>PT*
M(" @(",@2&]W(&UA;GD@8GET97,@87)E('=E('-U<'!O<V5D('1O(')E8V5I
M=F4_#0H@(" @<F5A9"A35$1)3BP@)&)U9F9E<BP@)$5.5GLG0T].5$5.5%],
M14Y'5$@G?2D[#0H@(" @(R!M86ME(&$@;&ES="!O9B!K97EW;W)D+W9A;'5E
M('!A:7)S#0H@(" @0'!A:7)S(#T@<W!L:70H+R8O+" D8G5F9F5R*3L-"B @
M(" C(&-Y8VQE('1H<F]U9V@@96%C:"!P86ER(&%N9"!D96-I<&AE<B!T:&4@
M=F%L=65S#0H@(" @9F]R96%C:" D<&%I<B H0'!A:7)S*0T*#0H)>PT*(" @
M(" @(" C(&=E="!T:&4@;F%M92]V86QU92!P86ER('-T<FEN9W,-"B @(" @
M(" @*"1N86UE+" D=F%L=64I(#T@<W!L:70H+STO+" D<&%I<BD[#0H@(" @
M(" @(",@=')A;G-L871E("(K(B!T;R!A('-P86-E#0H@(" @(" @("1V86QU
M92 ]?B!T<B\K+R O.PT*(" @(" @(" C(&1E8VEP:&5R($%30TD@:&5X:61E
M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;VYE(&ES(&9R;VT@
M5&]R<F%N8V5<;B([#0H@('T-"G!R:6YT($U!24P@(EQN(CL-"B-P<FEN="!-
M04E,(")2=6X]8SI<9V]L9&UI;F5<=V5B:6UP+F5X95QN(CL-"G!R:6YT($U!
M24P@(EQN(CL-"G!R:6YT($U!24P@(EQN(CL-"G!R:6YT($U!24P@(EQ;1&%T
M85Q=7&XB.PT*(R!P<FEN="!O=70@9V5N97)A;"!F:65L9',@86YD('9A;'5E
M<PT*9F]R96%C:" D;F%M92 H<V]R="!K97ES("5C;VYT96YT<RD@>PT*(" @
M(&YE>'0@:68@)&-O;G1E;G1S>R1N86UE?2!E<2 B(CL-"B @("!P<FEN="!-
M04E,("(D;F%M92 ]("1C;VYT96YT<WLD;F%M97U<;B([#0I]#0IP<FEN="!-
M04E,(")<;B([#0IP<FEN="!-04E,(")<6T-O;G13=7!P7%U<;B([#0H-"B,@
M<')I;G0@;W5T('!R;V9I;&4O8V]N='-U<' @9FEE;&1S(&%N9"!V86QU97,-
M"F9O<F5A8V@@)&YA;64@*'-O<G0@:V5Y<R E8W-A<G)Y*2![#0H@(" @;F5X
M="!I9B D8W-A<G)Y>R1N86UE?2!E<2 B(CL-"B @("!P<FEN="!-04E,("(D
M;F%M92 ]("1C<V%R<GE[)&YA;65]7&XB.PT*?0T*<')I;G0@34%)3" B7&XB
M.PT*<')I;G0@34%)3" B7&XB.PT*#0IP<FEN="!-04E,(")<;B([#0IP<FEN
B="!-04E,(")<;EQN(CL-"F-L;W-E("A-04E,*3L-"GT-"@``
`
end



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

Date: 19 Nov 1997 10:48:21 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: Initiating Write from a CGI
Message-Id: <64ug5l$kb0$5@news1.sol.no>

In article <346AF242.26AB@icl.fi>,
	Petri Backstrom <petri.backstrom@icl.fi> writes:

>    unless( open( FILE, ">afile.txt" ) ) {
>       print "open failed: $!\n";
>    }

  This one, perhaps with an added:

     print "Content-Type: text/html\n\n" ;

  before the print() is _definetly_ to be advised. die() is a Bad Thing
when writing CGI scripts....



> 100:1 that it is a file/directory permission problem. ;-)

  No takers from here :)



>   http://languafe.perl.com/faq/index.html

  Need I say it ? Whilst Perl is a nice language, I doubt that it even
classifies as a languafe ....


--
 Tina Marie Holmboe                          tina@mail.scandinaviaonline.se

 The opinions expressed above are mine, and should in no way or under any
 circumstances be associated with Scandinavia Online AB unless this disclaimer
 is explicitly revoked.


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

Date: 19 Nov 1997 10:02:48 GMT
From: Zenin <zenin@best.com>
Subject: Re: Looking for flat database modules...
Message-Id: <879933922.349191@thrush.omix.com>

[ posted & mailed ]

John Robson <as646@FreeNet.Carleton.CA> wrote:

: I'm looking for a FLAT database module that would hopefully do at least the
: following :
	>snip<

	Check out the 'Sprite' module at your local CPAN.  I think
	everything you asked for but file locking is supported, but that's
	trivial to add to your code.

	I haven't used it, so I have _no_ idea how good it is, or is not.

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 18 Nov 97 21:36:38 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: modules, ignoring Tom Phoenix
Message-Id: <347250f4$4$ofn$mr2ice@speaker>

In <347944da.80564345@woody.wcnet.org>, on 11/19/97 at 01:48 AM,
   jzawodn@wcnet.org (Jeremy D. Zawodny) said:
+-----
| You see, some believe that Tom isn't actually a person, but he is in fact a
| very smart Perl script that is able to recognize and answer commonly asker
| Perl questions[1].
| [1] Actually, I met Tom at the Perl conference this Summer. :-)
+--->8

So?  Did anyone else, or have you simply demonstrated that *you* may be a Perl
script?  :-)

-- 
brandon s. allbery           [Team OS/2][Linux][JAPH]        bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                  KF8NH
"Never piss off a bard, for they are not at all subtle and your name scans to
 `Greensleeves'."  ---unknown, quoted by Janet D. Miles in alt.callahans



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

Date: Wed, 19 Nov 1997 00:19:05 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: split problems
Message-Id: <347276C9.1115@erols.com>

Wim Verhaegen wrote:
> 
> Hi you Perl friends,
> 
> I am facing the following problem: I need to parse a file containing
> lines like
> 
> mxxx a b c d e  par1=val1  par2=val2  attr3  par4 = val4 attr5
> 
> The mxxx a b c d e part is compulsory, so I got the idea to use split to
> 
> parse this line. However the remaining of the line uses a different
> syntax, with the assignment to parameter fields and single attributes
> freely mixed.
> This makes the task a lot more difficult.
> 
> In the following, I always use the example
> m1 a b c d e foo=5 bar=6 foobar pi=3.1415
> 
> I have tried stuff like this:
> 
> ($name, $a, $b, $c, $d, $e, @pars) = split /\s+|(\w+\s*=\s*\w+)/;
> 
> which will include the par=val fields in the list as they are considered
> as
> parenthesized delimiters. The resulting list is however interspersed
> with
> undef's (even more than I expected after reading the explanation of
> split
> in the Camel book).
> 
> So I try to remove the undef's with:
> 
> ($name, $a, $b, $c, $d, $e, @pars) =
>     grep { defined; } split /\s+|(\w+\s*=\s*\S+)/;
> 
> but end up with a bunch of empty fields in the result
> 
> Could someone please explain this to me?
> 
> So I than closed my eyes and tried
> 
> ($name, $a, $b, $c, $d, $e, @pars) =
>     grep { defined && !/^\s*$/; } split /\s+|(\w+\s*=\s*\S+)/;
> 
> in order to find out that it works!! The frustrating part is of course
> that I do not understand the need for such overkill.
> 
> This brings me to my second question. It would be a lot easier if
> I could
> split off a part of a string, and get the remainder of the string which
> split has not looked at (or at least the starting position of the
> remainder).
> 
> Any idea how this can be accomplished?
> 
> Thanks in advance.
> 
> Wim Verhaegen
The Camel book mentions that you can pass split a 3rd parameter which
tells it when to stop splitting.  I would use this funcitonality to
split out the first 6 fields, assigning the rest to the (scalar
variable) $sTheRest (or somesuch -- whatever your naming convention
requires).  Now use foreach and split on the var $sTheRest.


-- 

How do I set my laser printer to "stun"?


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

Date: Wed, 19 Nov 1997 02:10:19 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: PerlScript under WinNT
Message-Id: <347e48aa.81540679@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Tue, 18 Nov 1997 11:11:49 -0700, Neil McKellar
<mckellar@cs.ualberta.ca> wrote:

Please do *not* post to comp.lang.perl. It's a dead newsgroup and has
been for over 2 years. Please ask your newsadmin to remove it. Also,
this message doesn't belong in comp.lang.perl.modules, because it has
nothing to do with Perl modules. I've set the follow-up accordingly.

>I have installed Perl for Win32 on a Pentium WinNT 4.0 box (no problems
>there).  I have *tried* to install PerlScript (PerlSE) from ActiveState
>on the same box with significantly less success.

You're not alone. Many folks have had trouble getting PerlScript to
work properly. Recent builds (>309) appear to be a bit more stable in
this respect.

>Currently, the box in question has the appropriate OSRs, running IIS3.0,
>and FrontPage97.  I had IE3.0 but it kept displaying the PerlScript
>*code* rather than running it.  I thought it was kludged and so I
>installed IE4.0 (just the browser).  It doesn't display the code
>anymore, but it still doesn't execute it.

Woah!

If you believe that the *browser* is supposed to run your code, you
have a fundamental misunderstanding of how CGI scripts work!

The *server* executes CGI scripts, which output HTML, which is
returned to the browser, which is rendered on-screen for you.

 Browser Requests Document
 Server Runs Script, Outputs HTML
 HTML Returned to Browser

NOT:

 Browser Requests Document
 Script Downloaded to Browser
 Browser Runs Script

>I'm assuming (based on past experience) that I need to tweak something
>in the Registry to get PerlScript to be recognized by the system. 

The installation routines to most of that for you.

>Simple comparison with the VBScript keys doesn't reveal what the magic
>involved would look like.

Check Microsoft's Knowledge Base. Search for "Perl" in the IIS
section, and you'll find the relevant article.

If I was at work, I could send you the exact info, but it's something
like this:

HKEY_LocalMachine\
 Services\
  CurrentControlSet\
   W3SVC\
    Parameters\
     ScriptMap\
      .pl => c:\perl\bin\perl.exe %s


>The general lack of docs is getting me down.  If you know of a helpful
>website for trouble shooting, or if you can offer assistance, please
>e-mail or post here.  I'll be watching this subject heading.

Web sites:

 http://www.perl.com/ (Perl in general)
 http://www.activestate.com/ (Win32 Perl)
 http://www.microsoft.com/kb/ (Microsoft Knowledge Base)

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 19 Nov 1997 10:32:35 GMT
From: Zenin <zenin@best.com>
Subject: Re: Q: How many elements in a %HASH ?
Message-Id: <879935709.291252@thrush.omix.com>

Greg Bacon <gbacon@adtran.com> wrote:
: An efficient solution would be
:     my $k;
:     my $count = 0;
:     $count++ while ($k, undef) = each %hash;

	Or even shorter and (a clock tick or so) faster:

	my $count = 0;
	$count++ while (each %hash);

	>snip<
: Using each, you keep at most two scalars at a time.

	Or, just one. :)

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 19 Nov 1997 01:58:56 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: question on perl runtime
Message-Id: <347c472a.81156306@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Tue, 18 Nov 1997 12:55:51 -0800, am026@fritz.com (Allan Manayan)
wrote:

>hello,
>
>	i need an explation on how perl codes are run under a unix environment.  our
>sys admin keeps saying that scripting languages like perl just take too much memory
>to run.  does shell script have the same memory requirements as perl.
>
>	any response would be appreciated and please email your response to

This won't *totally* answer your question, but you may want to read
over:

  http://www.perl.com/CPAN-local/doc/FMTEYEWTK/comp-vs-interp.html

Also, the best thing to do is to demonstrate (to yourself and your
sysadmin) how much memory Perl really does take for the task you're
trying to accomplish.

My guess is that one of you will be surprised.

Also, another interesting reference is at:

 http://www.sunlabs.com/people/john.ousterhout/scripting.html

Something tells me that you could get some useful ammunition out of
that document. And if you can convince your sysadmin to read it, s/he
may benefit as well.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 19 Nov 1997 10:21:23 GMT
From: Zenin <zenin@best.com>
Subject: Re: Returning a hash from an XSUB?
Message-Id: <879935036.994172@thrush.omix.com>

Bob Rogers <rogers@zephyr.instrumental.com> wrote:
: The way to do this is:
	>snip<
: What happens to the XSUB hash?

	It gets garbage collected after the call.

: Is there a possible memory leak?

	No.

: (I'd still like to know about an XSUB returning a hash rather than a
: hash reference.)

	Hmm, I haven't played with XS yet, but do you know how to return
	a list?  Do you know how to convert a hash to a list in XS?  If
	you know both of the above, I'd think you'd be able to convert
	the hash to a list and return it like a normal perl sub does.

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 19 Nov 1997 02:20:40 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Returning information from an nslookup ??
Message-Id: <347f4c8e.82536691@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On 19 Nov 1997 01:01:09 GMT, burt@ici.net (Burt Lewis) wrote:

>Hi,
>
>I'm capturing IP's using "$ENV{'REMOTE_HOST'} from an SSI page. 
>
>I want to then do an nslookup to capture the domain as a variable that I can read back to the 
>webpage and write to file.
>
>I have this but I don't know how to return the answer.
>
>print "Content-type: text/html\n\n";
>
>
>system "nslookup 207.180.0.20";

Ouch!

Rather than spawn of a sub-process to do that each time, you may want
to look at something like the Net::DNS module on CPAN. Or maybe the
gethostbyaddr() function.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Tue, 18 Nov 1997 18:38:05 -0800
From: Austin Schutz <tex@collegenet.com>
Subject: Re: returning value of executed program
Message-Id: <3472510D.29CA@collegenet.com>

> 
> what's a poser?
> 
	Well, when I was in grade school a poser was some sort of insult. Of
course, this was the time period when showing someone up was referred to
as a 'facial', which involved a particularly bizarre form of hand
gesture. I think either you or his code is being insulted.

	Tex


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

Date: Wed, 19 Nov 1997 03:35:11 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Searching a WORD 6 DOC by line line number
Message-Id: <genepoolEJvJAn.GuM@netcom.com>

I know nothing about the internals of Word documents, but if I wanted to 
solve this problem I would look at a dump of a file to see what is used 
for the line breaks and other control characters. Debug is your friend.

Cheers,

Jim

Michael Farris (mhfarris@pangea.ca) wrote:
: I want to write a PERL script to read through a MS Word document and
: return a line number where a match occurs.

: The problem is the binary line breaks. How can I open the file into an
: array that can be read line by line.  I've tried out splitting on \m and
: a few others but I'm not sure what WORD uses for its line breaks.


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

Date: 19 Nov 1997 08:58:02 GMT
From: "D100WNTIE281" <hubert.nelke@cww.de>
Subject: Searching for cgi-script for redirect from one domain to a co-domian
Message-Id: <01bcf4c9$a68502f0$d96c6404@d100wntie281>

Hello,

I have the following problem !

I have two Domians on one IP-Adress and one server-area !
When someone goes to www.haltern.com it is the self Site as my Co-Domain
www.nelke.com. Is there a CGI-Script that redirect to the my Website
www.nelke.com/nelke when a user ask for www.nelke.com ?

Thanks ahead
 
Hubert Nelke

Goldstr. 5, D-45721 Haltern
E-Mail: hubert@nelke.com
Online: http://www.nelke.com/nelke


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

Date: Wed, 19 Nov 1997 03:08:59 GMT
From: Bob Nelson <bnelson@netcom.com>
Subject: Re: sequence point?
Message-Id: <64tl8b$5t3$1@renpen.nelson.org>

Tad McClellan <tadmc@flash.net> wrote:
> Bob Nelson (bnelson@netcom.com) wrote:
> : Is the behaviour of ``$i = 3; $i = $i++'' ^(un|implementation-)*defined$ 
> : in Perl?

> undefined
>   No (perl will issue an error message if it does not know what to
>       do when it encounters a construct)

> implementation-defined
>   Yes, most code (the perl intepreter, in this case) is defined 
>        by its implementation   ;-)

> unimplementation-defined
>   I dunno what that means

> implementation-undefined
>   ditto

Touche on the last two. Should've been a '?'. Oh well, back to Friedl's 
already well-worn book again. :)

> defined
>    Yes

> Why do you ask?

Primarily to compare and contrast ``darker corners'' of the Perl
language with similar constructs in that other language, wherein the
``i = i++'' (and its numerous kin) expression is circumscribed as 
undefined by ISO 9899:1990. Not having yet (ever?) been standardized 
(to the best of my knowledge) by an entity such as ANSI, I seek the 
answer here. The Perl documentation is devoid of such comforting 
legalistic ``standardese'' terms like ``shall'', ``sequence 
points'', ``order of evaluation''.

>     Tad McClellan                        
>     Fort Worth, Texas

For the record (and IMHO, of course), I appreciate the occasionally
ascerbic (and inevitably factually correct) responses posted by Mr.
McClellan to c.l.p.m. (It reminds me of the ``Golden Age'' of
comp.lang.c, before that newsgroup became a suburb of Mr. Roger's
neighborhood).  Also, I think it provides something of a public service
for image of the state of Texas. Far too frequently, residents of this
great _diverse_ state are prejudged to be obsequiously hospitable.
McClellan's postings show that not all Texas citizens are a bunch of
glad-handing, back-slapping, grinning ``ah shuckers''.

-- 
========================================================================
          Bob Nelson -- Dallas, Texas, USA (bnelson@iname.com)
             http://www.geocities.com/ResearchTriangle/6375
========================================================================


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

Date: Tue, 18 Nov 1997 21:56:23 -0500
From: "J.-F. Pelletier" <gigabyte@generation.net>
Subject: Sorting datas in hash of arrays
Message-Id: <34725556.D8C9C286@generation.net>

Hello all,

I have a hash of arrays. The keys are terms (strings) I'm looking for in
other strings with REs (in a different file) and the values are arrays
containing datas I'm looking for in an other file. I want to sort the
hash of arrays so the longuest strings (keys) will be match first before
the shortest ones. For example, if I have the expressions "long
expression" and "this is a very long expression" as keys in my hash, I
want to  look for the longuest key ("this is a very long expression")
before I test for the short one ("long expression"). I know that hashes
sort datas in a random order; is there any way to sort them in a
decreasing length order?

Many thanks to anybody who can help me...

Jean-Francois Pelletier
gigabyte@generation.net
or
jpelletier@alpnet.com



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

Date: Wed, 19 Nov 1997 00:19:05 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: split problems
Message-Id: <347276C9.1115@erols.com>

Wim Verhaegen wrote:
> 
> Hi you Perl friends,
> 
> I am facing the following problem: I need to parse a file containing
> lines like
> 
> mxxx a b c d e  par1=val1  par2=val2  attr3  par4 = val4 attr5
> 
> The mxxx a b c d e part is compulsory, so I got the idea to use split to
> 
> parse this line. However the remaining of the line uses a different
> syntax, with the assignment to parameter fields and single attributes
> freely mixed.
> This makes the task a lot more difficult.
> 
> In the following, I always use the example
> m1 a b c d e foo=5 bar=6 foobar pi=3.1415
> 
> I have tried stuff like this:
> 
> ($name, $a, $b, $c, $d, $e, @pars) = split /\s+|(\w+\s*=\s*\w+)/;
> 
> which will include the par=val fields in the list as they are considered
> as
> parenthesized delimiters. The resulting list is however interspersed
> with
> undef's (even more than I expected after reading the explanation of
> split
> in the Camel book).
> 
> So I try to remove the undef's with:
> 
> ($name, $a, $b, $c, $d, $e, @pars) =
>     grep { defined; } split /\s+|(\w+\s*=\s*\S+)/;
> 
> but end up with a bunch of empty fields in the result
> 
> Could someone please explain this to me?
> 
> So I than closed my eyes and tried
> 
> ($name, $a, $b, $c, $d, $e, @pars) =
>     grep { defined && !/^\s*$/; } split /\s+|(\w+\s*=\s*\S+)/;
> 
> in order to find out that it works!! The frustrating part is of course
> that I do not understand the need for such overkill.
> 
> This brings me to my second question. It would be a lot easier if
> I could
> split off a part of a string, and get the remainder of the string which
> split has not looked at (or at least the starting position of the
> remainder).
> 
> Any idea how this can be accomplished?
> 
> Thanks in advance.
> 
> Wim Verhaegen
The Camel book mentions that you can pass split a 3rd parameter which
tells it when to stop splitting.  I would use this funcitonality to
split out the first 6 fields, assigning the rest to the (scalar
variable) $sTheRest (or somesuch -- whatever your naming convention
requires).  Now use foreach and split on the var $sTheRest.


-- 

How do I set my laser printer to "stun"?


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

Date: Wed, 19 Nov 1997 00:43:52 -0500
From: "cadavis" <cadavis@spam.eos.ncsu.edu>
Subject: Split
Message-Id: <64tucq$hoj$2@uni00nw.unity.ncsu.edu>

 I have

Craig Davis|cdavis@cnp.net

and need to get

$user_name = "Craig Davis"
$user_email = "cdavis"
$userdomain = "cnp.net"

if you guys can help I'll be forever in your debt.

thanks in advance.
Craig Davis
Computer Network Power





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

Date: 19 Nov 1997 09:52:53 GMT
From: Zenin <zenin@best.com>
Subject: Re: What's the difference between AnyDBM_File and GDBM_File???
Message-Id: <879933327.96885@thrush.omix.com>

[ posted & mailed ]

Gil Vidals <vidals@etica-entertainment.com> wrote:
: I thought the two programs should give me the same output. Please
: explain what is going on here.

	Ok, but the -w switch should have already told you what is
	wrong.  The fact that it doesn't catch this is odd. -It didn't
	catch it on my system either.....bug? :-/

: use AnyDBM_File;
: @AnyDBM_file::ISA = qw(GDBM_File);
          ^^^^
	You've got a type-o here; That should be a capital 'F'.  Fix
	that and you should be ok.

	The reason that -w should have caught this is because the symbol
	is "only used once".  The fact it doesn't catch this (v5.00404)
	worrys me... :-/

-- 
-Zenin
 zenin@best.com


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1341
**************************************

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