[17360] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4782 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 1 06:05:27 2000

Date: Wed, 1 Nov 2000 03:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973076710-v9-i4782@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 1 Nov 2000     Volume: 9 Number: 4782

Today's topics:
    Re: "chown" of symlink instead of linked file (Villy Kruse)
    Re: + or - (Anno Siegel)
    Re: Array of Associative Arrays? (Eric Bohlman)
    Re: bad printf field width handling (Villy Kruse)
    Re: Bitreverse an integer (Logan Shaw)
    Re: Can prospective employer legally obtain your presen (Flavius Vespasian)
    Re: CGI Perl vs. Java Servlets... (Eric Bohlman)
    Re: Collecting data nobull@mail.com
        Compiling Perl 5.6 with ming 32 <fingerslip@yahoo.com>
    Re: Compiling Perl 5.6 with ming 32 <harris_m@yahoo.com>
    Re: Compiling Perl 5.6 with ming 32 <fingerslip@yahoo.com>
        Creating a new user in FreeBSD <s_h=t-i_r@astelit.ru>
    Re: cutting / parsing URLS out of a live HTML document <maartenh@usa.net>
        Do such a forum exist in language GERMAN? <sly@mailto.de>
        EOF Problem with ActivePerl 5.6.0.618 <liem@ctc.usyd.edu.au>
    Re: EOF Problem with ActivePerl 5.6.0.618 <esv@windoms.sitek.net>
    Re: EOF Problem with ActivePerl 5.6.0.618 (Eric Bohlman)
        Exe in CGI <r.fraser@student.murdoch.edu.au>
    Re: Exe in CGI nobull@mail.com
    Re: FormMail.pl with file attachment support? <jesusx@who.net>
    Re: Have I released all memory? <ianb@ot.com.au>
    Re: Net::SMTP and subject? (Logan Shaw)
    Re: OT: Re: Is there a more perlish way to write this? (Anno Siegel)
        Perl Script runs under WindowsNT and now under Linux no <email@marc-wapelhorst.de>
    Re: Perl Script runs under WindowsNT and now under Linu <carvdawg@patriot.net>
        Perl-5.6.0 and perl-5.005 <pierre@arraycomm.com>
    Re: pop: strange results and errors mark.c.hamlin@bt.com
    Re: pop: strange results and errors mark.c.hamlin@bt.com
    Re: Printing a perldoc (Logan Shaw)
    Re: Problem Passing Test With Msql-Mysql-modules-1.2215 <atrus@atrustrivalie.eu.org>
    Re: Quick question - Still new at this ! (Martien Verbruggen)
        running UNIX utilities in perl <r.fraser@student.murdoch.edu.au>
    Re: running UNIX utilities in perl (Chris Fedde)
    Re: running UNIX utilities in perl nobull@mail.com
        Script calling <apw4@mcs.le.ac.uk>
    Re: Script calling (Clay Irving)
    Re: Session or Sessionless? <bill.kemp@wire2.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 1 Nov 2000 08:20:35 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: "chown" of symlink instead of linked file
Message-Id: <slrn8vvkge.854.vek@pharmnl.ohout.pharmapartners.nl>

On 31 Oct 2000 15:25:16 -0500,
         Joe Schaefer <joe+usenet@sunstarsys.com> wrote:


>cfedde@fedde.littleton.co.us (Chris Fedde) writes:
>
>> 
>> From the Apache Doc:
>> 
>>     SymLinksIfOwnerMatch 
>> 	 The server will only follow symbolic links for which the
>> 	 target file or directory is owned by the same user id as
>> 	 the link.  
>
>IMHO, it's basically a gut check that prevents a local user from making 
>/etc/passwd available via ~luser/symlink_to_config_file .
>

Exactly!! or other sensitive files for that matter.

And because you can't chown the symlink itself it is proven that the
owner of the target is the same one that created the symlink.  The
alternative is that apache doesn't follow symlink at all to prevent
access to files which would not otherwise be available to the web
server.

BTW, on most system these days an average user cant chown anything at
all anyway.



Also, the way to change the owner of a symlink is to delete it and
create a new one while running as the proper user.



Villy


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

Date: 1 Nov 2000 11:02:32 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: + or -
Message-Id: <8tot88$iri$1@lublin.zrz.tu-berlin.de>

Richard J. Rauenzahn <nospam@hairball.cup.hp.com> wrote in comp.lang.perl.misc:
>"Jeff Yoak" <jeff@yoak.com> writes:
>>In article <39FEA572.6C2101E5@infineon.com>, "Caron Franck"
>>>
>>> This will work even if your var is not a number.But something like :
>>> 
>>> $a = ($a <0) ? -$a : $a;
>>> 
>>> will work for $a numerical but if a is not a number (i.e. $a = 'toto')
>>> you will have a runtime error message.
>>
>>I think both of these suggestions are really silly and better suggestions
>>are found elsewhere in this thread, but what runtime error message do you
>>receive and with what version of Perl?  That statement won't generate a runtime
>>error message with any perl I remember, which stretches back to 4.036 .
>>Did you actually try it?
>
>I just did -- did you try it with '-w'?

Warnings aren't errors.

Anno


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

Date: 1 Nov 2000 07:49:56 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Array of Associative Arrays?
Message-Id: <8tohv4$1gb7$3@news.enteract.com>

