[16567] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3979 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 18:10:46 2000

Date: Thu, 10 Aug 2000 15:10:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965945427-v9-i3979@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 10 Aug 2000     Volume: 9 Number: 3979

Today's topics:
    Re: Modules Used <tom.kralidis@ccrs.nrcan.gcDOTca>
        ODBC question <drawbridge@home.com>
    Re: parsing Finger replies with perl <billy@arnis-bsl.com>
        Perl 5.005_03 script does not work in 5.6.0 <stumo@bigfoot.com>
    Re: Perl 5.005_03 script does not work in 5.6.0 (Logan Shaw)
        problem using mod_perl on NT mwickett4445@my-deja.com
    Re: problems with ^= <uri@sysarch.com>
    Re: problems with ^= <tim@ipac.caltech.edu>
    Re: Problems with adding 1 <lr@hpl.hp.com>
    Re: Problems with adding 1 <aqumsieh@hyperchip.com>
        Putting data into a form. emavres@yahoo.com
    Re: reg expressions - protect html (brian d foy)
    Re: reg expressions - protect html <callgirl@la.znet.com>
    Re: reg expressions - protect html <uri@sysarch.com>
    Re: reg expressions - protect html <care227@attglobal.net>
    Re: reg expressions - protect html <callgirl@la.znet.com>
    Re: reg expressions - protect html <russ_jones@rac.ray.com>
    Re: reg expressions - protect html (brian d foy)
    Re: reg expressions - protect html <callgirl@la.znet.com>
    Re: reg expressions - protect html <russ_jones@rac.ray.com>
        Setting file user and group ids <g-preston1@ti.com>
    Re: Setting file user and group ids (Logan Shaw)
    Re: Setting file user and group ids <memmett@fraser.sfu.ca>
    Re: Setting file user and group ids <g-preston1@ti.com>
    Re: Setting file user and group ids (Brandon Metcalf)
    Re: Sort of a sort problem. <lr@hpl.hp.com>
    Re: Sort of a sort problem. (Randal L. Schwartz)
    Re: Thanks for your help <flavell@mail.cern.ch>
        Trouble installing Bundle::DBI <michael.segulja@sgi-lsi.com>
    Re: Trouble installing Bundle::DBI (NP)
        Uploading Images centelec@my-deja.com
    Re: Uploading Images <flavell@mail.cern.ch>
    Re: use strGlobal symbol "$YP_D"use strict" error messa <tim@ipac.caltech.edu>
    Re: warning/var weirdness (or is it?) <bkennedy@hmsonline.com>
    Re: Who has used --------->  Net::Telnet   ????  Kick A <tripix@metaverse.fsnet.co.uk>
        XSUB, .bs, PDF, FDF <rmore1@my-deja.com>
        zgrep <dsivasan@ford.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 10 Aug 2000 14:49:54 -0400
From: "Tom Kralidis" <tom.kralidis@ccrs.nrcan.gcDOTca>
Subject: Re: Modules Used
Message-Id: <8mutgi$qh14@nrn2.NRCan.gc.ca>

Gerry <gerry.morong@compaq.com> wrote in message
news:8muisr$itl$1@mailint03.im.hou.compaq.com...
> Is there a script, program or setting that will show you what perl modules
> your perl script is using and where it got them from?
>
> Gerry
>

perl -e '$"="\n";print "@INC\n"'

 ..Tom





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

Date: Thu, 10 Aug 2000 18:08:40 GMT
From: DM <drawbridge@home.com>
Subject: ODBC question
Message-Id: <3992EFFF.2CBB1281@home.com>

Maybe someone can help clear this up.  There seems to be 3 ways to use
ODBC on Windows.
1. Win32::ODBC
2. DBD::ODBC
3. DBI

Using ActivePerl, the DBD module can be installed and so can the DBI
package.  So how do you install the Win32:ODBC module?
I realize that the ODBC.pm is in the lib\Win32 directory and does not
need an install, however this is a different story is the request is to
the web server.  The DBD and DBI work because they have been installed
in ActivePerl's PPM.  

I want to use the Win32::ODBC and I know this code works when uploading
to an NT host.  This code doesn't work however under PWS on Windows.  I
know it is not a PWS problem because all scripts work except
Win32::ODBC. 

How do you install Win32::ODBC? 

I realize this question is probably in need of a simple basic
description.  Since i'm not seeing the solution I figure two heads are
better than one and have run out of ideas on how to correct this.  Any
input would be greatly appreciated.

___James


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

