[6751] in Perl-Users-Digest
Perl-Users Digest, Issue: 376 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 26 10:17:12 1997
Date: Sat, 26 Apr 97 07:00:25 -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 Sat, 26 Apr 1997 Volume: 8 Number: 376
Today's topics:
Re: [Q] Which Perl book next lvirden@cas.org
Re: ANNOUNCE: f90split (Michel OLAGNON)
Re: ASCII Numeric conversion!? (Tad McClellan)
Re: ASCII Numeric conversion!? (Abigail)
Automatic NNTP Usenet news reader & posting perl script (Drake Raft)
Re: Bizarre question of the day...precedence with typeg (David Alan Black)
Re: Calculating dates <rootbeer@teleport.com>
I want to get a small face picture of Larry Wall. <jong@mrc-lmb.cam.ac.uk>
Re: Network Programming and Sockets (Neil Briscoe)
Re: Notice to antispammers (Lloyd Zusman)
Re: Notice to antispammers (Andrew Booth)
Re: Object IDs are bad (was: Ousterhout and Tcl lost th (Fergus Henderson)
Passwork perl <tejedor@nauta.es>
perl cgi to print to frame <fredc@earthlink.net>
Re: perl cgi to print to frame (David Alan Black)
Perl scripts don't work with Netscape and MSIE 4!! Help <Pascal.Vermeulen@ping.be>
Re: Perl scripts don't work with Netscape and MSIE 4!! <gordon.leslie.mcdorman@sap-ag.de>
Re: Randal Teaching Open Perl Class in NYC/Northern NJ (Randy J. Ray)
setlkw with fcntl (Michael Putch)
Re: setlkw with fcntl (Michael Putch)
Re: Substitute File Path For URL (Tad McClellan)
Re: undump revisited? (Geoffrey Hebert)
Re: undump revisited? (brian d foy)
Re: undump revisited? (Andrew M. Langmead)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Apr 1997 13:50:43 GMT
From: lvirden@cas.org
Subject: Re: [Q] Which Perl book next
Message-Id: <5jt17j$75i$1@cas.org>
Anyone know anything about
Web Client Programming with Perl
Automating Tasks on the Web
By Clinton Wong
1st Edition March 1997
1-56592-214-X, Order Number: 214X
228 pages, $29.95
Also by O'Reilly's ?
Anyone have a copy yet of
Title: Cgi Developer's Resource: Web Programming in Tcl and Perl
Author: J.M. Ivler <URL:mailto:ivler@i-xpress.com>
Publisher: Prentice Hall Computer Books
Publication Date: March 1, 1997
ISBN: 0-13-727751-2
Pages: 624
Price: $49.95
It is reported to cover the analysis, design and coding of CGI scripts
in both Tcl and Perl. All source from the book, as well as
programming tools, are contained on the CD-ROM.
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: 26 Apr 1997 08:56:28 GMT
From: molagnon@ifremer.fr (Michel OLAGNON)
Subject: Re: ANNOUNCE: f90split
Message-Id: <5jsfvs$6s6$2@ys.ifremer.fr>
In article <5jqm8k$tmd$1@oac2.hsc.uth.tmc.edu>, bwb@odin.mdacc.tmc.edu (Barry W. Brown) writes:
> ANNOUNCE f90split
>
>f90split is a Fortran 90 version of fsplit. It reads a file
>containing multiple Fortran 90 program units and writes each unit to a
>separate file whose name is the same as the name of the program unit
>followed by a suffix (default .f90). It should work with Fortran 77
>files. However, it you don't place blanks between keyowrds (of which
>Fortran officially has none) forget it. A construct such as
> DOUBLEPRECISIONFUNCTIONMYFUN(X)
>will blow f90split out of the water.
>
>f90split is written in Perl. Perl is a high level language with
>implementations available (free) for most popular types of computer.
>To obtain Perl, set your web browser to
>
> http://www.perl.com/perl
Of course, if you prefer a F90 source for a f90split utility,
ftp://ftp.ifremer.fr/ifremer/ditigo/fortran90/f90split.f90.gz
has been freely available since April 1994, or even before (my
memory leaks as I am growing old).
See also
http://www.ifremer.fr/ditigo/molagnon/fortran90/
and
ftp://ftp.ifremer.fr/ifremer/ditigo/fortran90/moware-1.0.tar.gz
to get a F90 to PostScript list program and a F90 aware pre-processor
similar to cpp, but also pretty-printing the pre-processed code, in one
bundle with f90split.f90.
Michel
--
| Michel OLAGNON email : Michel.Olagnon@ifremer.fr|
| IFREMER: Institut Francais de Recherches pour l'Exploitation de la Mer|
| Centre de Brest - B.P. 70 phone : +33-2-9822 4144|
| F-29280 PLOUZANE - FRANCE fax : +33-2-9822 4135|
| http://www.ifremer.fr/ditigo/molagnon/molagnon.html |
------------------------------
Date: Fri, 25 Apr 1997 19:33:24 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ASCII Numeric conversion!?
Message-Id: <kgirj5.cv1.ln@localhost>
Her Yaw Seet (yaw@sunflowr.usd.edu) wrote:
: Hi,
: Does any of you have a good conversion algorithms or written
: perl routines to convert the below numeric format:
: 1,2,3,4,5..... <===> i,ii,iii,iv,v...
I dunno.
: 1,2,3,....26,27,28... <===> a,b,c,....z,aa,ab..
use perl "magic" (aka base 26 number system):
------------------------
#! /usr/bin/perl -w
$a='a';
foreach ($i=0; $i<750; $i++) {
print "$a\n";
$a++; # search for 'Autoincrement' in perlop man page
}
------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Sat, 26 Apr 1997 08:14:39 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: ASCII Numeric conversion!?
Message-Id: <E98K8F.K4L@nonexistent.com>
On Fri, 25 Apr 1997 18:48:03 -0500, Her Yaw Seet wrote in
comp.lang.perl.misc <URL: news:Pine.SOL.3.94.970425184051.11301A-100000@sunburst>:
++ Hi,
++ Does any of you have a good conversion algorithms or written
++ perl routines to convert the below numeric format:
++
++ 1,2,3,4,5..... <===> i,ii,iii,iv,v...
++ 1,2,3,....26,27,28... <===> a,b,c,....z,aa,ab..
++
Roman numbers are very easy once you know how to read them.
package Roman;
use strict;
use Carp;
use vars qw (@ISA @EXPORT_OK);
use Exporter;
@ISA = qw (Exporter);
@EXPORT_OK = qw (decimal_to_roman roman_to_decimal);
my @numbers = (
[M => 1000],
[CM => 900],
[D => 500],
[CD => 400],
[C => 100],
[XC => 90],
[L => 50],
[XL => 40],
[X => 10],
[IX => 9],
[V => 5],
[IV => 4],
[I => 1]
);
# Precondition: argument > 0.
sub decimal_to_roman ($) {
my $decimal = shift;
my $roman = "";
my @list = @numbers; # Local copy.
while ($decimal) {
while ($decimal >= $list [0] -> [1]) {
$roman .= $list [0] -> [0];
$decimal -= $list [0] -> [1];
}
shift @list;
}
$roman;
}
# Precondition: argument is a *valid* roman number.
# If argument isn't a valid roman number, it will most likely
# whine about uninitialized variables till the end of times.
sub roman_to_decimal ($) {
my $roman = shift;
my $decimal = 0;
my @list = @numbers; # Local copy;
while ($roman) {
while ($roman =~ /^$list[0]->[0]/i) {
$decimal += $list [0] -> [1];
$roman = $'; # Bleh.
}
shift @list;
}
$decimal;
}
For the string to number conversions, you could use:
sub decimal_to_string ($);
sub decimal_to_string ($) {
my $decimal = shift or return "";
decimal_to_string (int (($decimal - 1) / 26)) .
('a' .. 'z') [$decimal % 26 - 1];
}
sub string_to_decimal ($);
sub string_to_decimal ($) {
my $string = shift or return 0;
ord (chop $string) - ord ('a') + 1 + 26 * string_to_decimal ($string);
}
There is a slow variant for the decimal_to_string as well:
sub d_to_s ($) {my $d = shift; my $s = 'a'; while (-- $d && $s ++) {} $s;}
Abigail
------------------------------
Date: 26 Apr 1997 02:46:53 GMT
From: drake-@email.unc.edu (Drake Raft)
Subject: Automatic NNTP Usenet news reader & posting perl scripts.
Message-Id: <5jrqat$qnt$1@fddinewz.oit.unc.edu>
Hello there. I am looking to automate the reading, indexing and
posting of news to a couple of usenet newsgroups. Would anyone know where
I might start? Where is a good source of perl scripts? Thank you very
much. If you could please respond to mcgucken@physics.unc.edu, that would
be great. Thanks!
------------------------------
Date: 26 Apr 1997 12:32:11 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Bizarre question of the day...precedence with typeglob?
Message-Id: <5jsskb$548@pirate.shu.edu>
Hello -
I'm a little confused about what you're ultimately trying to do.
Why do you want "file.html" in the symbol table?
David Black
dblack@icarus.shu.edu
"Jon Adams" <jadams@pe-netsystems.com> writes:
>The bizarre problem (aka 'time-sink') of the day...
>The short version:
>I'm trying to create a reference to a glob typedef. Problem is, the object
>name that I'm trying to glob has a '.' in it, and that appears to be of
>higher precedence than the globbing operation. For example, if I try to
>\*this.html, what I end up with is a scalar string created by the
>concatenation of the results of \*this and the bareword 'html' (interpreted
>as a string)... GLOB{0x888888}html
[etc.]
------------------------------
Date: Fri, 25 Apr 1997 19:47:29 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dale Churchett <daleweb@io.com>
Subject: Re: Calculating dates
Message-Id: <Pine.GSO.3.96.970425194314.8773B-100000@kelly.teleport.com>
On Thu, 24 Apr 1997, Dale Churchett wrote:
> I'm trying to find out a way of converting a date returned by a call to
> `date` to yesterdays date:
Why call an external process and go to all that trouble? Use one of the
date calculation modules on CPAN and your life will be happier, the road
will be smoother, you'll lose weight, you'll find money, and you'll sleep
better at night. Well, maybe those things won't _all_ happen, but at least
you'll have a date. :-)
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Sat, 26 Apr 1997 11:11:40 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: I want to get a small face picture of Larry Wall.
Message-Id: <3361D4DC.446B@mrc-lmb.cam.ac.uk>
Has anybody got one?
thanks,
Jong
--
I support Perl, Linux ...
With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?
) Linux Newsletter
http://www.smli.com/people/john.ousterhout/scripting.html
------------------------------
Date: 26 Apr 1997 12:44:06 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Network Programming and Sockets
Message-Id: <memo.19970426134421.19297F@skep.compulink.co.uk.cix.co.uk>
In article <Pine.GSO.3.96.970424113146.24140A-100000@pickett>,
plussier@synnet.com (Paul Lussier) wrote:
>
>
> Hi all,
>
> This is my first venture into network programming, and dealing with
> writing client/server type scripts. I took the 2 examples Tom C. wrote
> on
> 194-5 of the perlref .pdf file and began playing with them. What I
> couldn't figure out, was how I would pass parameters from the client to
> the server. All the examples seem to have the server configured to only
> one thing (which is great for examples). But, for instance, how could I
> change Tom's example to accept different parameters?
>
> Currently, the client connects to the server, and the server outputs to
> the client:
>
> Hello there, <client name>, it's now <date>
>
> I'd like to be able to pass command line args from the client to the
> server. For example, something like:
>
> client "ls -l /usr/local"
>
> would pass the string "ls -l /usr/local" to the server, and the server
> would return the "ls -l" output of /usr/local on that machine.
> Obviously
> my goal is to accomplis more than just a remote "ls" server :)
>
> Any help would be greatly appreciated, or, any pointers to good docs on
> into to client/server programming would be great as well (any one write
> one in perl yet? :)
>
> Thanks a lot
>
Clients and servers talk to each other via the socket connection. To do
what you want, you need to develop a protocol that they both expect to be
adhered to. It can be as simple as :-
Client: Hello
Server: Greetings
Client: Incoming Data
Server: Give it to me, finish with 'End of Data'
Client: 13
Client: 10
Client: +
Client: End of Data
Server: Thanks - the answer is 23
Or just as complicated as you like. Most protocols are actually far more
pithy than this, computers aren't great conversationalists.
You need to read a good book on Unix Network programming, which,
doubtless, will be full of C code, but which you should be able to
transfer to your Perl writings. I have a copy of Unix Network Programming
by R. Stevens here, its a little old now, but may well have been updated.
Regards
Neil
------------------------------
Date: 26 Apr 1997 02:39:44 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: Notice to antispammers
Message-Id: <slrn5m2phl.jm.ljz@ljz.asfast.net>
On 25 Apr 1997 12:39:17 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
> I am creating a web page that contains the real addresses of everyone
> who posts a bogus address in their mail message. I'm tired of getting
> postings I can't reply to, and I don't see why we should suffer just
> because you can't keep the spammers off your back. Write your congressman
> or something. Meanwhile, all bogus email address will be tracked down,
> and the real addresses will be added to the "Please do not spam these
> people" page.
I feel I must respond here.
I understand and respect your desire to urge people not to munge their
email addresses for the purpose of avoiding spam. I also understand
and respect your annoyance and frustration at having to struggle with
this in your attempts to reply to postings from these people.
However, I disagree with your method for dealing with this. You are
actually expending time and effort to create a web page that will
thwart the efforts of many, many people who are doing their best to
keep spammers off their back.
These people who munge their addresses are not doing it to make things
difficult for *you*. I'm sure that most of them are not even thinking
about Tom Christiansen when they do this address munging. However,
despite this fact, you seem to be wanting to punish these people (by
making it easier for spammers to find them) simply because *you* find
their actions inconvenient.
Instead of spending your time and effort making things more difficult
for these people, I suggest that you put this same energy into one or
more of the following, more constructive pursuits:
(1) Writing some sort of Perl-based utility for yourself which will
help automate the process of un-munging people's email addresses
when you reply to news posts.
(2) Creating a web page that contains descriptions of useful and
effective methods of avoiding spam that don't involve address
munging.
(3) Creating a web page (yet another one) that contains routing information
from known spam creators so that people could use this info in
automated email filters.
(4) Joining in anti-spam letter-writing campaigns to congresspeople.
(5) Publicly complaining to the spammers, not to those who are trying
their best to avoid them.
(6) etc.
I very much respect you, and I know that my grateful feelings towards
you for your Perl knowledge and for the invaluable help you have
provided to people is shared by many others. However, it is my
heartfelt opinion that this idea about punishing address mungers does
not do you credit.
Please reconsider.
Thank you.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Sat, 26 Apr 1997 14:37:52 +0100
From: ab_news@albooth.demon.co.uk (Andrew Booth)
Subject: Re: Notice to antispammers
Message-Id: <AF87C3C09668B3C3F@albooth.demon.co.uk>
In article <5jr65q$cva$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc,
> stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>:What you will be doing is the spammer's work for them, handing them a
>:list of valid addresses on a platter.
>
>Yes, that's right. I intend to do that. Stop foisting the spam problem
>on others -- it needs to be addressed at the legislative level. By avoiding
>it, you merely delay fixing the problem.
>
Tom,
How on earth is this legislative solution going to work?
It doesn't take much intelligence to grep through newsgroups for email
addresses, then feed this into a mail program to spam people. We are
going to be stuck with these idiots for the forseeable future - if you
lock one person up for this, we will still have new spammers coming online
who 'don't know better' or just think that they can get away with it.
As for a legal solution:
a/ 90% or more of the spam I recieve is from the US - and I live in the UK
(why do these people bother sending me 'reduce IRS payments' spam when
I
don't pay the IRS a penny?). How am I to prosecute someone outside the
reach of my local courts?
b/ If you kill spamming in the US, the spammers will move abroad - and
we're
not going to get 100% international cooperation on this.
c/ A lot of the spam I recieve at the moment is for Ponzi schemes which
are
allready illegal
Tom, I suggest you chill out a bit. You are clearly irritated by having
false addresses cause email to be bounced back at you, but I suggest that
incitement to flame or spam these people is more against nettiquette than
the original action of providing a false address. I really don't think
it's unreasonable to want to take part in discussions without having your
family email address bombarded with 'cyberporn' spam. If I sent a letter to
a newspaper voicing an opinion on a subject, I really wouldn't expect them
to give my address out to enable any nutter out there to personally mail
me.
I would accept criticism of my point of view, but via the forum of the
newspaper letter page - the forum in which I had initially decided to talk.
> [courtesy cc of this posting sent to cited author via email]
>
Why?
I'm writing to news because I want to take part in a discussion with other
people. If I wanted to talk offline then I would use email. If I want to
discuss, I'll use news, and I don't really want to download the same reply
twice from someone.
Andrew Booth
(genuine email address supplied, spam filtering used)
------------------------------
Date: 26 Apr 1997 06:22:50 GMT
From: fjh@murlibobo.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <5js6vq$8mm@mulga.cs.mu.OZ.AU>
ark@research.att.com (Andrew Koenig) writes:
>Peter Ludemann <ludemann@inxight.com> writes:
>
>> But let's suppose that you really really really do need to identify a
>> particular subtree. In other words, you want to NAME it. No problem:
>> just create a dictionary (hash table) that maps names to subtrees.
>> That'll let you have two differently named entries which might happen
>> to have the same values. And it won't expose pointers. And it'll be
>> efficient.
>
>Yes and no. In a language that is completely referentially transparent,
>generating the names can be a problem, because there is no way to define
>a piece of code that represents the abstraction `Each time I build one of
>these nodes, I want it to have a globally unique label.' The language
>wouldn't be referentially transparent if I could write such a program.
>So the knowledge of the labels now has to pervade the entire system.
Martin Odersky has a nice solution to this problem --
a way to get globally unique labels in a local scope
without violating referential transparency, so that you
can do this sort of thing without the entire system needing to
know about the labels. See his paper on the lambda-nu calculus,
which is available from his home page (don't have a URL on-hand
right now, sorry). Unfortunately this has not yet been incorporated
into any existing programming language implementation, as far as
I am aware...
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
------------------------------
Date: 26 Apr 1997 08:30:54 GMT
From: "cc" <tejedor@nauta.es>
Subject: Passwork perl
Message-Id: <01bc521c$b1dc54a0$e40ce0c2@nauta.es>
Hello, I a program that when you write a work in a form, this program ask
in a database file and if this work ask right pass you, and is not right
denied pass, the database file is very little.
Thanks for all and sorry by my englihs.
Hola, necesito si es posible un programa para denegar o aceptar el acceso
de alguien consultando una palabra de un formulario en una base de datos, y
si es posible que cuando te deje acceder a la pagina en cuestion, te saludo
con tu nombre.
Gracias por todo
Carlos
------------------------------
Date: Sat, 26 Apr 1997 03:35:07 -0700
From: fredc <fredc@earthlink.net>
Subject: perl cgi to print to frame
Message-Id: <3361DA5B.726F@earthlink.net>
Hi,
Can someone please tell me how to direct the output from a perl cgi to a
frame rather than to a full page?
Thanks
Fred
------------------------------
Date: 26 Apr 1997 12:36:58 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: perl cgi to print to frame
Message-Id: <5jssta$55p@pirate.shu.edu>
Hello -
fredc <fredc@earthlink.net> writes:
>Hi,
>Can someone please tell me how to direct the output from a perl cgi to a
>frame rather than to a full page?
>Thanks
>Fred
Include the appropriate HTML markup in a call to print(). I'm sure
someone in comp.infosystems.www.authoring.cgi will those aspects of
your question not related to Perl.
David Black
dblack@icarus.shu.edu
------------------------------
Date: Sat, 26 Apr 1997 12:58:53 +0200
From: "Pascal Vermeulen" <Pascal.Vermeulen@ping.be>
Subject: Perl scripts don't work with Netscape and MSIE 4!! Help me please!!!
Message-Id: <5jsnb7$a1l@news2.Belgium.EU.net>
My company is running a database application with perl scripts. Everything
works fine with MS Explorer 3. But when I try to view my pages with
Netscape 3.01.... , Netscape keeps me asking what I want to do with my file
: save it or execute it with another app. MSIE4 platform preview refuses to
show the first frame!!!! I don't know if the cause of the malfunction is
the same for the two browsers.
The one that bothers me the most is the Netscape problem (must be bug with
IE4)
Please go take a look and let me know I you have any clues.
http://193.121.115.129/CVNet/CGI-bin/default.pl?frnl=fr
(the site is in french or dutch)
Kind regards,
Pascal Vermeulen
!!!!!!!!!! Use my company e-mail for response please : pvermeulen@orbem.iris
net.be
------------------------------
Date: Sat, 26 Apr 1997 13:11:53 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
To: pvermeulen@orbem.iris
Subject: Re: Perl scripts don't work with Netscape and MSIE 4!! Help me please!!!
Message-Id: <u4tcu7wti.fsf@sap-ag.de>
"Pascal Vermeulen" <Pascal.Vermeulen@ping.be> writes:
> My company is running a database application with perl scripts. Everything
> works fine with MS Explorer 3. But when I try to view my pages with
> Netscape 3.01.... , Netscape keeps me asking what I want to do with my file
> : save it or execute it with another Use.
You are not sending a proper MIME header from your script. The first
line the script prints must be:
Content-type: text/html
followed by two new lines. (i.e.,
# print("Content-type: text/html\n\n");
This question would be better answered in one of the CGI newsgroups;
however I recommend you look at the CGI.pm module:
<URL:http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html>
And the assorted FAQs:
<URL:http://www.perl.com/perl/faq/index.html>
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 25 Apr 1997 22:17:13 -0600
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: Randal Teaching Open Perl Class in NYC/Northern NJ AREA
Message-Id: <uowiv1afmeu.fsf@tremere.ecte.uswc.uswest.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, Steve Vanechanos <stevev@dynamicweb.com> writes:
>
> Your newsreader is broken.
>
> --tom
>
> :Content-Type: text/html; charset=iso-8859-1; name="perl_class.html"
> :Content-Transfer-Encoding: quoted-printable
> :Content-Disposition: inline; filename="perl_class.html"
> :Content-Base: "http://www.dynamicweb.com/perl_class.h
> : tml"
Tom, I believe you may have meant to say:
"Your web-browser-masquerading-as-a-newsreader is broken."
But I could be wrong.
Randy
--
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS Phone: (303)595-2869
Denver, CO rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin
===============================================================================
------------------------------
Date: Sat, 26 Apr 1997 06:09:59 GMT
From: putch@netcom.com (Michael Putch)
Subject: setlkw with fcntl
Message-Id: <putchE98EGn.D1K@netcom.com>
I am trying to do file locking in Perl 5.001 and, as mentioned in an
earlier post, the flock function is unimplemented for some reason. I am
therefore trying to do it with fcntl which *is* implemented but it keeps
giving me a "bad file number" error on the fcntl call. Here is what the
flock structure looks like on my system (from sys/fnctl.h):
typedef
struct flock {
short l_type;
short l_whence;
off_t l_start;
off_t l_len; /* len = 0 means until end of file */
#if defined( _M_I386 )
short l_sysid;
pid_t l_pid;
#else
short l_pid;
short l_sysid;
#endif /* _M_I386 */
} flock_t;
================================
And here is my little test program (Note: I also tried passing it an
ordinary variable set to 7 instead of the function as the second argument
and the result was the same: fcntl failed: bad file number.
=============================
#!/usr/ourbin/perl -w
$f_wrlck = 2;
sub f_setlkw {7;}
$ltemp="s2l2s2";
$lstruct = pack($ltemp, $f_wrlck, 0, 0, 0, 0 ,0);
open(FOO, "foo") || die("No foo?\n");
fcntl(FOO, &f_setlkw, $lstruct) || die("fcntl failed: $!\n");
print("Back from lock\n");
sleep(3607);
============================
And yes, the set lock and wait function on my system is indeed 7 (from the
same fcntl.h). And no, there is no fcntl.ph (or equivalent) on the
system, nor an h2ph (build not working, using precompiled binary, but
that is another story..)
Also tried eliminating the die after fcntl just in case it the error was
spurious and the lock really took. No dice -- it fell through "back from
lock" and went to sleep, but did not in fact have the lock since a second
process running the same program also fell right through to "Back from
lock" (which it shouldn't have done if the lock had taken).
------------------------------
Date: Sat, 26 Apr 1997 07:19:32 GMT
From: putch@netcom.com (Michael Putch)
Subject: Re: setlkw with fcntl
Message-Id: <putchE98HoK.E9H@netcom.com>
Michael Putch (putch@netcom.com) wrote:
: I am trying to do file locking in Perl 5.001 and, as mentioned in an
: earlier post, the flock function is unimplemented for some reason. I am
: therefore trying to do it with fcntl which *is* implemented but it keeps
: giving me a "bad file number" error on the fcntl call.
Naturally the solution came to me *after* I gave up and posted to the
newsgroup. The problem was that I was opening "foo" with the default
access of of Read Only, and you cannot get a Write lock on a read only
file descriptor. My apologies for the fire drill!
------------------------------
Date: Fri, 25 Apr 1997 17:53:18 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Substitute File Path For URL
Message-Id: <ukcrj5.2k1.ln@localhost>
Steve Sloan (stvsloan@longbow.com) wrote:
: I'm attempting to get a HTTP_REFERER file name and change it to the actual
: file name needed for reading. I can hardcode the URL and the path, i.e.
: 'http://www.longbow.com/" will always be the URL path, and the file path
: (from my cgi bin directory) will always be "../html/"
: I'm trying to do this:
: $urlPath = "http://www.longbow.com/";
: $filePath = "../html/";
: $fn = $ENV{'HTTP_REFERER'}; #returns "http://www.longbow.com/filename.html"
: ($fn = $fn) =~ tr/$urlPath/$filePath/; #want to return
^^^^^^^^^^^
What's that for?
: "../html/filename.html"
: Why is this not working?
Because you are using tr/// when you meant to use s/// ...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Sat, 26 Apr 1997 05:25:37 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: undump revisited?
Message-Id: <5js2j1$cgc$2@news3.microserve.net>
Let's try to understand:
Roger Smith <rsmith@proteus.arc.nasa.gov> wrote:
>I am looking for a good way to distribute a highly secure set of perl
>modules to over 3000 sites.
Do they know they are getting it? Are they asking for it? What is a
site? Is a site an email address, a web address, or a server?
> Obviously, sending source code in the clear
>with embedded passwords, etc., is not the way to do it.
What is in the clear? Perhaps you mean not encrypted, but then
why would you have to embedded passwords.
> There is also no
>gurantee that every remote site will have the perl interpreter
>installed.
Well, now they do not have perl! Then why are you sending perl code?
>I have been surfing the net for advise on undump but about half the
>pages I encounter literally say "maybe" and the other half say that this
>is an old (and apparently abandoned) concept.
I can not comment on undump. I have never used it. It is not in my
perl book and it is not in my UNIX book.
>Could one or more of you perl gurus out there comment on the viability
>of the undump concept, or is there another method I should be looking
>at. I am sure that many people have a need to distribute client/server
>models to many sites and would like to do it without requiring the perl
>interpreter or, especially, perl source code.
Again, you confuse me. You are sending perl code to a site that does
not have the prel interpreter?
Let's see if we can give some help. You are a USA government site, is
that right (gov)? Call the CIA <|:-). If you mean HIGHLY SECURE,
maybe the CIA is a good bet. If you mean private now that we can do.
Let's assume you are sending this perl code to a site that has a perl
executible of the current release. Also assume someone at that site
can understand a set of instructions. Email them the instructions at
a different time. Now the passwords and the decryption routine can be
separate.
At your end encrypt the source, to do this, there is a perl 'tr'
operator. Translate the perl source multiple times with different
'tr' tables. The 'tr' tables will work like passwords.
Now send your perl scripts (encrypted).
Write a perl script to reverse translate, this script should accept
the translate tables from STDIN.
Now send this translate perl script.
Send the instructions and the passwords (tr) separately via email.
This can prevent a lot of the common onlookers from viewing
the source. However, do not get too confident. You will be
transmitting these items over thousand of unprotected passages, where
anyone can trap them. If anyone gets both, they too will be able to
translate the source.
Well, now get a little more secure - send the instructions by a totaly
different medium like fax.
By the way, nothing is totally secure.
Hope this helps.
TR encrypt function.
Do it multiple times with different salts each time. A perl script
will work on other perl scripts. . .
>Thanks,
>Roger Smith
------- signature ----------
Check out the Perl site!
http://www.microserve.net/~soccer/
use password perlmisc
Geat tool for Developers>
------------------------------
Date: Sun, 27 Apr 1997 07:18:48 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: undump revisited?
Message-Id: <comdog-2704970718480001@nntp.netcruiser>
In article <5js2j1$cgc$2@news3.microserve.net>, soccer@microserve.net
(Geoffrey Hebert) wrote:
> At your end encrypt the source, to do this, there is a perl 'tr'
> operator. Translate the perl source multiple times with different
> 'tr' tables. The 'tr' tables will work like passwords.
when have you ever known passwords to munge your data?
furthermore, you can skip using tr/// several times. it doesn't gain you
anything. consider translating ( t -> r -> j -> 1 ), which you might
as well do it as (t -> 1). you've just re-inventing toy encrytption
suitable for elementary school study hall. why don't you just
uuencode it *heh*
> Send the instructions and the passwords (tr) separately via email.
how can this possibly be secure if you are sending the pad in the
clear? any encryption that relies on the attacker not knowing what
you did is bound to fail. why do you think everyone has been laughing
at the "security-through-obscurity" jokes?
> This can prevent a lot of the common onlookers from viewing
> the source. However, do not get too confident. You will be
> transmitting these items over thousand of unprotected passages, where
> anyone can trap them. If anyone gets both, they too will be able to
> translate the source.
they don't even need both! this sort of "encryption" is prone to
a character frequency attack, among a few others - especially since
the plaintext should pass the perl syntax checker...
> Well, now get a little more secure - send the instructions by a totaly
> different medium like fax.
>
> By the way, nothing is totally secure.
depends on your definition of secure.
> Hope this helps.
it doesn't. you are clueless. stop posting and start reading.
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: Sat, 26 Apr 1997 13:54:48 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: undump revisited?
Message-Id: <E98zzC.D70@world.std.com>
Roger Smith <rsmith@proteus.arc.nasa.gov> writes:
>I am looking for a good way to distribute a highly secure set of perl
>modules to over 3000 sites. Obviously, sending source code in the clear
>with embedded passwords, etc., is not the way to do it.
If the passwords are embedded in the source, they are embedded in the
executable.
Have you ever taken a look at what the "strings" command does?
Have you considered how easy it would be to disassemble a dumped perl
script? Run it in a debugger, find the function where perl fetches the
next opcode (Is it runops()? I'm not a perlguts hacker.) and then keep
reading each perl opcode that is about to be executed.
--
Andrew Langmead
------------------------------
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 376
*************************************