Kevin Michael Vail <kevin@vailstar.com> wrote:
> In article <39FE23EF.E8F32D8@ics.uci.edu>, RFT <fromhold@ics.uci.edu> 
> wrote:
>> 
>> I'm trying to access a single element of @DataMatrix via
>> 
>> $DataMatrix[$reccount]{"$token"}

> Then here you want

>     $DataMatrix[$reccount]->{$token}

The two are equivalent.  The first is syntactic sugar for the second.

> The double quotes are unnecessary around $token.

True.


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

Date: 1 Nov 2000 08:26:05 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: bad printf field width handling
Message-Id: <slrn8vvkst.854.vek@pharmnl.ohout.pharmapartners.nl>

On Tue, 31 Oct 2000 09:36:25 -0500, Fulko Hew <fulko@wecan.com> wrote:
>Can anyone tell me why:
>
>printf ("%c-\n", ' ');
>


Is that a C programmer's gotcha?  Whereas ' ' is an int in C it is
a string in perl; same as " ".

Think

printf ("%c-\n", " ");

in the C language.



Villy


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

Date: 1 Nov 2000 00:25:07 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Bitreverse an integer
Message-Id: <8tod03$8ek$1@provolone.cs.utexas.edu>

In article <vk0tvs0taci86r89ouh87gsbcrnkkj2ldd@4ax.com>,
Bart Lateur  <bart.lateur@skynet.be> wrote:
>Logan Shaw wrote:
>
>>>>	foreach $twiddle (@$twiddles)
>>>>		{
>>>>		$x = (($x & $twiddle->[0] >> $twiddle->[2])
>>>>			| ($x & twiddle->[1] >> $twiddle->[2]));
>>>>		}
>
>That ain't right. This uses ">>" twice, while it should be "<<" once,
>and ">>" once.
>
>>>Ah, dynamic twiddle generation, very promising concept.  It does
>>>bring back a lookup table though.
>>
>>I'll let you know when I come up with a closed form for
>>
>>	n-1
>>	__
>>	\    k
>>	/_  4
>>
>>	k=0
>>
>>Once I can do that, then I can create a bit string consisting of
>>alternating 1's and 0's, and I think I can build the rest of the stuff
>>easily enough on the fly from bitmasks.
>
>Closed form? Hmmm...
>
>	for(my $i=1; $i<32; $i<<=1) {
>	    my $acc = 1;
>	    for(my $j= 0; $j<32; $j += 2*$i) {
>	        $acc |= 1<<$j;
>	    }
>	    $acc *= (1<<$i)-1;
>	    printf "%032b %032b %2d\n", $acc, ~$acc, $i;
>	}
>-->
>01010101010101010101010101010101 10101010101010101010101010101010  1
>00110011001100110011001100110011 11001100110011001100110011001100  2
>00001111000011110000111100001111 11110000111100001111000011110000  4
>00000000111111110000000011111111 11111111000000001111111100000000  8
>00000000000000001111111111111111 11111111111111110000000000000000 16

Well, that's not really what I meant by closed form.  I meant, in
effect, something that wouldn't have to have a loop when implemented in
a language like Perl or C.  In other words, I wanted to get rid of
the summation.  I brought it up because

	n-1
	__
	\    k      n
	/_  2   =  2  - 1
	k=0

So, I thought maybe a similar solution might be possible for the one
involving 4 to the k, which would make it easy to compute masks like
01010101 in constant time.

Anyway, it is actually possible to do better when generating this with
a loop.  The inner loop can have be made to have O(log n) running time
with a little trick:

	$bit_width = 32;

	for ($repeat = 1; $repeat <= $bit_width >> 1; $repeat <<= 1)
		{
		$mask = (1 << $repeat) - 1;

		for ($i = $repeat << 1; $i <= $bit_width; $i <<= 1)
			{ $mask |= $mask << $i; }

		printf ("%032b %032b %2d\n", $mask, ~$mask, $repeat);
		}

If you use that for dynamically generating the bitmasks (in case of
different bit widths), it's still not that great, though, since it's
got an O(log n) loop inside another O(log n) loop, meaning it's
basically O(n), where n is the number of bits in the value you want to
reverse.  So, I still can't see how you can get rid of the lookup table
without the closed form solution I was talking about.

Personally, I guess I'm not that concerned, since a dynamically-created
lookup table can be cached, or you can even cache an anonymous sub that
is created by eval() for the bit width you need it for.

  - Logan


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

Date: Wed, 01 Nov 2000 05:29:17 GMT
From: noone9999999@aol.com (Flavius Vespasian)
Subject: Re: Can prospective employer legally obtain your present salary?
Message-Id: <NSNL5.8824$Pw6.528940@newsread1.prod.itd.earthlink.net>