Date: Thu, 10 Aug 2000 16:27:45 -0500
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: parsing Finger replies with perl
Message-Id: <39931E51.4B2FE348@arnis-bsl.com>

The WebDragon wrote:
> 
> Does anyone have either a short bit of business they coded and would be
> willing to share regarding parsing the components of Finger replies (for
> date last updated, .plan information, etc.) or have a URL link to the
> RFC for finger formats that I could study in my efforts to do the same?
> 
> any and all assistance appreciated, as always :)
> 

IMHO, RFC1288 at any RFC archive.
Good luck.
Ilja.


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

Date: Thu, 10 Aug 2000 22:07:05 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Perl 5.005_03 script does not work in 5.6.0
Message-Id: <8mv5gj$5m6$1@supernews.com>

The web hosting company we use have recently upgraded from Perl 5.005_03 to
Perl 5.6.0
Three of my scripts no longer work; all report

Modification of a read only value attempted at xxx.pl line nnn

and in each case the line number is in the same common function:

sub subs
{
 # args: $searchstring, then hash of replace what with what.
 my ($searchstring, %replacewith, $searchfor);
 chomp(@_);
 $searchstring = shift @_;
 %replacewith = @_;
 foreach $searchfor (keys %replacewith)
  {
  $searchstring =~ s/$searchfor/$replacewith{$searchfor}/gi;
  }
 return $searchstring;
}

