[7302] in Perl-Users-Digest
Perl-Users Digest, Issue: 927 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 26 18:17:15 1997
Date: Tue, 26 Aug 97 15:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 26 Aug 1997 Volume: 8 Number: 927
Today's topics:
Re: <> operator memory leak? <rootbeer@teleport.com>
Re: cardinality of an array given a reference <rootbeer@teleport.com>
Re: cardinality of an array given a reference <tom@mitra.phys.uit.no>
Re: defunct process after using open2() <ralph_janke@writeme.com>
Re: Does anyone know how to call a perl script with 2 a (SJK)
Re: easiier way to extract one field from a string <fawcett@nynexst.com.spam-me-not>
Re: Garbage collection with Perl (Chip Salzenberg)
Re: Help on Final Exam (Perl class) (Daniel E. Macks)
Re: how to set shell variable from perl? (brian d foy)
Input file line numbers in debugger wrong? (David Hancock)
Re: MAIL question (Jeff Stampes)
Re: perl script suid problem in Solaris 2.5.0 <rootbeer@teleport.com>
Re: protect a perl-script (David D. Wertman)
Re: RegExp Win95/NT4.0 ? (Terry Michael Fletcher - PCD ~)
Re: Returning a hash list (associative array) (Jacob Miner)
Re: Returning a hash list (associative array) <rootbeer@teleport.com>
Re: Returning a hash list (associative array) (SJK)
Re: Returning a hash list (associative array) <tom@mitra.phys.uit.no>
Scrambling using tr (Justin Masters - remove "Y" to reply)
Re: server name <ramon@ramonc.icix.net>
Re: Suppressing a specific Perl warning (Greg Ward)
Re: Suppressing a specific Perl warning <rootbeer@teleport.com>
Re: the port of GD graphic library module for NT alpha franklar@bbs.freequote.com
Re: Update facility for web site <rootbeer@teleport.com>
Re: Using a DB_BTREE as a trie? <fawcett@nynexst.com.spam-me-not>
Velocis Database Server Problems <steve@prilnari.com>
Re: What happens when.... (Chip Salzenberg)
Re: What is ~// ? was(Re: Perl Regular Expression has a (Greg Ward)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 26 Aug 1997 14:49:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gargle Zndflxtzyh <joshu@diku.dk>
Subject: Re: <> operator memory leak?
Message-Id: <Pine.GSO.3.96.970826144830.13463l-100000@julie.teleport.com>
On 26 Aug 1997, Gargle Zndflxtzyh wrote:
> I'm trying to write a program that's supposed to run
> for hours on end, but it globs up too much memory,
Are you using 5.004? Many (many!) memory leaks present in earlier versions
of Perl are plugged in 5.004. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 26 Aug 1997 12:55:34 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: cardinality of an array given a reference
Message-Id: <Pine.GSO.3.96.970826124054.13463b-100000@julie.teleport.com>
On 26 Aug 1997, Tom Grydeland wrote:
> perl -le '$a=[1..100];print $#{@$a}'
>
> It prints 99, but I don't know why.
Well, as I'm sure you know, $#{ ARRAYREF } should give the index of the
last element in the array pointed to by ARRAYREF. I'm not sure why that
seems to be doing the same in this case, since you're not giving it an
array reference - but Perl may be implicitly dereferencing @$a. (I would
have thought you would need to put a backslash before the @-sign. But
Perl seems to implicitly dereference the object in the braces.)
> perl -le '$a=[1..100];print $#$a' # prints 99
That's correct. The last element in @$a is number 99.
> perl -le '$a=[1..100];print $#{$a}' # ditto
And that's correct, too. Of course, none of these is (IMHO) the
cardinality. These are giving the index of the last element, which is one
smaller than the cardinality (number of elements).
> I can understand these, but the one above?
Might be a bug. It might be something you and I don't yet understand about
Perl. Or maybe it's an "undocumented feature". :-) In fact, unless it's
documented somewhere I haven't seen, I'd call it that. It might be nice to
get this documented in perlref, unless it shouldn't be a feature... :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Aug 1997 22:09:48 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: cardinality of an array given a reference
Message-Id: <nqok9h8d7ub.fsf@mitra.phys.uit.no>
Tom Phoenix <rootbeer@teleport.com> writes:
> > perl -le '$a=[1..100];print $#{@$a}'
> >
> > It prints 99, but I don't know why.
>
> Well, as I'm sure you know, $#{ ARRAYREF } should give the index of the
> last element in the array pointed to by ARRAYREF. I'm not sure why that
> seems to be doing the same in this case, since you're not giving it an
> array reference
That's why I said I don't know why. Of course I know about
$#{ ARRAYREF }. I suggested $#{$a}, remember?
> - but Perl may be implicitly dereferencing @$a. (I would
> have thought you would need to put a backslash before the @-sign. But
> Perl seems to implicitly dereference the object in the braces.)
Yes, I imagine it's the implicit dereferencing that's biting me.
> > perl -le '$a=[1..100];print $#$a' # prints 99
> > perl -le '$a=[1..100];print $#{$a}' # ditto
> And that's correct, too. Of course, none of these is (IMHO) the
> cardinality. These are giving the index of the last element, which is one
> smaller than the cardinality (number of elements).
Yes, after posting I suddenly realised that this was what you ment
with your comment about the strange definition of cardinality. The
only reason for using this particular (peculiar) definition of
cardinality, is that it is the one employed by the original poster.
> > I can understand these, but the one above?
>
> Might be a bug. It might be something you and I don't yet understand about
> Perl. Or maybe it's an "undocumented feature". :-) In fact, unless it's
> documented somewhere I haven't seen, I'd call it that. It might be nice to
> get this documented in perlref, unless it shouldn't be a feature... :-)
It's most probably an undocumentet feature. (I haven't gone through
perlref with a fine-toothed comb yet.) If you want my opinion, it's
also a misfeature. $#$arrayref or $#{$arrayref} is (AFAICanDeduce)
also undocumented, but consistent with @$arrayref, $$arrayref[$i] etc.
> Tom Phoenix http://www.teleport.com/~rootbeer/
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Tue, 26 Aug 1997 12:01:27 -0500
From: Ralph Janke <ralph_janke@writeme.com>
Subject: Re: defunct process after using open2()
Message-Id: <34030BE6.3AA8293A@writeme.com>
Alan Page wrote:
> Does anyone know the proper way to close the process started when
> using
> open2()?
> I tried killing the process, closing each handle and I still end up
> with
> a defunct process.
> Thanks
A killed child process needs to get cleared with a wait() or waitpid()
from the parent process, otherwise it will stay as a "zombie" or defunct
process.
The easiest way may be to define a signal handler like SIG{CHLD} = "sub
{ wait();}"; .
However this can cause problems if you use wait() in other instances.
Therefore be careful with it.
Maybe it is just possible (if you know the pid of the child process) to
put a waitpid() after the kill command.
Ralph Janke
This message reflects solely my opinion and involves neither agreement
nor reliability of my employer.
------------------------------
Date: Tue, 26 Aug 1997 19:56:47 GMT
From: knetsch@golden.net.no.spam (SJK)
Subject: Re: Does anyone know how to call a perl script with 2 arguments in an html file?
Message-Id: <34032d56.8380220@news.golden.net>
On Tue, 26 Aug 1997 05:38:51 GMT, "Roxy" <dongmien@cs.washington.edu> wrote:
>I got a perl script, and I would like to execute the perl script with 2
>arguments from an
>html file as I did in a unix shell.
>Something likes
>perl filename.pl input.txt output.txt
>Could anyone help me?
>TIA,
>--
>--------------------------------------------------
>Roxy
As this is a CGI question, this should actually be asked in a CGI newsgroup.
And you didn't have to post your question in four newsgroups!
But anyhoo....
What you need to do is send a GET method to the CGI script.
For example the following snippet of HTML sends the properly formatted data
click <A HREF="myfile.pl?file1=input.txt+file2=output.txt">here</A> to do file
manipulation.
Then in your cgi script (your PERL program) read the environment variable
QUERY_STRING to get your results.
As an aside, this information is made available after about of 100 pages of
introduction material in my CGI programming book. Obviously I cannot condense
that into a newsgroup posting for your perusal. So if you are having trouble
understanding what is going on, BUY A BOOK or read some of the umpteen million
FAQs available on the web to give yourself a good start.
Stuart Knetsch
Remove the you know what from my address to send me E-mail
------------------------------
Date: 26 Aug 1997 16:11:41 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
Subject: Re: easiier way to extract one field from a string
Message-Id: <8jvi0sembm.fsf@nynexst.com.spam-me-not>
mlb@netpath.net (Marvin Blackburn) writes:
> I am a beginner. I want to know the easiest way to extract just one
> field from a white space delimited sting. Preferablly something
> analogous to *cut*. I can get the single field using a long regular
> expression match along with the $ operation; however, this gets quite
> long when the number of fields is high. The other way using split
> requires alot of needless variable assigments.
>
> for example, if wanted to get the 12 field from a 27 field string. the
> fields are white space delimited, and can be described using reqular
> expressions.
Easiest way:
$twelfth_field = (split(' ', $string))[11];
Most efficient way:
($twelfth_field) = $string =~ /^(?:\S+\s+){11}(\S+)\s*/;
-Tom
------------------------------
Date: 26 Aug 1997 20:54:05 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Garbage collection with Perl
Message-Id: <5tvfpd$8ok$1@news1.atlantic.net>
According to Matthew Fuchs <matt@wdi.disney.com>:
>Has anyone succeeded in using a cyclical GC with Perl (such as with the
>Bohm-Weiser collector)?
Perl is unlikely to have anything but reference counts for the
forseeable future.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
(Roller coaster on camera:) "Wow, this square quarter mile
has unbelievably good light rail transit!" // MST3K
------------------------------
Date: 26 Aug 1997 20:52:27 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: Help on Final Exam (Perl class)
Message-Id: <5tvfmb$jrv$1@netnews.upenn.edu>
Andrew Williams (andrew@spyder.manor.org) said:
:
: [...] doing the project to the stated description got you a solid c
: for the program. In order to get an A you had to add neat and
: usefull/clever features to it. It was really a fun project.
Not sure what the project itself should be, but I'll second this
grading technique. In my one programming class (OO-Pascal...don't ask)
a letter grade or so of the points was "bells 'n' whistles"--could be
just about anything cool, but there had to be something. Creativity
plays a big part in programming, so may as well encourage them to
start now.
Which reminds me of a joke I can't remember. Something about hiring
someone to program a toaster, and he gives it a gui, virtual bread
storage, multithreading, a full financial calculator, etc., the
punchline being he'll implement the toasting functions Real Soon Now.
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Tue, 26 Aug 1997 17:56:02 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: how to set shell variable from perl?
Message-Id: <comdog-ya02408000R2608971756020001@news.walrus.com>
In article <5t0cje$lfo$1@gte2.gte.net>, ii@fairhope.com wrote:
>The following command works fine from the csh, but in perl it seems to
>be ignored.
>
>`setenv MYDIR "$HOME/foo" `
* Perl uses sh for backtick expressions
* you can't change that environment with Perl anyway. you can change
Perl's environment by modifying %ENV though
--
brian d foy <comdog@computerdog.com>
------------------------------
Date: Tue, 26 Aug 1997 20:19:53 GMT
From: dhancock@arinc.com (David Hancock)
Subject: Input file line numbers in debugger wrong?
Message-Id: <34043a4f.631960040@news.clark.net>
I've been having a problem with the debugger giving me incorrect
line numbers via via the $. variable. The number being reported
via $. is different in the debugger than during a normal execution
of the program.
It appears that the $. value in the debugger reports how many
lines of keyboard input the debugger has processed.
Is there another way to use $. in a Perl program and not have
it hijacked by the debugger?
Here's a script that will demonstrate the behavior:
open(FIN, "bar.txt");
while(<FIN>) {
print "$.:$_";
}
Given a "bar.txt" with the following contents:
data line 1
data line 2
data line 3
I get the following output running it from the command line:
1:data line 1
2:data line 2
3:data line 3
But here's a bit of debugger output. Note that the line numbers
in the output are different:
main::(foo.pl:1): open(FIN, "bar.txt");
DB<1> s
main::(foo.pl:2): while(<FIN>) {
DB<1> s
main::(foo.pl:3): print "$.:$_";
DB<1> s
3:data line 1 (***WRONG)
main::(foo.pl:3): print "$.:$_";
DB<1> s
4:data line 2 (***WRONG)
main::(foo.pl:3): print "$.:$_";
DB<1> s
5:data line 3 (***WRONG)
DB::fake::(C:\apps\perl5\lib/perl5db.pl:2043):
2043: "Debugged program terminated. Use `q' to quit ...
DB<1> q
Thanks for any ideas you can offer.
Cheers!
David Hancock | dhancock@arinc.com
------------------------------
Date: 26 Aug 1997 20:14:50 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: MAIL question
Message-Id: <5tvdfq$ldo$1@neocad.com>
Tom Phoenix (rootbeer@teleport.com) wrote:
: On 23 Aug 1997, Burt Lewis wrote:
: > I'm using this bit of code which works nice:
: >
: > $youmail = 'burt@ici.net';
: > open (MAIL, "|$mailprog $youmail");
: >
: > Question is, I can't seem to add additional receipients to this, it only
: > seems to work with one.
: Maybe you want to ask about it in a newsgroup about your mail program.
: Look in comp.mail.* . Hope this helps!
Or if you'd like a perl solution to your problem, and nix the
pipe and look into the Mail::Send module. You have far larger
problems than the inability to add additional recipients. You
also have no error checking. A nice module can save you from
reinventing the wheel, and will probably work better in this case.
HTH,
Jeff
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Tue, 26 Aug 1997 14:37:18 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Fil Krohnengold <fil@amnh.org>
Subject: Re: perl script suid problem in Solaris 2.5.0
Message-Id: <Pine.GSO.3.96.970826142329.13463j-100000@julie.teleport.com>
On 26 Aug 1997, Fil Krohnengold wrote:
> The program is mostly the passwd program right out of the Camel book
> with a couple of revisions for our site.
That's the old Camel book, right?
> Insecure dependency in eval while running setuid at /dev/fd/4 line 220.
Have you looked at the information in perlsec(1) about taint checks?
> 206: # Build up a subroutine that does matching on bad passwords.
> 207: # We'll use an eval to define the subroutine.
> 208:
> 209: # I don't understand the need to do it this way
In older versions of Perl, eval was the only way to define a subroutine at
runtime. Now you can do this without eval, in safer ways.
> 211: $foo = 'sub badpats {local($_) = @_;study;';
> 212: open(BADPATS,$BADPATS);
Tsk! That camel book should have checked to see whether that open
succeeded! :-)
> 213: while (<BADPATS>) {
> 214: ($badpat,$maybe) = split(/[\n\t]+/);
> 215: ($response = $maybe) =~ s/'/\\'/ if $maybe;
I am pretty sure that there's supposed to be a /g on that pattern. But
that's not your fault; the Camel has it wrong.
> 216: $foo .= "return '$response' if /$badpat/;\n";
> 217: }
Of course, all of that information from the file was tainted. So now $foo
is tainted.
> 218: close BADPATS;
> 219: $foo .= 'return 0;}';
> 220: eval $foo; # Note: this defines sub badpats
And so that eval can't happen. :-(
We could fix up this part of the code, but there are probably lots of
other taint-related problems that will bite you. The (good) solutions I
can think of are to either re-write the code with taint checks in mind
(time consuming, but it would make for better code) or to find a way to
run it without taint checks. Come to think of it, that second one isn't
such a good idea after all. :-)
Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 26 Aug 1997 20:31:31 GMT
From: david@WebChamps.com (David D. Wertman)
Subject: Re: protect a perl-script
Message-Id: <34033b3c.92240145@news-server.neo.lrun.com>
On 25 Aug 1997 19:15:17 GMT, bbutz@student.uni-kl.de (Benjamin Butz)
wrote:
>
>Hello,
>
>how can I protect a perl-script? Everybody
>can execute the script, but nobody can read
>the source code (it is not a CGI access problem)
>
>bye
>Benjamin
>
>
Huh...
You really dont tell enough about the environment that you are
addressing.
As for web based Perl Scripts, that is just the way Perl Scripts run,
when they are running thru a browser. People get to execute them (It
actually execute PERL.exe which process the scripts, and returns the
script output to STDOUT - which is usually a browser.
SO if you are talking about people accessing th escript remotely thru
a browser, then you have no problem.
But if you are talking about local access and protecting the
script.... Well, good luck doing that with Perl.!
If that is what you need locally, then you better write it in a
language you can compile. i.e C, or VB, or whatever your platform
offers.
Or, you may be talking about developing a perl script and
distributing it to other to use on their web sites, and you dont want
them to have the source. Same answer; find another language.
But if you want clear answers, try clearly explaining the environment
and the problem.
------------------------------
Date: 26 Aug 1997 20:49:12 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: RegExp Win95/NT4.0 ?
Message-Id: <5tvfg9$3a3$1@news.fm.intel.com>
Marc Filthaut (Marc_Filthaut@HP.com) so eloquently and verbosely pontificated:
>
> I programm perl under unix and have the hole regexp, but when i use the
> same regexp under windows they didn't work. Is there a different between
> perl for windows and for unix ??
the big difference is in the newline character, which would be a cntl-M
for dos/windows. to actually get your question answered, you need to post
the regexp that has the problems.
are you trying to match a newline?
are you using /^anchors like this$/ ?
to match a DOS newline you might have to use a \cM in your expression. im
not sure off-hand what the problem is, but it might be interesting to find
out.
--
print "J" ."u". # -- Terry Fletcher
"s" ."t". " A", "n" # tfletche@pcocd2.intel.com
. "o" ,""."". "the", "r ","P". # Views expressed....not
"e"."rl" ." Ha", "c",'' ."" ."". # INTeL's....yadda yadda
"" , "k". "e" ."r" ;# yadda....
------------------------------
Date: 26 Aug 1997 13:43:51 -0600
From: jacob@bitsrfr.cnd.hp.com (Jacob Miner)
Subject: Re: Returning a hash list (associative array)
Message-Id: <wjkk9h8n30o.fsf@bitsrfr.cnd.hp.com>
Hi All,
Thanks for responding, the folowing code
works correctly...
sub Families {
my(%Name);
$Name{"Fred"}="Flinstone";
$Name{"Barney"}="Rubble";
return %Name;
}
%Test = Families();
print %Test{"Fred"};
--
---------------- .-. ------------------------------------
Jacob Miner .-.
---------------- .-. ------------------------------------
------------------------------
Date: Tue, 26 Aug 1997 13:07:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jacob Miner <jacob@bitsrfr.cnd.hp.com>
Subject: Re: Returning a hash list (associative array)
Message-Id: <Pine.GSO.3.96.970826130350.13463d-100000@julie.teleport.com>
On 26 Aug 1997, Jacob Miner wrote:
> How can I return a hash list, the following won't work
> and I have tried many different permutations...
>
> sub Families {
> local(%Name);
You probably want my instead of local. See the perlsub(1) manpage.
> $Name["Fred"]="Flinstone";
> $Name["Barney]="Rubble";
You probably want curly braces rather than square brackets. See the
perldata(1) manpage.
> return %Name;
> }
You probably want to return a reference. See the perlref(1) manpage.
And in all of this, you should probably turn on warnings with -w . See the
perlrun(1) manpage. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 26 Aug 1997 19:57:05 GMT
From: knetsch@golden.net.no.spam (SJK)
Subject: Re: Returning a hash list (associative array)
Message-Id: <3403326b.9681460@news.golden.net>
On 26 Aug 1997 11:06:15 -0600, jacob@bitsrfr.cnd.hp.com (Jacob Miner) wrote:
>Hi All,
>
> How can I return a hash list, the following won't work
>and I have tried many different permutations...
>
>sub Families {
> local(%Name);
>
> $Name["Fred"]="Flinstone";
> $Name["Barney]="Rubble";
>
> return %Name;
>}
>
>%Test = GetMachines();
>print %Test["Fred"];
>
Does this do what you want?
sub Families {
local(%Name);
$Name{"Fred"}="Flinstone"; # Curly braces instead of square brackets.
$Name{"Barney"}="Rubble";
return %Name;
}
%Test = &Families; # It helps if you call the right subroutine!!!!!
print $Test{"Fred"}; # Again curly braces instead of square and since you
# are calling a distinct key, you use $
# instead of % which references the entire
# hash
Cheers!
>
>This prints nothing. I have tried using references as well, but
>to no avail...
>
>
>--
>---------------- .-. ------------------------------------
>Jacob Miner .-.
>---------------- .-. ------------------------------------
Stuart Knetsch
Remove the you know what from my address to send me E-mail
------------------------------
Date: 26 Aug 1997 22:12:04 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Returning a hash list (associative array)
Message-Id: <nqoiuwsd7qj.fsf@mitra.phys.uit.no>
jacob@bitsrfr.cnd.hp.com (Jacob Miner) writes:
> Thanks for responding, the folowing code
> works correctly...
[...]
> print %Test{"Fred"};
^ I kind of doubt that... :-)
> Jacob Miner .-.
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: 26 Aug 1997 13:53:46 -0700
From: jmastYers@pcocd2.intel.com (Justin Masters - remove "Y" to reply)
Subject: Scrambling using tr
Message-Id: <cavd8n0aco5.fsf@fri001.fm.intel.com>
I have a script I'm writing, but with a "shortcut" to be used only for
analysis, and not to be abused by users.
I would like to put in a short message to people using this option
that an upcoming operation will be bypassed.
What's an easy method of "scrambling" a message to get past the casual
searchers of the text which they may see displayed going by on the screen?
I tried using tr/a-z/Z-A/g, but it doesn't like (presumably) the "backwards
range" of Z-A.
Any ideas?
--
------------------------------------------------------------------------------
Justin Masters (Sr. Cad Engineer - Design Automation) PH: 916-356-6735
Intel Corp. FM5-94 FAX: 916 356-7874
1900 Prairie City Rd, Folsom, CA 95630 jmastYers@pcocd2.intel.com
------------------------------
Date: Tue, 26 Aug 1997 16:05:27 -0400
From: Ramon Castillo <ramon@ramonc.icix.net>
To: Martin Fischer <mf@fishbone.ruhr.de>
Subject: Re: server name
Message-Id: <34033707.60E9@ramonc.icix.net>
Martin Fischer wrote:
>
> Danny LaPrade <dannyl@computize.com> wrote:
> >Let me be more specific...
>
> > I am doing a script for the web (CGI)
> > I want to know the servername of each person
> > who visits my page.
> You can get it with $ENV{'REMOTE_HOST'} if the person doesn't use
> a proxy, else you get the name of the proxy.
>
> ciao
> Martin
> --
> Martin Fischer <mf@fishbone.ruhr.de> -------------------
> <Martin.Fischer@fh-bochum.de> | Comp Sci Student
> PGP key available at: http://localhost.ruhr.de/~martin | FH-Bochum, Germany
> Unsolicited commercial e-mail will be proof-read for $199/hr.
although I don't think $ENV{'REMOTE_HOST'} brings back the _NAME_
but anyway you can do reverse lookup and get the name back,
you can try just with :
>nslookup 206.xx.xx.x if you are in a Unix plataform
probably you can get more help if ew know more about you plataform and
language.
#!/usr/bin/perl
USE hart;
while ($god->$bless == $Internet){
$hack == $fun;
};
RC
#
#
#
------------------------------
Date: 26 Aug 1997 21:32:34 GMT
From: greg@bic.mni.mcgill.ca (Greg Ward)
Subject: Re: Suppressing a specific Perl warning
Message-Id: <5tvi1i$t0k@sifon.cc.mcgill.ca>
Terry Michael Fletcher - PCD ~ (tfletche@pcocd2.intel.com) wrote:
: this is an interesting situation that i have come across. i am writing a
: compiler, and every bit of Perl it uses is invoked with the "-w" switch to
: at least force the user to quote strings, and try to predefine variables
: and such.
: well, the particular warning message i would like to suppress is the
: Misplaced _ in number
: because its not important. the syntax i use allows for binary strings to
: contain underscores as placeholders between nybbles, i.e.:
: 1011_0010_1110_1111
: and all my subroutines and such know how to handle that. Perl sees this
: string of digits (w/out letters) as a decimal number with underscores not
: placed on a three digit boundary.
That warning should only pop up if Perl is interpreting your
binary-with-underscores string as a number. Seems to me that treating
101100101101111 as a decimal number, whether it has underscores or not,
is the wrong thing to do. So where are you putting your binary strings
in a numeric context? Remove the numericity of that use, and the
warnings should disappear.
Other possibilities:
* tr/_//d on binary strings
* filter warnings via the __WARN__ pseudo-signal handler:
$SIG{__WARN__} = sub {
my $warning = shift;
warn $warning unless $warning =~ /Misplaced _/;
}
I think it's best to just be careful about how you treat these strings,
and don't put them in a context where they might be interpreted
as numbers by Perl.
Greg
--
Greg Ward - Research Assistant greg@bic.mni.mcgill.ca
Brain Imaging Centre (WB201) http://www.bic.mni.mcgill.ca/~greg
Montreal Neurological Institute voice: (514) 398-4965 (or 1996)
Montreal, Quebec, Canada H3A 2B4 fax: (514) 398-8948
------------------------------
Date: Tue, 26 Aug 1997 14:46:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Terry Michael Fletcher - PCD ~ <tfletche@pcocd2.intel.com>
Subject: Re: Suppressing a specific Perl warning
Message-Id: <Pine.GSO.3.96.970826143745.13463k-100000@julie.teleport.com>
On 26 Aug 1997, Terry Michael Fletcher - PCD ~ wrote:
> Subject: Suppressing a specific Perl warning
> well, the particular warning message i would like to suppress is the
>
> Misplaced _ in number
Near the beginning of your script, put in this code.
BEGIN { $SIG{'__WARN__'} =
sub { warn @_ if $_[0] !~ /^Misplaced _ in number/; } ;
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 26 Aug 1997 16:36:51 -0600
From: franklar@bbs.freequote.com
Subject: Re: the port of GD graphic library module for NT alpha ?
Message-Id: <872630770.27157@dejanews.com>
In article <33EF92A6.1FAD3211@wsn.co.kr>,
"Hyung-Tae, Kim" <htkim@wsn.co.kr> wrote:
>
> is there any one who
> has the port of GD graphic library module for NT alpha ?
>
> i'm using Activeware's Perl5(build 307) on NT 4.0 DEC alphaserver.
>
> i can find the module for x86 on "ftp://ftp.roth.net/pub/NTPerl/GD/".
> but can't for DEC alpha chips.
>
> if anyone has the port for NT alpha, please notify me.
>
> bye.
What speed DEC Alpha machine are you using?
Frank Lardino
Investors Alliance
The opinions stated are my own.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 26 Aug 1997 12:59:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin Lowe <klowe@iol.ie>
Subject: Re: Update facility for web site
Message-Id: <Pine.GSO.3.96.970826125631.13463c-100000@julie.teleport.com>
On 26 Aug 1997, Kevin Lowe wrote:
> Does anyone know how I would go about creating a perl program to enable
> someone (the owner) to update a web site by just visiting the site and
> filling out a form. I am thinking along the lines of the contents of the
> form being stored in a data file and then writing each record of the
> file to a HTML document on the fly.
You could do that.
> I am new to Perl,
But it's not really a beginner's project. It's got some potential
difficulties, such as lockfiles and user authentication.
> Also, can anyne recoment a good perl book?
http://www.ora.com/catalog/lperl2/
http://www.ora.com/catalog/pperl2/
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Aug 1997 16:38:04 -0400
From: Tom Fawcett <fawcett@nynexst.com.spam-me-not>
To: uzs90z@uni-bonn.de (Michael Schuerig)
Subject: Re: Using a DB_BTREE as a trie?
Message-Id: <8jsovwel3n.fsf@nynexst.com.spam-me-not>
uzs90z@uni-bonn.de (Michael Schuerig) writes:
> I'm casually working on an indexing search engine (you guessed it). I'd
> like to allow searching for prefixes. Currently I keep an inverted word
> index in a hash, but a b-tree is more suitable for simulating a trie.
> With a custom compare function it's easy to find *an* entry that matches
> the prefix, but (from my understanding of DB_File) I need to get the
> *first* matching entry so that I can access further ones sequentially.
If I understand your question, you want to be able to search for
prefixes like "com" and retrieve keys like command, commend, compare...
Check the dbopen manpage for the seq() method and note the R_CURSOR flag.
You set the cursor using this flag, then do seq's with R_NEXT outputting
keys until you get one that mismatches the prefix. Something like this:
$key = $prefix;
for ($status = $x->seq($key, $value, R_CURSOR) ;
($status == 0 and $key =~ /^$prefix/o) ;
$status = $x->seq($key, $value, R_NEXT) )
{ print "$key -> $value\n" }
-Tom
------------------------------
Date: Tue, 26 Aug 1997 15:58:54 -0500
From: Steve Wells <steve@prilnari.com>
Subject: Velocis Database Server Problems
Message-Id: <3403438E.7CA69EA8@prilnari.com>
I'm running Velocis (SQL) on a BSDI machine
and I'm looking for someone who has this
working on their machine to "talk" to.
The documentation for this server and the
PERL interface modules are all for Windoze.
It uses a DLL file to run the extensions
and I haven't seen anything equivalent for
a UNIX machine.
Any suggestions?
TIA,
STEVE
------------------------------
Date: 26 Aug 1997 20:55:51 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: What happens when....
Message-Id: <5tvfsn$8pg$1@news1.atlantic.net>
According to dico@peionline.com (Dico Reyers):
>What happens when two or more people try to write to a file that is
>already open (ie, another person is already writing to it?).
The last writer wins.
> Is there a way to stop this from happening?
Look up the flock operator.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
(Roller coaster on camera:) "Wow, this square quarter mile
has unbelievably good light rail transit!" // MST3K
------------------------------
Date: 26 Aug 1997 21:20:08 GMT
From: greg@bic.mni.mcgill.ca (Greg Ward)
Subject: Re: What is ~// ? was(Re: Perl Regular Expression has a bug?)
Message-Id: <5tvha8$t0k@sifon.cc.mcgill.ca>
Colin Kuskie (colink@latticesemi.com) wrote:
: >if($date = ~/(..):(..):(..)/)
: ^^^
: Here's your problem.
: What you want is:
: if ($date =~ /(..):(..):(..)/)
: Note the difference in spacing around the =~. Your code assigns
: the return value of whatever ~/(..):(..):(..)/ to $date, overwriting
: what it used to have. Now the interesting question that remains is:
: What in the world is ~// ?
I think that would take the result of matching the original regex
against $_ (either 1 or undef), and then do a bitwise not of that.
Thus, it would return either 4294967295 (~0) or 4294967294 (~1), meaning
that $date would always be assigned a true value.
Greg
--
Greg Ward - Research Assistant greg@bic.mni.mcgill.ca
Brain Imaging Centre (WB201) http://www.bic.mni.mcgill.ca/~greg
Montreal Neurological Institute voice: (514) 398-4965 (or 1996)
Montreal, Quebec, Canada H3A 2B4 fax: (514) 398-8948
------------------------------
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 927
*************************************