In article <8scbp8$dnq$1@nnrp1.deja.com>, xochizen@my-deja.com wrote:
>
>
>(Perl folk, you, we, are world-renowned for our bullshit-detecting
>abilities, which is why I've also posted this to comp.lang.perl.misc)
>
>Can a prospective or future employer ever legally obtain one's salary at
>a present or previous job? (without one spilling the beans oneself). I
>was always under the impression that employers could do this themselves,
>or as part of an outsourced background check (in the United States).
>
>Goodness knows every other bit of personal data is available for a price
>from someone, somewhere - even medical records apparently. Grim.
>
>Is it legal for an employer, or an agent of an employer, or any third
>party corporation, to phone a past or present employer of mine and ask
>what I made? Or offer a range and ask if I was within it?
>
>Is it legal for my past or present employer to release this information?

No. 

The only thing they could do is estimate your salary through a credit check.

John - N8086N 
Big brother is watching. Disable cookies in your web browser.
-------------------------------------------
Wise man says "Never use a bank with the initials F. U."
-------------------------------------------
Are you interested in a professional society or
guild for programmers? Want to fight section 1706?


See www.programmersguild.org
Newsgroup: us.issues.occupations.computer-programmers


EMail Address:
_m-i-a-n-o_@_c_o_l_o_s_s_e_u_m_b_u_i_l_d_e_r_s._c_o_m_






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

Date: 1 Nov 2000 07:55:13 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: CGI Perl vs. Java Servlets...
Message-Id: <8toi91$1gb7$4@news.enteract.com>

Ryan Bedford <ryanb@one.net> wrote:
> All things being equal which is faster?  CGI Perl or Java Servlets?

Answering that would require solving a single equation in two
unknowns.  Can't be done.  You've confounded implementation language with
process model.  Both factors will strongly interact with other parameters
of the setup, so you can't meaningfully talk about "all (other) things
being equal."



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

Date: 1 Nov 2000 08:47:15 +0000
From: nobull@mail.com
Subject: Re: Collecting data
Message-Id: <u9r94wrq1p.fsf@wcl-l.bham.ac.uk>

nodo70@my-deja.com writes something which is almost totally unrealated
to Perl:

> Can I activate to run a script under Unix box from a script under NT
> server?

Yes, you need to have some sort of server on the Unix box to respond
to network requests and execute the script on request.

You could for example use an HTTP server (Apache) on the Unix box and
use LWP in a Perl script on the NT box to issue the request.

You could for example use an SMB server (Samba) on the Unix box and
use simple file access to a named SMB pipe on the NT box to issue the
request.

You could for example use the telnet server on the Unix box and use
Net::Telnet in a Perl script on the NT box to issue the request.

You could for example use an SMTP server on the Unix box and send mail
from a Perl script on the NT box to issue the request.

You could for example use the inetd server on the Unix box and simply
open a socket to issue the request.

There are also dozens (at least) of other options (like CORBA), and
there's not really anything Perl related in any of them.

>    `F:\scriptRun.pl`;  #F drive which I map to Unix box by using Samba
> 
> Is it possible?  If not any suggestion?  Thanks.

This is closest to the Samba approach, but you need to simply open the
file and, of course, configure Samba appropriately.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 1 Nov 2000 00:27:58 -0800
From: "Abhishek Roy" <fingerslip@yahoo.com>
Subject: Compiling Perl 5.6 with ming 32
Message-Id: <8tok8q$9vb$1@agate.berkeley.edu>

Hello,
         I am a newbie, trying to compile Perl 5.6 with the ming 32 port of
gcc and dmake as described in the readme.win32 in the source. dmake throws
several errors chiefly 'too many parameters - &&' and then a file creation
error for config.h. There are also warnings about pointer assignment.
        Can someone help me with this? Do I have to make changes to the
makefile?
Thanks





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

Date: Wed, 01 Nov 2000 00:51:54 -0800
From: harris mahindrakar <harris_m@yahoo.com>
Subject: Re: Compiling Perl 5.6 with ming 32
Message-Id: <39FFD9AA.D8790B39@yahoo.com>

I did not tried ming32 but had similar errors while trying to compile
with
MSVC++. I was using win95. Changing to Win-NT machine these errors
disappeared.

Abhishek Roy wrote:

> Hello,
>          I am a newbie, trying to compile Perl 5.6 with the ming 32 port of
> gcc and dmake as described in the readme.win32 in the source. dmake throws
> several errors chiefly 'too many parameters - &&' and then a file creation
> error for config.h. There are also warnings about pointer assignment.
>         Can someone help me with this? Do I have to make changes to the
> makefile?
> Thanks


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

Date: Wed, 1 Nov 2000 01:53:20 -0800
From: "Abhishek Roy" <fingerslip@yahoo.com>
Subject: Re: Compiling Perl 5.6 with ming 32
Message-Id: <8top8v$af0$1@agate.berkeley.edu>

> I did not tried ming32 but had similar errors while trying to compile
> with
> MSVC++. I was using win95. Changing to Win-NT machine these errors
> disappeared.
I'm using Win98, the readme says that support for ming32 is still in the
experimental stage, but I suppose *someone* must have done it, plus I don't
need the whole ActivePerl distribution.
Abhishek





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

Date: Wed, 01 Nov 2000 12:59:49 +0300
From: Shtirlitz <s_h=t-i_r@astelit.ru>
Subject: Creating a new user in FreeBSD
Message-Id: <kspvvscl6i64099humrtq0ngh79t50aa02@4ax.com>

Hello!

How can I create new uaser account under FreeBSD?


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

Date: Tue, 31 Oct 2000 23:27:53 +0100
From: "Maarten" <maartenh@usa.net>
Subject: Re: cutting / parsing URLS out of a live HTML document
Message-Id: <8tog8r$f1j$1@azure.nl.gxn.net>

>
> print "$1 \n" if ($stuff =~ /"(http.*)">/i);
>

Hey Chris,

Thanks a lot for your reply, but it's still not working.
tried this one:
---------
use LWP::Simple;
$stuff= get('http://www.hartsuijker.com/2000egypt_ses_index.html');
open STUFF, $stuff;
while (<STUFF>) {
print "$1 \n" if ($_ =~ /"(http.*)">/i);
}
--------
but no cigar :-(

I had seen the other solution as well, but my machine doesn't have those
modules....

maarten





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

Date: Wed, 01 Nov 2000 12:00:15 +0100
From: sly <sly@mailto.de>
Subject: Do such a forum exist in language GERMAN?
Message-Id: <39FFF7BF.59E2F767@mailto.de>

Do such a forum exist in language german




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

Date: Wed, 1 Nov 2000 17:12:20 +1100
From: "Liem Tran" <liem@ctc.usyd.edu.au>
Subject: EOF Problem with ActivePerl 5.6.0.618
Message-Id: <8toc81$547$1@spacebar.ucc.usyd.edu.au>

When I ran, for instance, while (!eof(MBXFILE)) loop,
the process was stopped when getting this SUB character
(hex number: 1A) as if it encountered an EOF.

I have no idea why eof() won't detect the end of the file correctly, and I
can't find any function to overcome this
problem.

If you have any idea, please let me know. Your help would be appreciative.

Regards,

Liem Tran




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

Date: Wed, 1 Nov 2000 10:26:59 +0300
From: "Serge V. Egerev" <esv@windoms.sitek.net>
Subject: Re: EOF Problem with ActivePerl 5.6.0.618
Message-Id: <8toggf$gdi$1@serv.vrn.ru>


Liem Tran <liem@ctc.usyd.edu.au> wrote:

> the process was stopped when getting this SUB character
> (hex number: 1A) as if it encountered an EOF.

try using function binmode:

    binmode(FileHandle);

and blocks read/write functions:

    sysread(FileHandle, $Var, Length[, Offset]);
    syswrite(FileHandle, $Var, Length[, Offset]);

May be this will help.

 Bye
Serge




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

Date: 1 Nov 2000 08:31:15 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: EOF Problem with ActivePerl 5.6.0.618
Message-Id: <8tokcj$1gb7$5@news.enteract.com>

In comp.lang.perl.misc Liem Tran <liem@ctc.usyd.edu.au> wrote:
> When I ran, for instance, while (!eof(MBXFILE)) loop,
> the process was stopped when getting this SUB character
> (hex number: 1A) as if it encountered an EOF.

> I have no idea why eof() won't detect the end of the file correctly, and I
> can't find any function to overcome this
> problem.

If you're running under Win32, the C runtime libraries treat 0x1a as an
EOF marker for historical reasons.  You can override this behavior with
binmode(); see its docs for further information.



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

Date: Wed, 01 Nov 2000 13:47:15 +0800
From: Ryan Fraser <r.fraser@student.murdoch.edu.au>
Subject: Exe in CGI
Message-Id: <39FFAE63.32467EE0@student.murdoch.edu.au>

How do I put an "executable" in a CGI html page, so the user can
download it OR execute the application from the page?
Fraser



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

Date: 1 Nov 2000 08:51:25 +0000
From: nobull@mail.com
Subject: Re: Exe in CGI
Message-Id: <u9pukgrphe.fsf@wcl-l.bham.ac.uk>

Ryan Fraser <r.fraser@student.murdoch.edu.au> writes:

> How do I put an "executable" in a CGI html page, so the user can
> download it OR execute the application from the page?

You don't.  You can create a link to a document that has a content
type that the browser will recognise as an executable.

This has nothing to do with CGI and even less to to with Perl.

This is comp.lang.perl.misc, please post only questions that you have
reason to suspect may be in some way related to Perl.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 01 Nov 2000 02:01:48 -0500
From: jesus X <jesusx@who.net>
Subject: Re: FormMail.pl with file attachment support?
Message-Id: <39FFBFDC.5DD881@who.net>

Cameron Dorey wrote:
> 
> jesus X wrote:
> >
> > ISTERIN wrote:
> > >
> > > Just use MIME::Lite to send attachments.  Read about different and
> > > supported encodings in the docs.
> >
> > I have no idea what you're talking about. =-] If I need to do some changes, I
> > can probably muddle through, but I need some idea as to what to do...
> 
> What to do? Read the FAQ on mailing in the docs that come with Perl on
> your hard drive. And throw out any script that reads "Author: Matt
> Wright" and write your own (it's really simple). Check the archives of
> this newsgroup at Deja and you'll see why.

Actually, I did, and I can see some things, yes. Then I smacked my forehead and
went to Google.com and am on the road to success. =-]

Thanks, btw. SOMEONE had to kickstart my brain.

--
jesus X  [ Booze-fueled paragon of pointless cruelty and wanton sadism. ]
 email   [ jesusx @ who.net ]
 web     [ http://www.burntelectrons.com/ ]
 tag     [ The Universe: It's everywhere you want to be. ]
 warning [ If at first you don't succeed, reload. ]


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

Date: Wed, 01 Nov 2000 15:48:22 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Have I released all memory?
Message-Id: <39FFA096.CE65A7B9@ot.com.au>

John wrote:

> Will
> delete $test{"aaa"};
> or
> %test=();
> release all memory of 1st and 2nd level arrays?

If there are no other references to the objects in question, yes. All
allocated memory is reference-counted, and if you hand out references to
any of these lower level objects (the arrays or their contents), those
parts that still have outstanding references will continue to exist as
long as there is still at least one reference to them from somewhere,
and those with no references will be freed.

Regards,


Ian




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

Date: 1 Nov 2000 00:35:57 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Net::SMTP and subject?
Message-Id: <8todkd$8fn$1@provolone.cs.utexas.edu>

In article <39FF4696.2096B596@geophysik.uni-frankfurt.de>,
Thomas Ruedas  <ruedas@geophysik.uni-frankfurt.de> wrote:
>>$smtp->datasend("Subject: $subject\n");
>Indeed, it's that easy. Thanks a lot for the hint.

Actually it's not necessarily that easy.  If length($subject) is
sufficiently large, you may want/need to fold the header so that the
line is not too large.  Also, it's not pretty if the contents of
$subject is "\015\012.\015\012quit\015\012".

If $subject is set by the program or its contents are otherwise
carefully controlled, these things may not be a problem, but if not,
I'd use Mail::Internet or the MIME modules to build the message so that
it's truly kosher.

  - Logan


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

Date: 1 Nov 2000 11:00:17 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: OT: Re: Is there a more perlish way to write this?
Message-Id: <8tot41$iqq$1@lublin.zrz.tu-berlin.de>

Richard J. Rauenzahn <nospam@hairball.cup.hp.com> wrote in comp.lang.perl.misc:
>Ren Maddox <ren.maddox@tivoli.com> writes:
>>
>>I say make the whole thing a special boolean construct that is itself
>>non-associative and is defined to return a true or false value -- the
>>same as the current RELOPs.  And I assume that it shouldn't be limited
>>to just two RELOPs.  Surely you would want to be able to do:
>>
>>if ( 10 < $x < $y < 20 ) { ... }
>
>Has anyone been talking about short circuiting behavior yet?
>
>sub foo() {
>   return ++$count;
>}
>
>if(foo() > foo() > foo() > foo()) { }
>
>How many times is foo called?  Is the answer '2' what most people
>consider DWIM?

A strategy of evaluating operands until the result can be determined
leads to that result.

Anno


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

Date: Wed, 01 Nov 2000 11:08:11 +0100
From: Marc Wapelhorst <email@marc-wapelhorst.de>
Subject: Perl Script runs under WindowsNT and now under Linux not
Message-Id: <39FFEB8B.52E4B4A4@marc-wapelhorst.de>

Hello Group !

I wrote a perl script "adress.pl". I created a formular which sends the
Data with "post" to the Perl script. The script was running on WindowsNT
Server with Omnihttpd Webserver. It runs very well.

I have killed Windows and now I use SuSE Linux 7.0 with Apache Web
Server.
I installed the same Perl script, but now there are some mistakes.
I have some very small test script, which work very well on linux, too.

Where can I find the differences between my windows Perl and the Apache
mod_perl ???

Thank you very much !

Marc, Germany


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

Date: Wed, 01 Nov 2000 05:31:03 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Perl Script runs under WindowsNT and now under Linux not
Message-Id: <39FFF0E7.2B1D240@patriot.net>

Without the actual script, anything stated will be speculation.

Care to post the actual script, since it's very germaine to the question?

Marc Wapelhorst wrote:

> Hello Group !
>
> I wrote a perl script "adress.pl". I created a formular which sends the
> Data with "post" to the Perl script. The script was running on WindowsNT
> Server with Omnihttpd Webserver. It runs very well.
>
> I have killed Windows and now I use SuSE Linux 7.0 with Apache Web
> Server.
> I installed the same Perl script, but now there are some mistakes.
> I have some very small test script, which work very well on linux, too.
>
> Where can I find the differences between my windows Perl and the Apache
> mod_perl ???
>
> Thank you very much !
>
> Marc, Germany

--
Q: Why is Batman better than Bill Gates?
A: Batman was able to beat the Penguin.




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

Date: Tue, 31 Oct 2000 22:12:58 -0800
From: Pierre de La Motte <pierre@arraycomm.com>
Subject: Perl-5.6.0 and perl-5.005
Message-Id: <39FFB46A.5BCB32AC@arraycomm.com>

Hi,
I just installed perl-5.6.0 on a Redhat 6.1 platform to work around a
bug in my previous version of perl (thanks to a very good advice from
Martien Verbruggen, thanks Martien) and I got what I was looking for,
i.e. a working Syslog module.
However I have a lot of stuff under
/usr/lib/perl5/site_perl/5.005/i686-linux and, unfortunately, for a
reason which is unclear to me, this directory is not listed in my @INC
perl -e 'for (@INC) {printf ... gives me
0 /usr/lib/perl5/5.6.0/i686-linux
1 /usr/lib/perl5/5.6.0
2 /usr/lib/perl5/site_perl/5.6.0/i686-linux
3 /usr/lib/perl5/site_perl/5.6.0
4 /usr/lib/perl5/site_perl/5.005
5 /usr/lib/perl5/site_perl
6 .
I reran twice manually the configuration command to see if I was missing
something somewhere, but didn't find any clue.
The documentation (INSTALL in Coexistence with earlier ... section)
seems to state that these dirs should be automatically added as soon as
the compabitility with perl-5.005 is requested (at least it is partially
realized).
I ran
sh Configure -D
otherlibdirs=/usr/lib/perl5/site_perl:/usr/lib/perl5/site_perl/5.005/i686-linux

to force the directory in the search path, but it did'nt work (moreover
this trick doesn't look very clean to me).
What did I miss ?
Thank you
Pierre



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

Date: Wed, 01 Nov 2000 09:59:01 +0000
From: mark.c.hamlin@bt.com
Subject: Re: pop: strange results and errors
Message-Id: <39FFE965.495F4266@bt.com>

I don't think it can be anything to do with scope as I changed the name
and got the same results.

Mark


mark.c.hamlin@bt.com wrote:
> 
> I have an array called @rowRefs which is a list of references to
> anonymous arrays.
> 
> I'm having a bit of trouble with pop.  I've learnt the hard way that it
> only shrinks the array if you use pop in an assignment.  The problem now
> is it seems to be zappin the hole array.  What I see now just doesn't
> make sense, If I skip the story and just give you the impossible bit
> hopefully someone can explain the mystery that is causing the following
> test result:
> 
> I run the program with a debug statement to tell me the size of the
> array.  It works.
> 
> Next I test this with a pop function on the array.  I find that it zapps
> the array.  The strange thing is the debug info telling me the array
> size, as it appears to zap the array before the pop statement.
> 
> I then think about scope, the code is part of a function and the array
> is declared with a my.  I comment it out but the results are even
> stranger:
> 
> No scope defined:
> EXE1 LAST INDEX / SIZE: 0 / 1
> POPED:
> EXE2 LAST INDEX / SIZE: -1 / 1
> 
> Scope defined: with my in same function
> EXE1 LAST INDEX /SIZE: -1 / 0
> POP:
> EXE2 LAST INDEX /SIZE: -1 / 0
> 
> Scope defined: with my in calling script
> (not a very logical test I know)
> EXE1 LAST INDEX: 0 / 1
> POP
> EXE2 LAST INDEX: -1 / 1
> 
> Whenever the array size was reduced the poped item was a reference to a
> hash, it should hold references to lists.
> 
> I take the pop statement out and all is fine, as long as the scope is
> specified in the function.  I think this might be the key, there are big
> clues pointing to scope.
> 
> I know I'm doing something fundamentally silly!!!!
> 
> Many thanks for any tips.
> 
> Mark Hamlin


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

Date: Wed, 01 Nov 2000 10:59:30 +0000
From: mark.c.hamlin@bt.com
Subject: Re: pop: strange results and errors
Message-Id: <39FFF792.27C4ADFC@bt.com>

Guess what, 

I found the problem it was a million miles from where I though I was, so
forget all the previous.. please!

Mark

mark.c.hamlin@bt.com wrote:
> 
> I don't think it can be anything to do with scope as I changed the name
> and got the same results.
> 
> Mark
> 
> mark.c.hamlin@bt.com wrote:
> >
> > I have an array called @rowRefs which is a list of references to
> > anonymous arrays.
> >
> > I'm having a bit of trouble with pop.  I've learnt the hard way that it
> > only shrinks the array if you use pop in an assignment.  The problem now
> > is it seems to be zappin the hole array.  What I see now just doesn't
> > make sense, If I skip the story and just give you the impossible bit
> > hopefully someone can explain the mystery that is causing the following
> > test result:
> >
> > I run the program with a debug statement to tell me the size of the
> > array.  It works.
> >
> > Next I test this with a pop function on the array.  I find that it zapps
> > the array.  The strange thing is the debug info telling me the array
> > size, as it appears to zap the array before the pop statement.
> >
> > I then think about scope, the code is part of a function and the array
> > is declared with a my.  I comment it out but the results are even
> > stranger:
> >
> > No scope defined:
> > EXE1 LAST INDEX / SIZE: 0 / 1
> > POPED:
> > EXE2 LAST INDEX / SIZE: -1 / 1
> >
> > Scope defined: with my in same function
> > EXE1 LAST INDEX /SIZE: -1 / 0
> > POP:
> > EXE2 LAST INDEX /SIZE: -1 / 0
> >
> > Scope defined: with my in calling script
> > (not a very logical test I know)
> > EXE1 LAST INDEX: 0 / 1
> > POP
> > EXE2 LAST INDEX: -1 / 1
> >
> > Whenever the array size was reduced the poped item was a reference to a
> > hash, it should hold references to lists.
> >
> > I take the pop statement out and all is fine, as long as the scope is
> > specified in the function.  I think this might be the key, there are big
> > clues pointing to scope.
> >
> > I know I'm doing something fundamentally silly!!!!
> >
> > Many thanks for any tips.
> >
> > Mark Hamlin


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

Date: 1 Nov 2000 00:53:07 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Printing a perldoc
Message-Id: <8toekj$8gd$1@provolone.cs.utexas.edu>

In article <39ff9d7c.118639452@news.webperception.com>,  <mike> wrote:
>How can I convert perldoc DBI to a text file so I can print it?

Do a "perldoc perldoc".  There's an option that does what you want.

  - Logan


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

Date: Tue, 31 Oct 2000 22:05:23 -0800
From: Yann Ramin <atrus@atrustrivalie.eu.org>
Subject: Re: Problem Passing Test With Msql-Mysql-modules-1.2215
Message-Id: <svvclbnmnuiq63@corp.supernews.com>

Is MySQL running?
Did you provide correct test user info?

Yann
(Real DB people use Postgres :))

Nick Pasich wrote:

>  
>   I've  successfully compiled, tested and installed DBI-1.14,
>   Data-ShowTable-3.3 and Msql-Mysql-modules-1.2215 on 2 out
>   of 3 Linux systems.
> 
>   The problem arises when running "make test" on
> Msql-Mysql-modules-1.2215.
>   I'm using MySql 3.22.32 and Perl v5.6.0.
> 
>   I get the following error message:
>   
> 
********************************************************************************
> 
********************************************************************************
> 
********************************************************************************
> 
> 
> make[1]: Entering directory
> `/zSRC/MYSQL/PERL/Msql-Mysql-modules-1.2215/mysql'
> make[1]: Leaving directory
> `/zSRC/MYSQL/PERL/Msql-Mysql-modules-1.2215/mysql'
> make[1]: Entering directory
> `/zSRC/MYSQL/PERL/Msql-Mysql-modules-1.2215/mysql'
> PERL_DL_NONLAZY=1 /usr/local/bin/perl -I../blib/arch -I../blib/lib
> -I/usr/local/lib/perl5/5.6.0/i586-linux -I/usr/local/lib/perl5/5.6.0 -e
> 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
> t/*.t
> t/00base............ok
> t/10dsnlist.........dubious
> Test returned status 0 (wstat 11, 0xb)
> t/20createdrop......dubious
> Test returned status 0 (wstat 11, 0xb)
> t/30insertfetch.....dubious
> Test returned status 0 (wstat 11, 0xb)
> t/40bindparam.......dubious
> Test returned status 0 (wstat 11, 0xb)
> t/40blobs...........dubious
> Test returned status 0 (wstat 11, 0xb)
> t/40listfields......dubious
> Test returned status 0 (wstat 11, 0xb)
> t/40nulls...........dubious
> Test returned status 0 (wstat 11, 0xb)
> t/40numrows.........dubious
> Test returned status 0 (wstat 11, 0xb)
> t/50chopblanks......dubious
> Test returned status 0 (wstat 11, 0xb)
> t/50commit..........dubious
> Test returned status 0 (wstat 11, 0xb)
> t/60leaks...........skipped test on this platform
> t/ak-dbd............dubious
> Test returned status 0 (wstat 11, 0xb)
> DIED. FAILED tests 1-90
> Failed 90/90 tests, 0.00% okay
> t/dbdadmin..........dubious
> Test returned status 0 (wstat 11, 0xb)
> DIED. FAILED tests 1-20
> Failed 20/20 tests, 0.00% okay
> Failed Test  Status Wstat Total Fail  Failed  List of failed
> 
-------------------------------------------------------------------------------
> 
-------------------------------------------------------------------------------
> t/10dsnlist.t     0    11    ??   ??       %  ??
> t/20createdrop.   0    11    ??   ??       %  ??
> t/30insertfetch   0    11    ??   ??       %  ??
> t/40bindparam.t   0    11    ??   ??       %  ??
> t/40blobs.t       0    11    ??   ??       %  ??
> t/40listfields.   0    11    ??   ??       %  ??
> t/40nulls.t       0    11    ??   ??       %  ??
> t/40numrows.t     0    11    ??   ??       %  ??
> t/50chopblanks.   0    11    ??   ??       %  ??
> t/50commit.t      0    11    ??   ??       %  ??
> t/ak-dbd.t        0    11    90   90 100.00%  1-90
> t/dbdadmin.t      0    11    20   20 100.00%  1-20
> 1 test skipped.
> Failed 12/14 test scripts, 14.29% okay. 110/115 subtests failed, 4.35%
> okay.
> make[1]: *** [test_dynamic] Error 255
> make[1]: Leaving directory
> `/zSRC/MYSQL/PERL/Msql-Mysql-modules-1.2215/mysql'
> make: *** [test] Error 2
> 
> 
********************************************************************************
> 
********************************************************************************
> 
********************************************************************************
> 
>          Any help would be GREATLY appreciated............
> 
>                 -----( Nick Pasich )-----


-- 

--------------------------------------------------------------------
Yann Ramin                      atrus@atrustrivalie.eu.org
Atrus Trivalie Productions      www.redshift.com/~yramin
AIM                             oddatrus
Marina, CA                      http://profiles.yahoo.com/theatrus

IRM Developer                   Network Toaster Developer
SNTS Developer                  KLevel Developer
Electronics Hobbyist            person who loves toys

Build a man a fire, and he's warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

"I'm prepared for all emergencies but totally unprepared for everyday
life." 
--------------------------------------------------------------------











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

Date: Wed, 01 Nov 2000 05:51:08 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Quick question - Still new at this !
Message-Id: <slrn8vvbqc.vf1.mgjv@verbruggen.comdyn.com.au>

On Wed, 01 Nov 2000 02:28:35 GMT,
	msalerno@my-deja.com <msalerno@my-deja.com> wrote:
> I want to start off thanking all of you who have helped me get this far.
> And I will post non-jeopardy style from now on !

Thank you.

> Hi there, I am working on a script that will process ip addresses.  The
> below is the part where I get the ip addresses.  I need to make sure
> that the ip addresses are not the same.  In order to do so I need to
> break down the addresses (ex. 127.0.0.1 = 127.000.000.001). So I need to

Hmm... Nobody has yet suggested the most obvious route. Since you are
talking about IP addresses, you should probably just use the calls
that are made to deal with them.

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

die "Usage: $0 IP1 IP2\n" unless @ARGV >= 2;

my $result = ip_cmp(@ARGV);

die "You specified an illegal IP address\n" unless defined $result;
print "$ARGV[0] is ", ($result ? 'not ' : ''), "equal to $ARGV[1]\n";

sub ip_cmp
{
    my ($iaddr1, $iaddr2) = (inet_aton($_[0]), inet_aton($_[1]));
    return unless defined $iaddr1 && defined $iaddr2;
    $iaddr1 cmp $iaddr2
}

This will also work for hostnames, not just IP addresses, as long as
those host names resolve to a single IP address.

# ./ip_cmp 172.18.240.55 verbruggen
172.18.240.55 is equal to verbruggen

If that's not what you want, put a short check before it that does
something like:

tr/a-zA-Z-// && die "Illegal: $_\n" for @ARGV;

Adapt the tr/// to a regexp, or whatever you feel necessary to
exclude host names. A simple tr/a-zA-Z// might be sufficient. I am not
100% certain, but I think that a hostname has to have at least one of
those characters in it.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.   | cynical. It's perfectly easy to be
NSW, Australia                  | cynical.


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

Date: Wed, 01 Nov 2000 13:45:02 +0800
From: Ryan Fraser <r.fraser@student.murdoch.edu.au>
Subject: running UNIX utilities in perl
Message-Id: <39FFADDE.905A38E1@student.murdoch.edu.au>

How do I run a "make" for the "C" compiler command in a perl CGI script.

Fraser



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

Date: Wed, 01 Nov 2000 06:02:28 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: running UNIX utilities in perl
Message-Id: <UlOL5.79$Bf7.170582016@news.frii.net>

In article <39FFADDE.905A38E1@student.murdoch.edu.au>,
Ryan Fraser  <r.fraser@student.murdoch.edu.au> wrote:
>How do I run a "make" for the "C" compiler command in a perl CGI script.
>
>Fraser
>

Who was it that was recently asking about morally questionable
questions in this news group?

chris

BTW, to answer the posed question, look at docs for system() and
the backtick operators.
-- 
    This space intentionally left blank


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

Date: 1 Nov 2000 08:55:51 +0000
From: nobull@mail.com
Subject: Re: running UNIX utilities in perl
Message-Id: <u9og00rp9e.fsf@wcl-l.bham.ac.uk>

Ryan Fraser <r.fraser@student.murdoch.edu.au> writes:

> How do I run a "make" for the "C" compiler command in a perl CGI script.

There is nothing special about make, you execute it in exactly the
same way you would any other external command using system() or open()
or fork() and exec() or any of the other options I make have forgotten
about from the perlipc manual.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 01 Nov 2000 10:22:21 +0000
From: Andy White <apw4@mcs.le.ac.uk>
Subject: Script calling
Message-Id: <39FFEEDD.B9140E1D@mcs.le.ac.uk>

How can you get one script to call another one in perl?  I'm afraid that
all my beginners books don't answer that question!!

I want to do a search and output the results and log what has been
searched.  I want the user not to have to wait for output while the
logging is happening.

Also if the searching happens in different files can output from one
file be displayed while the other file is being searched?  Does this
happen normally in perl or do you have to get it to do something
different?

Thanks for the help.

Andy



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

Date: 1 Nov 2000 10:54:32 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Script calling
Message-Id: <slrn8vvtj8.15p.clay@panix3.panix.com>

On Wed, 01 Nov 2000 10:22:21 +0000, Andy White <apw4@mcs.le.ac.uk> wrote:

>How can you get one script to call another one in perl?  I'm afraid that
>all my beginners books don't answer that question!!

  $ cat foo.pl
  #!/usr/local/bin/perl -w
  
  $message = `./foo2.pl`;
  print "$message\n";
  
  $ cat foo2.pl
  #!/usr/local/bin/perl -w
  
  print "Hello world";

Result:

  $ ./foo.pl
  Hello world

-- 
Clay Irving <clay@panix.com>
It's bad luck to be superstitious.
- Andrew W. Mathis


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

Date: Wed, 1 Nov 2000 09:26:43 -0000
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: Session or Sessionless?
Message-Id: <973071132.799.0.nnrp-04.c3ad6974@news.demon.co.uk>

>I suppose part of this is my own ignorance of sessions. I keep hearing
>the 'Gnomes of Java" proclaim that Perl is not capable of the
>sessioning they are. But, every time I look at it, the session does
>seem to be nothing more than cookies and a continually running
>instance of an application.


I would suggest that they don't know what sessions are, or if they do they
are not explaining it to you.

I use Apache::session - but now I know how that works I could just use perl
with a database.
Someone had a diagram like this-

browser <------>Server<------>Perl

The difference is, (I fink) that in java (or mod_perl for that matter)

browser<------>Server (with java or mod_perl serverlets)

The weak link as far as sessions is concerned is the interaction between the
browser and the server.  It is still there if you use CGI perl, mod_perl or
java serverlets.

I don't know anything about how java does things, but I imagine it still has
something to do with hidden fields, query strings or cookies.

(PS- probably off topic- but fighting the good fight for peRL )




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

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


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