One fails on chomp(@_); and the other two give the line number of the { in
the foreach loop. I'm guessing that it's because one of the parameters to
the function has been marked as read-only (I suspect the one ladled
$searchstring, as it's the only one the function attempts to change).
Presumably the one failing on chomp contains a string that needs to be
truncated, whereas on the others it is not until the regular expression that
the script tries to change any of the values. $searchstring is a string
that's been made by reading a template file, and the others are just from a
hash (I know it'd be more efficient with references, but I'm not yet fully
confident with them, and this is good enough for me). Typical uses in my
scripts are:

 open TEMPLATE, "template.html";
 my @template=<TEMPLATE>;
 close TEMPLATE;
 my $template=join "", @template;
 print subs($template,%replace);

or

 print &subs($data{'header'},'£links',$links,'£message',$message);

(Note that in this last example $data{'header'}originally came from a file,
but unlike the example above it was not the whole file, just a selected
portion of it, just in case that's relevant)

I apologise if this is something that's well known about the new version and
I should have heard of it - if there are any worthwhile forums/mailing lists
that point out these kind of things, I'll be glad to hear of them

Many thanks

Stuart Moore




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

Date: 10 Aug 2000 16:42:53 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl 5.005_03 script does not work in 5.6.0
Message-Id: <8mv7kt$ill$1@provolone.cs.utexas.edu>

In article <8mv5gj$5m6$1@supernews.com>,
Stuart Moore <stumo@bigfoot.com> wrote:
>The web hosting company we use have recently upgraded from Perl 5.005_03 to
>Perl 5.6.0
>Three of my scripts no longer work; all report
>
>Modification of a read only value attempted at xxx.pl line nnn
>
>and in each case the line number is in the same common function:
>
>sub subs
>{
> # args: $searchstring, then hash of replace what with what.
> my ($searchstring, %replacewith, $searchfor);
> chomp(@_);
> $searchstring = shift @_;
> %replacewith = @_;
> foreach $searchfor (keys %replacewith)
>  {
>  $searchstring =~ s/$searchfor/$replacewith{$searchfor}/gi;
>  }
> return $searchstring;
>}

Doing "chomp(@_);" at the beginning of a function is a little unusual,
especially if part of it is a list that represents key/value pairs.

Anyway, I'd rewrite it as this:

	sub subs
		{
		my ($searchstring, %replacewith) = @_;

		my ($key, $value);

		while ( ($key, $value) = each %replacewith )
			{ $searchstring =~ s/$key/$value/; }

		return $searchstring;
		}

If you really need to chomp the search/replace patterns, I'd do this:

	sub subs
		{
		my ($searchstring, @replacewith) = @_;

		my (%replacewith, $key, $value);

		chomp @replacewith;
		%replacewith = @replacewith;
		
		while ( ($key, $value) = each %replacewith )
			{ $searchstring =~ s/$key/$value/; }

		return $searchstring;
		}

Also, if you are running subs() with the same %replacewith hash lots of
times, it would probably be more efficient to use qr{} to pre-parse
your regular expressions.

So, for instance, if you have a space-delimited file that contains
substitutions, you might build the substitution list like this:

	@substitutions = ();
	while (<FILE>)
		{
		chomp;
		($original, $replacement) = split;
		push (@substitutions, [ qr/$original/, $replacement ]);
		}

Then, you can do the replacements like this:

	foreach my $substitution (@substitutions)
		{
		$mystring =~ s/$substitution[0]/$substitution[1]/;
		}

Hope that helps.

  - Logan


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

Date: Thu, 10 Aug 2000 19:50:37 GMT
From: mwickett4445@my-deja.com
Subject: problem using mod_perl on NT
Message-Id: <8mv12c$4qm$1@nnrp1.deja.com>

When attempting to use mod_perl on NT the only piece of the perl script
that is executed is the first line.  If the first line is a comment or
left blank then a message stating there is no data to be displayed is
displayed and when looking in the access.log file the following line
appears:

xxx.xxx.xxx.xxx - modtest[10/Aug/2000:15:19:48 -0400] "GET /modtest/cgi-
bin/try.pl HTTP/1.0" 200 -

I compiled the ApacheModulePerl.dll using Perl 5.004_04, Apache 1.3.11
and mod_perl 1.24.

I have modified the httpd.conf file to include the following lines:

LoadModule perl_module modules/ApacheModulePerl.dll

Alias /modtest/ "c:/modtest/"

<LocationMatch /modtest/.*cgi-bin/.*.pl>
	SetHandler perl-script
	PerlHandler Apache::Registry
	PerlSendHeader On
	Options +ExecCGI
</LocationMatch>

I'm testing this using a simple script

print "Content-type: text/html\n\nhello\n";
print "hello world\n";
print "hello world\n";
1;

The only thing that is displayed is hello.

Any help would be greatly appreciated.

Mary



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


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

Date: Thu, 10 Aug 2000 18:52:33 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: problems with ^=
Message-Id: <x7ya25ymml.fsf@home.sysarch.com>

>>>>> "t" == toddbe  <toddbe@my-deja.com> writes:

  >> >Is ^= not working under linux?
  >> >
  >> >$h0 += 9804392444;

  >> Why are you assinging values via +=?  Not that it matters, but
  >> you make everyone look twice (or not at all).

  t> The code I cut from uses somthing like $h0 += $A0;  I put the actual
  t> values in for debugging and for the purposes of posting to this group.

that doesn't answer the question. you have given incomplete information
here. who knows what was in $h0 BEFORE the +=?

  >> >$h1  ^=  $h0;  #$h1 goes to 0 on linux

  >> Your $h1 is > 2**32.  Probably HPUX is running on a 64 bit machine and
  >> Linux isn't.

since it is > 2**32 it will become a float value. do you really want to
xor the bit image of that?

another possibility is the way an x86 vs. hp store floats. in any case
what you are trying to do looks odd.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 10 Aug 2000 12:06:55 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: problems with ^=
Message-Id: <3992FD4F.D2599CF7@ipac.caltech.edu>

toddbe@my-deja.com wrote:
> 
> I'm running this bit of code on an HPUX 10.20 system and a linux system
> and get very different resaults.  On the HP $h1 get the correct value on
> the linux box $h1 becomes 0.
> 
> Is ^= not working under linux?
> 
> $h0 += 9804392444;
> $h1 += 15433492645;
> $h2 += 2607314627;
> $h3 += 859226588;
> $h4 += 4989140090;
> 
> $h1  ^=  $h0;  #$h1 goes to 0 on linux
> $h2  ^=  $h0;
> $h3  ^=  $h0;
> $h4  ^=  $h0;

I don't really know what's going on on your HP box, but I suspect that despite
its 32 bitness, it's able to handle those large numbers as integers, while Linux
must treat them as floats. Use Devel::Peek on $h1 on the HP and see if the "IOK"
flag turns up. If so that means it can be treated as an integer. On my Linux
box, I get "NOK", meaning its numeric, but no IOK. See here:

% perl -MDevel::Peek -wl \
       -e '$h0 = int(9804392444); $h1 = int(15433492645); $x=$h0^$h0;' \
       -e 'Dump($h0); Dump($h1); Dump($x); print "$h0,$h1,$x"'
SV = PVNV(0x80eb1e0) at 0x80ff294
  REFCNT = 1
  FLAGS = (IOK,NOK,pIOK,pNOK,IsUV)
  UV = 4294967295
  NV = 9804392444
  PV = 0
SV = PVNV(0x80eb1f8) at 0x80ff1f8
  REFCNT = 1
  FLAGS = (NOK,pNOK)
  IV = 0
  NV = 15433492645
  PV = 0
SV = IV(0x80f607c) at 0x810283c
  REFCNT = 1
  FLAGS = (IOK,pIOK,IsUV)
  UV = 0
9804392444,15433492645,0

Why $h0 integerizes as 2^32-1 and $h1 as 0, I don't know. What happens on HPUX?

--

-- Tim Conrow         tim@ipac.caltech.edu       626-395-8435


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

Date: Thu, 10 Aug 2000 11:41:27 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Problems with adding 1
Message-Id: <MPG.13fc97315fdd5c8398ac5f@nntp.hpl.hp.com>

In article <3992DC21.3A2C7A75@strobedata.com> on Thu, 10 Aug 2000 
09:45:21 -0700, Jim Cook <jcook@strobedata.com> says...
> > @numb = <postnumb>;
> > @numb ++;
> 
> Hey, one that even I can answer.
> 
> @numb consists of all of the lines from the postnumb file. $numb[0] is
> the first line, and $numb[1] is the second line (assuming the default
> array lower limit value).
> 
> If you really have only one line in the file, try one of the following
> untested code fragments.
> 
> $numb = <postnumb>;
> $numb++;
> 
> or
> 
> @numb = <postnumb>;
> @numb[0]++;

Ook.  See what running that with '-w' tells you about that last line.

You had this correct in your second paragraph, but blew it here.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 10 Aug 2000 18:50:28 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Problems with adding 1
Message-Id: <7ad7jhc5mx.fsf@merlin.hyperchip.com>


Jim Cook <jcook@strobedata.com> writes:

> > @numb = <postnumb>;
> > @numb ++;
> 
> Hey, one that even I can answer.
> 
> @numb consists of all of the lines from the postnumb file. $numb[0] is
> the first line, and $numb[1] is the second line (assuming the default
> array lower limit value).
> 
> If you really have only one line in the file, try one of the following
> untested code fragments.
> 
> $numb = <postnumb>;

It's better to chomp() off the newline character:

	chomp($numb = <postnumb>;

> $numb++;
> 
> or
> 
> @numb = <postnumb>;
> @numb[0]++;

That should be $numb[0]++. Checkout perlfaq4:

	What is the difference between $array[1] and @array[1]?

--Ala


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

Date: Thu, 10 Aug 2000 20:29:24 GMT
From: emavres@yahoo.com
Subject: Putting data into a form.
Message-Id: <8mv3at$6oo$1@nnrp1.deja.com>

I would like to get data from a file and place it into a form on an HTML
page when the user selects a button.  I know how to get form data using
perl but cant figure out how to write data into some of the form
elements.  The form only has text fields.

Thanks


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


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

Date: Thu, 10 Aug 2000 14:13:10 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: reg expressions - protect html
Message-Id: <brian-ya02408000R1008001413100001@news.panix.com>

In article <3992117C.B097F0B2@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> posted:

> Alan Barclay wrote:

> > As you can see, even if the benchmark is rerun without
> > changing anything, there is a variation of as much as
> > 4 wallclock seconds.

> Actually what you are displaying is benchmark's inherent
> margin of error which is plus or minus five seconds, as
> an average.

don't use the wallclock seconds.  it is not an error or
uncertainty.  it simply means that the processor was
also handling other things at the same time.  as such, that
number is meaningless other than tellingyou how long it took
to run all of the tests, which is not the same thing as the
amount of processor time the tests took (which is the number
you are measuring).

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Thu, 10 Aug 2000 12:06:18 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: reg expressions - protect html
Message-Id: <3992FD2A.9201C9A9@la.znet.com>

brian d foy wrote:
 
> Godzilla! comments on good scientific methods: 
> > Alan Barclay wrote:

> > > As you can see, even if the benchmark is rerun without
> > > changing anything, there is a variation of as much as
> > > 4 wallclock seconds.
 
> > Actually what you are displaying is benchmark's inherent
> > margin of error which is plus or minus five seconds, as
> > an average.

(snippage not noted by another who removed context)
 
> don't use the wallclock seconds.

Why are they included if meaningless?


> it is not an error or uncertainty.  it simply means that
> the processor was also handling other things at the same time.

Which is an inherent margin of error. You are suggesting
a CPU is capable of only handling one task at a time.
I am skeptical, of course.


> as such, that number is meaningless other than telling you
> how long it took to run all of the tests,

All of the tests or an individual test consisting of iterations?
If meaningless, isn't this a programming error in benchmark?


> which is not the same thing as the amount of processor time
> the tests took (which is the number you are measuring).

CPUs are well noted for multi-tasking, thus margin of error,
a margin or error incorrectly noted by the author of this
benchmark module. His error being noting a margin of error
as plus five seconds rather than plus or minus five seconds.


RTFM?

* smiles *

Godzilla!


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

Date: Thu, 10 Aug 2000 19:12:38 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: reg expressions - protect html
Message-Id: <x7punhylp5.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <callgirl@la.znet.com> writes:

  G> Which is an inherent margin of error. You are suggesting
  G> a CPU is capable of only handling one task at a time.
  G> I am skeptical, of course.

ROTFLMAO!!!

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 10 Aug 2000 15:19:40 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expressions - protect html
Message-Id: <3993004C.134A7758@attglobal.net>

"Godzilla!" wrote:
> 
<snicker>

> 
> RTFM?

You should take your own advice.

> 
> * smiles *

Is that the nervous "I'm making an ass of myself" kind of smile?


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

Date: Thu, 10 Aug 2000 12:37:43 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: reg expressions - protect html
Message-Id: <39930487.CA64B4C7@la.znet.com>

Drew Simonis wrote:
 
> "Godzilla!" wrote:

> <snicker>

> > RTFM?
 
> You should take your own advice.

> > * smiles *
 
> Is that the nervous "I'm making an ass of myself" kind of smile?


I have noticed, you, Guttman, D. Foy and many others here,
respond to articles within minutes of posting, all day long
and well into evening and night hours.

My presumption is you boys don't have a life outside of
this newsgroup. Professional counseling would be wise.

Godzilla!


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

Date: Thu, 10 Aug 2000 14:52:12 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: reg expressions - protect html
Message-Id: <399307EC.3DFDF358@rac.ray.com>

"Godzilla!" wrote:
> 
> brian d foy wrote:
> >
> > don't use the wallclock seconds.
> 
> Why are they included if meaningless?
> 

Lots of meaningless stuff gets included where you would think it
shouldn't.

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Thu, 10 Aug 2000 16:10:43 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: reg expressions - protect html
Message-Id: <brian-ya02408000R1008001610430001@news.panix.com>

In article <3992FD2A.9201C9A9@la.znet.com>, "Godzilla!" <callgirl@la.znet.com> posted:

> Which is an inherent margin of error. You are suggesting
> a CPU is capable of only handling one task at a time.
> I am skeptical, of course.

you mistake the CPU for the scheduler.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Thu, 10 Aug 2000 13:40:32 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: reg expressions - protect html
Message-Id: <39931340.68DA0337@la.znet.com>

Russ Jones wrote:
 
> "Godzilla!" wrote:
> > brian d foy wrote:

> > > don't use the wallclock seconds.

> > Why are they included if meaningless?

> Lots of meaningless stuff gets included where 
> you would think it shouldn't.


This is especially true of newsgroup articles.

These other boys well exemplify a common problem
with most societies, not just America's. This
problem is poor reading comprehension skills,
exasperated, as it applies to this newsgroup,
by malice intent personalities.

Those wallclock seconds are quite meaningful
if good Scientific Method is practiced as 
I have suggested a few articles back and, 
as suggested by the author of this commonly
used benchmark method. Wallclock seconds can
provide a good relative measure, when good
testing methods are practiced. As numbers,
those wallclock numbers are meaningless.
As relative numbers, they are meaningful.

Benchmark itself will return warnings if
testing is insufficient. Seems this would
be enough of a hint for these boys to realize
good practices in scientific testing involves
more than a mouse click. However, I all too
well understand how diminished skills in
reading comprehension leads to unawareness.

Are you familiar with a movie "Willy" released
in 1962 for television? Quite apropos.

Godzilla!


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

Date: Thu, 10 Aug 2000 16:28:21 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: reg expressions - protect html
Message-Id: <39931E75.2794EE24@rac.ray.com>

"Godzilla!" wrote:
> 
> Russ Jones wrote:
> 
> > "Godzilla!" wrote:
> > > brian d foy wrote:
> 
> > > > don't use the wallclock seconds.
> 
> > > Why are they included if meaningless?
> 
> > Lots of meaningless stuff gets included where
> > you would think it shouldn't.
> 
> This is especially true of newsgroup articles.
> 

(more crap snipped)

I was referring to your meaningless drivel, you twit.

ps: I wish you'd just use one email account.
plonk again.

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Thu, 10 Aug 2000 13:46:29 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Setting file user and group ids
Message-Id: <3992F885.C3664AA1@ti.com>

Hi,

How do you save/change a files user and group id?

Thanks,

Jerry



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

Date: 10 Aug 2000 14:02:23 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Setting file user and group ids
Message-Id: <8muu7v$h0h$1@provolone.cs.utexas.edu>

In article <3992F885.C3664AA1@ti.com>,
Jerry Preston  <g-preston1@ti.com> wrote:
>How do you save/change a files user and group id?

I don't know what you mean by saving the user or group id, but if you'd
like to change it, then "perldoc -f chown" will tell you how.

  - Logan


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

Date: 10 Aug 2000 12:08:00 -0700
From: Matthew Emmett <memmett@fraser.sfu.ca>
Subject: Re: Setting file user and group ids
Message-Id: <yvw9d7jhkk8f.fsf@fraser.sfu.ca>

Jerry Preston <g-preston1@ti.com> writes:

> How do you save/change a files user and group id?

perldoc -f chown
perldoc -f chmod

Try browsing the perlfunc manpage too.

Matt


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

Date: Thu, 10 Aug 2000 14:27:15 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Re: Setting file user and group ids
Message-Id: <39930213.3DDFA1E@ti.com>

Logan,

Perldoc says that you have to be the superuser on most system. How through
the program do you set the program up to be the superuser?

Thanks,

Jerry

Logan Shaw wrote:

> In article <3992F885.C3664AA1@ti.com>,
> Jerry Preston  <g-preston1@ti.com> wrote:
> >How do you save/change a files user and group id?
>
> I don't know what you mean by saving the user or group id, but if you'd
> like to change it, then "perldoc -f chown" will tell you how.
>
>   - Logan



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

Date: 10 Aug 2000 20:50:16 GMT
From: bmetcalf@nortelnetworks.com (Brandon Metcalf)
Subject: Re: Setting file user and group ids
Message-Id: <8mv4i8$ejb$1@bcrkh13.ca.nortel.com>

g-preston1@ti.com writes:

 > Logan,
 > 
 > Perldoc says that you have to be the superuser on most system. How through
 > the program do you set the program up to be the superuser?

You either run the program as setuid or become root before running it.

Brandon


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

Date: Thu, 10 Aug 2000 11:29:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Sort of a sort problem.
Message-Id: <MPG.13fc945a51aa573f98ac5e@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <m1g0odjhai.fsf@halfdome.holdit.com> on 10 Aug 2000 07:56:53 
-0700, Randal L. Schwartz <merlyn@stonehenge.com> says...
> >>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:

Incorrect attribution.  I didn't post that code.  But I didn't pee on it 
either, because it really is OK, considering the data set that was 
posited, for which the regex couldn't fail.

> >> my @sorted = map substr($_, 4) => sort
> >> map { /(\d+)/; sprintf("%04u", $1).$_ } @files;
> 
> This is dangerous.  What if /(\d+)/ fails?  You get the previous $1!
> 
> *never* use $1 unless it is in conditional code based on the success
> of the match!  Or at least, never use it, until you understand why
> I say never, then you can use it. :-)

Your objection is solved simply by using a regex that cannot fail:

      /(\d*)$/

I would also capture the match directly in the argument list:

   my @sorted = map substr($_, 4) => sort
      map sprintf('%.4u', /(\d*)$/) . $_ => @files;

The worst that could happen there is a warning on conversion of a null 
string to 0; a local $^W = 0; could deal with that.

(For ultimate speed, I would pack() to a two-byte short unsigned 
integer, instead of sprintf() to a four-byte digit string; but that is 
irrelevant to your objections.)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 10 Aug 2000 12:46:11 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Sort of a sort problem.
Message-Id: <m1itt8j3wc.fsf@halfdome.holdit.com>

>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:

>> *never* use $1 unless it is in conditional code based on the success
>> of the match!  Or at least, never use it, until you understand why
>> I say never, then you can use it. :-)

Larry> Your objection is solved simply by using a regex that cannot fail:

Larry>       /(\d*)$/

That's why I said "never, until you understand why I said never".
*You* (Larry) obviously understand why I said "never". :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Thu, 10 Aug 2000 20:36:49 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Thanks for your help
Message-Id: <Pine.GHP.4.21.0008102032530.25429-100000@hpplus03.cern.ch>

On Thu, 10 Aug 2000, Jim_Kearman wrote:

> Guess no one here knows much about Perl installation.

It works.  I know that much.

> I'll stick to ASP.

So you don't even know the difference between a programming language
and a software interface specification.  (Nor usenet threads either,
judging from your headers).

Well, if you can't use the help that's available, that's your problem. 

Good luck (you'll need it).

-- 

      A patent application requires an implementation, 
      which is impossible due to the lack of sufficently 
      dense material to make one that would work.
       - Glenn Randers-Pehrson discussing specification for a clue-stick




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

Date: Thu, 10 Aug 2000 16:24:11 -0500
From: "Michael Segulja" <michael.segulja@sgi-lsi.com>
Subject: Trouble installing Bundle::DBI
Message-Id: <J3Fk5.156$rD6.136@news-west.usenetserver.com>

I am using the CPAN shell to install the DBI module, and I'm having some
trouble.  I have actually tried it both ways, from the shell and by
downloading the actual file and installing.  The test phase fails both ways.
Here's the output from the CPAN method.  Hopefully somebody can shed some
light no this one for me.


cpan> install Bundle::DBI
Storable is up to date.
Net::Daemon is up to date.
RPC::PlServer is up to date.
Getopt::Long is up to date.
Running make for T/TI/TIMB/DBI-1.14.tar.gz
  Unwrapped into directory /root/.cpan/build/DBI-1.14
  Has already been processed within this session
Running make test
PERL_DL_NONLAZY=1
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0/i3
86-linux -I/usr/lib/perl5/5.6.0 -e 'use Test::Harness qw(&runtests
$verbose); $v
erbose=0; runtests @ARGV;' t/*.t
t/basics............ok
t/dbidrv............ok
t/examp.............ok
t/meta..............ok
t/proxy.............ok 4/111Can't call method "ping" on unblessed reference
at t
/proxy.t line 87.
t/proxy.............dubious
        Test returned status 255 (wstat 65280, 0xff00)
Undefined subroutine &Test::Harness::WCOREDUMP called at
/usr/lib/perl5/5.6.0/Te
st/Harness.pm line 334.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force
Bundle summary: The following items in bundle Bundle::DBI had installation
problems:
  DBI



Thanks for your help!!

Michael






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

Date: Thu, 10 Aug 2000 21:30:57 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: Trouble installing Bundle::DBI
Message-Id: <laFk5.458483$MB.6956056@news6.giganews.com>

10 Aug 2000 16:24:11 -0500, Michael Segulja <michael.segulja@sgi-lsi.com> wrote:
: I am using the CPAN shell to install the DBI module, and I'm having some
: trouble.  I have actually tried it both ways, from the shell and by

Sorry to ask an obvious question -- but you're running these tests as
root, right?

-- 
Nate II



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

Date: Thu, 10 Aug 2000 20:55:42 GMT
From: centelec@my-deja.com
Subject: Uploading Images
Message-Id: <8mv4sc$7uc$1@nnrp1.deja.com>



        I am writing a Perl script to upload images, jpegs or gifs. This
is to be used for forum users that don't have web sites or web space.
The script works as far as uploading the file but you cannot view the
image after its uploaded. I downloaded it back to my computer and tried
to open it with Adobe Photoshop. Got the following error:

        "Could not open the document because an unknown or invalid JPEG
marker
        type is found."

        I'm sure it is a formating problem but not sure how to fix it.
The uploading section of the script is as follows:

        use CGI;
        open (OUTFILE, ">$basedir$fileName") || die "Can't open photo
file!\n";
        print "$basedir/$fileName<br>";
        while (my $bytesread = read($file, my $buffer, 1024)) {
        print OUTFILE $buffer;
        }

        My server is using Windows NT.
        Any help would be appreciated.
        Thanks,
        Bob


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


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

Date: Thu, 10 Aug 2000 23:19:44 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Uploading Images
Message-Id: <Pine.GHP.4.21.0008102319150.10110-100000@hpplus03.cern.ch>

On Thu, 10 Aug 2000 centelec@my-deja.com wrote:

>         My server is using Windows NT.

binmode(); for input and output.




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

Date: Thu, 10 Aug 2000 12:09:07 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: use strGlobal symbol "$YP_D"use strict" error message
Message-Id: <3992FDD3.790EAB85@ipac.caltech.edu>

Javier Hijas wrote:
> 
> Global symbol "$YP_DIR" requires explicit package name at ./usradm line
> 16.
> 
> Could someone tell me what does it means?

perldoc perldiag
 
Global symbol """"%s"""" requires explicit package name
    (F) You've said "use strict vars", which indicates that all 
        variables must either be lexically scoped (using "my"), or          
        explicitly qualified to say which package the global
        variable is in (using "::").


--

-- Tim Conrow         tim@ipac.caltech.edu       626-395-8435


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

Date: Thu, 10 Aug 2000 18:15:39 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: warning/var weirdness (or is it?)
Message-Id: <fjCk5.91943$A%3.1243734@news1.rdc2.pa.home.com>


"fvw" <fvw+usenet@var.cx> wrote in message news:965879311ZGS.fvw@var.cx...
> I have the following code:
>
> #!/usr/bin/perl -w
> my $a='foo';
> my $b="${a}${a}[";
> print $b;

I can give some insight, maybe someone else can add sone

the "my $a = 'foo'" introduces a lexical $a - which means $main::a does not
exist

when you interpret "${a}${a}[", the first ${a} is not being treated like a
symbolic reference - the second one is - for example

#!/usr/bin/perl -w
my $a = 'foo';
$main::a = 'bar';

my $b = "${a}${a}[ ${'a'}";
print $b . "\n";

My guess (which may be wrong) is that in the first case, the perl
preprocessor optimizes away the first curlies to "$a${a}[" - this allows the
first $a to point to the lexical $a - while adding the [ (or a left curly)
forces the curlies to act as a symbolic deref, which by definition cannot
point to a lexical var.

Hope this helps

--Ben Kennedy








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

Date: Thu, 10 Aug 2000 22:15:31 +0100
From: Wayne Keenan <tripix@metaverse.fsnet.co.uk>
Subject: Re: Who has used --------->  Net::Telnet   ????  Kick ASS  idea
Message-Id: <39931B73.EEE0391E@metaverse.fsnet.co.uk>

Guenther Degenfelder wrote:
> 
> "Savant_cubed" <superegoNOsuSPAM@execs.com.invalid> schrieb im Newsbeitrag
> news:0092d81c.821796ec@usw-ex0101-008.remarq.com...
> > Does anyone know a better way to telnet to other servers ? I
> > keep getting timeout errors using the Net::Telnet module.
> > Everytime I try to Change directories once I've telnetted to
> > some server with ( cd /bin), it times out. Is there anyway I can
> > do this ? Please help. Email --> superego@execs.com
> 
> Net::Telnet works very well.
> Changing directories works as good as any other commands.
> Try to use logging
>     telnet->input_log(STDERR);
>     telnet->output_log(STDERR);
> and/or tell me more details.
> 
> Regards
> 
>     Guenther
I had this happen to me, but in 'hands on' mode, check your
DNS settings are correct, this *might* be because the remote
telnet deamon is failing to get a reverse look up on you.

Wayne


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

Date: Thu, 10 Aug 2000 20:54:45 GMT
From: Rich More <rmore1@my-deja.com>
Subject: XSUB, .bs, PDF, FDF
Message-Id: <8mv4qj$7se$1@nnrp1.deja.com>

On http://partners.adobe.com/asn/developer/acrosdk/forms.html

Adobe has a Perl interface to thier Forms Data Format (FDF) used in
PDF/Acrobat files. When I use this package I get this error...
===========================
Can't load '/usr/local/lib/perl5/5.00503/sun4-
solaris/auto/Acrobat/FDF/FDF.so' for module Acrobat::FDF: ld.so.1:
/usr/local/bin/perl: fatal: relocation error: file
/usr/local/lib/perl5/5.00503/sun4-solaris/auto/Acrobat/FDF/FDF.so:
symbol Perl_stack_sp: referenced symbol not found at
/usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.

 at /usr/local/lib/perl5/5.00503/Acrobat/FDF.pm line 579
BEGIN failed--compilation aborted at test.pl line 3.
============================
Upon looking into Adobe's files, there is no .bs ( bootstrap? ) file
with the .so ( library ) file.  Does this mean that the package is
incomplete?

--
=============================
Richard More
http://www.richmore.com/


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


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

Date: Thu, 10 Aug 2000 15:49:49 -0700
From: dsivasan <dsivasan@ford.com>
Subject: zgrep
Message-Id: <3993318D.DC68563B@ford.com>

This is a multi-part message in MIME format.
--------------E1F833A243328A5A98034C23
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Is there an alternative to zgrep (grep through zip files) in Perl ?

Thanks,
dsivasan
--------------E1F833A243328A5A98034C23
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Deepa Sivasankarane
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Deepa Sivasankarane
n:              Sivasankarane;Deepa
org:            Ford Motor Company
email;internet: dsivasan@ford.com
title:          Software Developer
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------E1F833A243328A5A98034C23--



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

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


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