[7474] in Perl-Users-Digest
Perl-Users Digest, Issue: 1100 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 29 19:07:15 1997
Date: Mon, 29 Sep 97 16: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 Mon, 29 Sep 1997 Volume: 8 Number: 1100
Today's topics:
Re: *Sex with a Teenage Girl * ten.jpg CyberMarketing@csi.com
Re: [Q] Append to last line in file? <doug@tc.net>
Re: [Q] Append to last line in file? (Tom Grydeland)
Re: [Q] Append to last line in file? <rootbeer@teleport.com>
C backend with CGI.pm (Hallow)
Re: Embed perl and memory leaks.. <rootbeer@teleport.com>
Re: expect lib for perl? (Danny R. Faught)
Re: file globbing with spaces in the name <ptrainor@aura.title14.com>
Re: getting file fro ma remote computer ? <rootbeer@teleport.com>
Re: Hash of subroutine calls (Daveotlc)
Re: Hash of subroutine calls (Andrew M. Langmead)
Re: Makefile out of date... (Ken Williams)
Re: Msdos version stumps perl users ! (Bart Lateur)
Re: New Perl syntax idea <chris@ixlabs.com>
Re: New Perl syntax idea <chris@ixlabs.com>
Re: New Perl syntax idea (brian d foy)
Re: On-line perl manual? <rootbeer@teleport.com>
Re: ORA-01002 "fetch out of sequence" error with ORAPER <clamage@mime.dw.lucent.com>
Passing a class to a .xs (Scott Grosch)
Perl socket byte ordering question <msm@spaceworks.com>
Perl Venery (brian d foy)
Re: Perl4 is *not* Y2K (was Re: Y2K) <rootbeer@teleport.com>
Re: ROUNDING real numbers in perl (Tom Grydeland)
Re: sending mail via other programs. <ptrainor@aura.title14.com>
Re: Sprintf leak in HP-UX Perl 5.004!?! (Brian Atkins)
Test for alphabetic character? <ramonr@earthlink.net>
Re: Test for alphabetic character? (brian d foy)
Re: write question ? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Sep 1997 22:39:27 GMT
From: CyberMarketing@csi.com
Subject: Re: *Sex with a Teenage Girl * ten.jpg
Message-Id: <60pamv$10o$1@NNTP.MsState.Edu>
[ in comp.lang.perl .... ]
In article <34301ed6.0@news.inreach.com>, asdlfjasd@jflasdjf.com writes:
|> Check out the Hottest New Teen Sex Site on the Internet !!!
Hmmmm....what kind of moron spams a newsgroup frequented by Perl
hackers?
|> http://www.nasty-teens.com
Who's responsible for this crap, anyway?
%> whois nasty-teens.com
NTI (NASTY-TEENS2-DOM)
1643 W. 110th Street
Little Rock, AR 21644
US
Domain Name: NASTY-TEENS.COM
Administrative Contact, Technical Contact, Zone Contact:
Sudason, John (JS12001) sexyteens@JUNO.COM
201-985-9985 (FAX) 201-985-9987
Billing Contact:
Sudason, John (JS12001) sexyteens@JUNO.COM
201-985-9985 (FAX) 201-985-9987
Record last updated on 24-Sep-97.
Record created on 24-Sep-97.
Database last updated on 29-Sep-97 04:49:40 EDT.
Domain servers in listed order:
SAHARA.LLV.COM 205.254.164.2
MOJAVE.LLV.COM 205.254.164.3
Oh, kool! It's part of the world-famous LLV spam domain!
Administrative Contact:
Martin, Scott (SM681) inic@LLV.COM
702-631-4147 (FAX) 702-631-4147
------------------------------
Date: 29 Sep 1997 16:58:57 -0400
From: Douglas McNaught <doug@tc.net>
Subject: Re: [Q] Append to last line in file?
Message-Id: <m2zpovltv2.fsf@ono.tc.net>
thalerj_NOSPAM@wwa._NOSPAM.com writes:
> Actually yes, I do realize that. I must apologize for not being clearer
> in my original post. I had tried all of the following:
> seek FP, 0, 2;
> seek FP -1, 2;
> seek FP -10, 2;
> seek FP 0, 0;
>
> All of these seemed to give me the same result: adding a new line to
> the end of the file. This leads me to believe that seek will not set
> the file pointer when the file is open for appending.
Yup. That's what opening in append mode means. See the manpage.
> I will just go ahead with the method of reading in everything and
> spitting it back out again. However, I am curious why seek is not
> doing what I'd expect it to do in this case.
Because you open the file in append mode.
-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";
------------------------------
Date: 29 Sep 1997 20:55:14 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: [Q] Append to last line in file?
Message-Id: <slrn6305di.126.Tom.Grydeland@mitra.phys.uit.no>
On 26 Sep 1997 17:53:14 -0500,
thalerj_NOSPAM@wwa._NOSPAM.com <thalerj_NOSPAM@wwa._NOSPAM.com> wrote:
> Hi there. I'm having some difficulties, probably just with the syntax
> of what I'm trying to do. I am attempting to append a word to the
> end of the last line in a text file.
[...]
> But it's still printing the newtext on a new line at the end.
> Can anyone clue me in? I'm sure it's something simple.
>From what I've heard (but not verified), under some OS'es, opening in
append mode (">>whatever") will implicitly seek to end-of-file before
every write on that filehandle.
Perhaps you can get this to work by truncating the file to
some length < the original length.
Don't know if this works, and -- as pointed out by others -- this might
not really be what you want after all.
> Jay Thaler
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Mon, 29 Sep 1997 15:14:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: [Q] Append to last line in file?
Message-Id: <Pine.GSO.3.96.970929151041.12373W-100000@usertest.teleport.com>
On 29 Sep 1997 thalerj_NOSPAM@wwa._NOSPAM.com wrote:
> All of these seemed to give me the same result: adding a new line to
> the end of the file. This leads me to believe that seek will not set
> the file pointer when the file is open for appending.
Maybe that's a "feature" of your OS. If it is, I'd complain. :-)
> I am curious why seek is not doing what I'd expect it to do in this
> case.
Did perl pass all tests when it was installed on your system? In
particular, did it pass t/io/tell.t? 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/
Ask me about Perl trainings!
------------------------------
Date: 29 Sep 1997 22:46:06 GMT
From: hallow@webmages.com (Hallow)
Subject: C backend with CGI.pm
Message-Id: <60pb3e$mcm@winter.news.erols.com>
Anyone know why when I use the C backend to
compile a script using CGI.pm, I always
get the following error from the resulting
binary?
Can't locate object method "new" via package
"CGI" at test.pl line 4.
The perl script starts like this:
#!/usr/bin/perl
use CGI;
$query=new CGI;
Any clues/suggestions on getting it to compile
successfully?
Thanks,
Hallow
hallow@webmages.com
------------------------------
Date: Mon, 29 Sep 1997 14:15:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael O'Reilly <michael@metal.iinet.net.au>
Subject: Re: Embed perl and memory leaks..
Message-Id: <Pine.GSO.3.96.970929141500.12373Q-100000@usertest.teleport.com>
On 26 Sep 1997, Michael O'Reilly wrote:
> Is it just me, or do embeded perl interpreters leak memory like
> crazy???
They used to, before 5.004 cleaned up nearly every leak. (I've heard that
there's one more, though... :-)
--
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/
Ask me about Perl trainings!
------------------------------
Date: 29 Sep 1997 16:31:16 -0500
From: faught@convex.hp.com (Danny R. Faught)
Subject: Re: expect lib for perl?
Message-Id: <60p6n4$osr@feep.rsn.hp.com>
In article <m3souq3ylp.fsf@windlord.Stanford.EDU>,
Russ Allbery <rra@stanford.edu> wrote:
>Expect is very, *very* good at one specific thing, namely talking to
>interactive processes. From looking at it, I think it's still better at
>that than Perl is at the moment, even given Comm.pl. Perl's good at a lot
>of other things (and tackles a much broader array of problems) than Expect
>does. They really aren't in that much direct competition.
There are many esoteric features of expect that aren't likely to all
be available from perl in the near future. For example, the send_human
function which randomizes the inter-character arrival time.
Not that it's difficult, there just hasn't been a volunteer to port
all those features to perl.
--
Danny Faught -- HP-Convex -- Software Test Alchemist
"Everything is deeply intertwingled." (Ted Nelson, _Computer Lib_)
------------------------------
Date: Mon, 29 Sep 1997 18:05:59 -0400
From: Pat Trainor <ptrainor@aura.title14.com>
To: David Ransier <david_ransier@intercept.com>
Subject: Re: file globbing with spaces in the name
Message-Id: <Pine.LNX.3.95.970929180106.11798H-100000@aura>
You probably already have better responses to this, but you can
always delete files & dirs with the dir/filename in "quotes" in win32 and
unix, but many unix systems allow characters that your shell will barf on,
even with the ""'s. For that use the -i switch (interactive) and echo as
many Y's as you need to verify each file.
Hope that gives you some ideas.
On 28 Sep 1997, David Ransier wrote:
> I'm writing a recursive routine that will walk down a directory structure
> deleting files and sub directories.
pat
:)
# ptrainor@aura.title14.com (PT46) ptrainor@bbnplanet.net
# Perl, PHP/FI, *NIX, HTML, CGI, SQL, RDBMS, NT*, Security, Admin, ...
# "I've got LOTS of experience doing practically nothing!" -Heffer Wolfe
------------------------------
Date: Mon, 29 Sep 1997 15:09:05 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gal Samuel <nakadina@ibm.net>
Subject: Re: getting file fro ma remote computer ?
Message-Id: <Pine.GSO.3.96.970929150631.12373V-100000@usertest.teleport.com>
On Mon, 29 Sep 1997, Gal Samuel wrote:
> Can someone suggest a good way to open a file for further handling from an
> Internet URL ?
Yes; use the method listed in section 9 of the Perl FAQ. If 'perldoc
perlfaq9' doesn't give you that FAQ section, complain to whoever installed
Perl that 5.004 isn't set up right. :-) 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/
Ask me about Perl trainings!
------------------------------
Date: 29 Sep 1997 21:16:51 GMT
From: daveotlc@aol.com (Daveotlc)
Subject: Re: Hash of subroutine calls
Message-Id: <19970929211601.RAA21621@ladder02.news.aol.com>
Thanks, Greg. Playing around, I couldn't get the -> notation to work.
But this got me past the syntax scan.
my $doit = $lang_routine{$this_language};
next MEMBER_LINE if &$doit ($data,$lang_state,$comment_sw);
Unfortunately, that's not quite enough to solve my problem. Now I've run
into something in the plug-in itself. In a little more detail, it looks
like this:
$this_language = 'Visual Basic';
$lang_routine{$this_language} =
{
my $ignore_action = 0;
if ($_[1])
{
if ($_[1] eq 99) # looking for Attribute section
{
if ($_[0] =~ /^Attribute/)
{$_[1] = 1;} # State says found first Attribute
$ignore_action = 1; # ignore record
}
elsif ($_[0] =~ /^Attribute/) # found another Attribute record?
{$ignore_action = 1;} # ignore Attribute record
else # No attribute record, start processing
{
$_[1] = 0; # state says we've completed the header
$ignore_action = 0; # accept this record
}
}
$ignore_action = $ignore_action; # iron-clad final assignment
};
This gives me a syntax error near the first if in the anonymous subroutine.
Any hints or tips?
Enjoy,
Dave Olson
daveotlc@aol.com
------------------------------
Date: Mon, 29 Sep 1997 21:30:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Hash of subroutine calls
Message-Id: <EHAH28.7qs@world.std.com>
daveotlc@aol.com (Daveotlc) writes:
>$this_language = "Visual Basic";
>$lang_routine{"Visual Basic"} =
> { }
> . . . stuff. . .
> };
In perl, you can create a reference to a subroutine, (including
anonymous subroutines that have no entry in the symbol table) and
assign it to a scalar. (simple scalar, or an element of a hash or
array.)
So if you change it to:
$lang_routine{'Visual Basic'} = sub {
};
or
$lang_routine{'Visual Basic'} = \&visual_basic_parser;
sub visual_basic_parser {
}
Then you can call it like:
&{$lang_routine{$this_language}}($data,$lang_state,$comment_sw);
You might want to read up on references in the perlref man page for
more info.
--
Andrew Langmead
------------------------------
Date: Mon, 29 Sep 1997 17:33:38 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Makefile out of date...
Message-Id: <ken-2909971733380001@news.swarthmore.edu>
Hi-
I solved the problem myself. Turns out I needed to run "make realclean" -
once I did that I stopped getting the errors.
But I still can't get sfio to work =( .
In article <ken-2909971616520001@news.swarthmore.edu>,
ken@forum.swarthmore.edu (Ken Williams) wrote:
>Hi-
>
>I'm unsuccessfully trying to build sfio into Perl 5.004_01. Here's one of
>the errors I get:
>
> Making IO (dynamic)
>Makefile out-of-date with respect to ../../lib/Config.pm ../../config.h
>Cleaning current config before rebuilding Makefile...
>make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
>../../miniperl "-I../../lib" "-I../../lib" Makefile.PL "INSTALLDIRS=perl"
>"LIBPERL_A=libperl.a"
>Writing Makefile for IO
>==> Your Makefile has been rebuilt. <==
>==> Please rerun the make command. <==
>false
>*** Exit 1
>Stop.
>/usr/bin/make config failed, continuing anyway...
>../../miniperl -I../../lib -I../../lib ../../lib/ExtUtils/xsubpp
>-noprototypes -typemap ../../lib/ExtUtils/typemap IO.xs
> >IO.tc && mv IO.tc IO.c
>cc -c -DSTANDARD_C -I/usr/local/include/db
>-I/usr/local/src/sfio97/include -O4 -DVERSION=\"1.1504\"
>-DXS_VERSION=\
>"1.15\" -I../.. IO.c
>Running Mkbootstrap for IO ()
>chmod 644 IO.bs
>ar cr tmp.a IO.o
>: tmp.a
>LD_RUN_PATH="" ld -o ../../lib/auto/IO/IO.so -shared -expect_unresolved
>"*" -O4 -msym -s -L/usr/local/lib -L/usr/local/
>src/sfio97/lib -all tmp.a -none
>chmod 755 ../../lib/auto/IO/IO.so
>cp IO.bs ../../lib/auto/IO/IO.bs
>chmod 644 ../../lib/auto/IO/IO.bs
>
>
>I get similar errors for every module that's supposed to be dynamically linked.
>
>Rerunning the make command doesn't help. This make actually produces an
>executable, but it doesn't have sfio in it.
>
>I've seen this problem posted before and the problem was that the guy's
>machine's clock was a year off! This is not what's happening on my
>system. Also, the makefile is fresh, it was just created by Configure.
>
>I'll be grateful for some enlightenment.
>
>-Ken Williams
> The Math Forum
> ken@forum.swarthmore.edu
-Ken Williams
The Math Forum
ken@forum.swarthmore.edu
------------------------------
Date: Mon, 29 Sep 1997 21:45:31 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Msdos version stumps perl users !
Message-Id: <3430e96a.1761774@news.tornado.be>
scott@lighthouse.softbase.com (Scott McMahan) wrote:
>: I am very surprised that no one has come across this problem before ?
>
>Why? You could probably count the people still using DOS and
>developing Perl applications for it on one hand.
Since there isn't a native Win3.1 Perl, and a LOT of people still prefer
Win3.1 over Win95, as only new PC's get Win95 installed, there might be
more people in this situation than you'd guess.
But I have never felt the need to clear my screen from within Perl.
Bart.
------------------------------
Date: Mon, 29 Sep 1997 14:35:02 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Re: New Perl syntax idea
Message-Id: <34301F06.2298@ixlabs.com>
On Monday, September 29, 1997 1:38 PM, brian d foy
[SMTP:comdog@computerdog.com] wrote:
> maybe there should be comp.lang.perl.babble for people who don't
> think before they speak?
I'll just ignore this ;)
> >How about aliasing 'method' to 'sub' and passing the object reference
> >through a magic variable when 'method' is used?
>
> and what happens if i have more than one object of the same class?
Well, $objref->Method() passes the object reference as the first
parameter automatically.
This is already how Perl behaves.
I'm just trying to propose a more *perlish* solution where trivial
repetitive assignments such as
my $self = shift;
Are instrinsically taken care of for you.
How is my proposed implemetation making the instance ambiguous?
Chris
------------------------------
Date: Mon, 29 Sep 1997 14:37:43 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
To: Greg Bacon <gbacon@adtran.com>
Subject: Re: New Perl syntax idea
Message-Id: <34301FA7.5F09@ixlabs.com>
Greg Bacon wrote:
>
> In article <342FE73B.41C2@ixlabs.com>,
> Chris Schoenfeld <chris@ixlabs.com> writes:
> : How about aliasing 'method' to 'sub' and passing the object reference
> : through a magic variable when 'method' is used?
>
> What potential benefits do you see for such an addition?
To eliminate the repetitive use of:
my $self = shift;
Whose verbosity smells unperlish.
Does that make sense?
Chris
------------------------------
Date: Mon, 29 Sep 1997 18:38:07 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: New Perl syntax idea
Message-Id: <comdog-ya02408000R2909971838070001@news.panix.com>
In article <34301FA7.5F09@ixlabs.com>, chris@ixlabs.com wrote:
>To eliminate the repetitive use of:
>my $self = shift;
>
>Whose verbosity smells unperlish.
how would a method call look in such a case? perhaps you could
supply what you like a method would look like using this syntax...
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 29 Sep 1997 15:15:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Audrey Le <anl1@ee.msstate.edu>
Subject: Re: On-line perl manual?
Message-Id: <Pine.GSO.3.96.970929151427.12373X-100000@usertest.teleport.com>
On 29 Sep 1997, Audrey Le wrote:
> Does anyone know of a good (complete) on-line reference/manual for perl?
Type 'perldoc' and see if anything interesting happens. If nothing does,
complain to whoever allegedly installed Perl on your machine. :-)
--
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/
Ask me about Perl trainings!
------------------------------
Date: Mon, 29 Sep 1997 21:05:33 GMT
From: "Dan Clamage" <clamage@mime.dw.lucent.com>
Subject: Re: ORA-01002 "fetch out of sequence" error with ORAPERL
Message-Id: <01bccce1$c7d11e90$54110b87@clamagent>
A Fetch Out of Sequence means you're trying to read past the last row
fetched from the set. It indicates a logic flaw in your program.
- Dan Clamage
D461-David_F_Haertig(Dave)83040 <dfh@dwroll.lucent.com> wrote in article
<EH90H9.4Eo@drnews.dr.lucent.com>...
> Does anyone know what a "fetch out of sequence" (ORA-01002) error
> from Oracle means?
------------------------------
Date: 29 Sep 1997 20:49:34 GMT
From: grosch@ichips.intel.com (Scott Grosch)
Subject: Passing a class to a .xs
Message-Id: <60p48u$2c6@news.or.intel.com>
If I have this:
package Foo;
sub new {
my $class = shift;
bless { fileno => 1 }, $class;
}
and then I say '$bar = new Foo' $bar will be of class Foo.
Now I want to call $bar->somefunc() and have somefunc defined in my .xs file.
The somefunc routine needs to know $bar->{fileno} for what it will do. How do
I write things so that somefunc() in the .xs file knows about $bar?
All I can think to do is write AUTOLOAD so that it always passes in $bar, but
since not all the functions will need that data, this seems wasteful.
------------------------------
Date: Mon, 29 Sep 1997 18:09:25 -0400
From: Michael Mstowski <msm@spaceworks.com>
Subject: Perl socket byte ordering question
Message-Id: <34302715.779D@spaceworks.com>
I new to perl and have a simple socket question.
In C++, when I write a message on a network socket, I prefix it with
two bytes that declare the size of the message.
The C++ code to encode/decode the size would look like this:
unsigned short sz=512;
unsigned char bytes[2];
// Encode bytes
bytes[0]=sz>>8;
bytes[1]=sz;
... socket code to send buffer
unsigned short newsz;
unsigned char *p=(unsigned char *)bytes;
// Decode bytes
newsz=(*p<<8)|*(p+1);
... socket code to read buffer
I'd like to do the same thing in perl 5.x. How do you prefix
the size of a string using two bytes in a portable way?
Thanks,
Michael Mstowski
------------------------------
Date: Mon, 29 Sep 1997 17:11:01 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Perl Venery
Message-Id: <comdog-ya02408000R2909971711010001@news.panix.com>
have recently replied to a posting about LWP and using the phrase
"family of modules", i thought that there must be better collective
nouns for Perl thingy.
some of the obvious ones that don't necessarily deal with Perl:
a namespace of variables
a package of methods
and so on. surely the liguistically-leaning Perl types can come
up with more aesthetic ones :)
for an introduction to venery, see
<URL:http://biobase.dk/Embnetut/Personal/venereal.html>
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 29 Sep 1997 14:09:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: I R A Aggie <fl_aggie@thepentagon.com>
Subject: Re: Perl4 is *not* Y2K (was Re: Y2K)
Message-Id: <Pine.GSO.3.96.970929135609.12373O-100000@usertest.teleport.com>
On Mon, 29 Sep 1997, I R A Aggie wrote:
> So, you're saying that I should remove the perl4 that our vendor
> so thoughtfully included with their system software?
>
> Crimmy. And I *know* we have perl4 programs lying around.
Well, then maybe you shouldn't remove it _today_. Instead, you can tell
your users that it's going to be discontinued, and they need to convert
their old scripts to work with 5.004 (which, of course, you currently have
installed :-). You move the binary to /usr/local/bin/perl4isdead and you
set up a temporary symlink to go from its current location to the new one,
but you tell everybody to use the new name if they want to keep using
perl4 during the next two weeks' grace period.
A week later, you remove the symlink.
Another week after that, you turn off the binary's execute bits.
A month after that, you delete the binary.
At each step, you can easily backtrack if it looks like a catastrophe is
happening. Isn't this fun! :-)
--
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/
Ask me about Perl trainings!
------------------------------
Date: 29 Sep 1997 20:49:12 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: ROUNDING real numbers in perl
Message-Id: <slrn630528.126.Tom.Grydeland@mitra.phys.uit.no>
On Mon, 29 Sep 1997 16:36:17 GMT,
ben_feist@ideaguys.com <ben_feist@ideaguys.com> wrote:
> I've been looking for hours on the internet to find a resource that
> will tell me how to round a number in perl.
But looking in the documentation is too much to ask, is it?
FYI: This is a Frequently Asked Question. Answers to such are provided
with Perl, and it is an expected minimum level of research that people
consult these answers before posting questions to the newsgroup.
> I can't believe that I would have to root through MAN pages looking
> for the hidden function that I KNOW wouldn't be called "round" or
> anything intuitive like that.
So reading man pages is too much to ask, is it?
But you expect *us* to read the man pages for you?
> Could someone please post the command to round an integer. There
> doesn't seem to even be a truncate function.
perlfaq4.pod:=head2 Does perl have a round function? What about ceil()
and floor()?
> If anyone knows of a half decent online perl reference guide, please
> post the url.
Why should we provide you with any written documentation when you make
it *perfectly clear* that you don't intend to read it?
> End of rant.
uh huh.
> Ben Feist
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Mon, 29 Sep 1997 17:18:12 -0400
From: Pat Trainor <ptrainor@aura.title14.com>
To: David Wolfskill <david@dhw.vip.best.com>
Subject: Re: sending mail via other programs.
Message-Id: <Pine.LNX.3.95.970929170127.11798A-100000@aura>
This seems to be a mix of sendmail and perl, but forgive me if
either newsgroup is offended by this project.
On Sun, 28 Sep 1997, David Wolfskill wrote:
> Well, you could use 2 levels of mail servers: At the "outermost" level,
> you could have a sendmail (yeah, I know you said "other than sendmail";
> your stated requirements didn't seem to actually necessitate that,
> though) thatwould merely send outbound mail on its way.
Well, actually sendmail is not that bad, and even works in this
way:
(uhh.. I don't really work at work.com)
#!/usr/local/bin/perl
#
# mail BBN
#
$destination = "ptrainor\@work.com";
$replyto = "ptrainor\@work.com";
$to = "ptrainor\@work.com";
$from = "ptrainor\@work.com";
$subject = "Just a test...";
$xcomments = "I have no comment\n";
#
#
#
open (MAIL, "| /usr/bin/sendmail $destination") ||
die ("Can't open mailprog: \n");
print MAIL "Reply-to: $replyto\n";
print MAIL "From: $from\n";
#print MAIL "To: $to \n";
#print MAIL "Subject: $subject\n";
print MAIL "X-Comments: $xcomments";
LINE: while ($line = <STDIN>) {
next LINE if $line =~ /title14/; # get rid of original header
next LINE if $line =~ /^#/; # get rid of old sig & comments
next LINE if $line =~ /^_/; # get rid of quoted new sig
next LINE if $line =~ /^X-Sender/;
print MAIL "$line";
}
print MAIL " Pat Trainor \n";
print MAIL"____________sig here...________________\n";
print MAIL "ptrainor\@work.com\n";
print MAIL "\n";
close (MAIL);
#
# end of program...
#
Now, something obvious becomes apparent here. Although this lame
spoof works, it does not do what I need. It functions as a test proof that
the message can be generated, old sig deleted, and appear to be proper.
What it does not do is parse the original outbound (LINE:) before
hand and grab the old To: and other destination data before sending the
header to sendmail.
This script is invoked in /etc/aliases by:
work: "|/var/log/sm.bin/mailtest.pl"
So any message to work is piped to the above script.
I see another problem in that once the program reads the
destination domain (I am still unable to write a Ruleset 0 rule to pick
this up, despite the bat book!), will sendmail _re-parse_ it a second,
third, etc. time?
This next idea sounds interesting, but I may not know how to even
go about it!
> Internally, you could have a "MAIL_HUB" for each domain that is to
> appear to be different to the outside world, and each such MAIL_HUB
> would MASQUERADE_AS the specified domain, then use the external server
> as a "SMART_HOST". The internal machines could also do the necessary
> vetting of content, though that gets significantly nastier. Perl would
> probably be OK for that.
Content actually ended up being the easiest, I have no idea how to
go about these suggestions..
> For that matter, you could (perhaps) use a single internal MAIL_HUB and
> try to arrange things so that mail that hist the MAIL_HUB from inside
> first gets passed to a Perl script for handling the vetting &
> masquerading, then goes to the external server (as a SMART_HOST).
> Sounds ugly no matter what you do, though.
Sheesh, it sounded so easy at the onset! Any other ideas or
examples welcome.. Surely someone else has done this before!(?)
pat
:)
------------------------------
Date: 29 Sep 1997 21:45:04 GMT
From: atkins@PROBLEM_WITH_INEWS_GATEWAY_FILE (Brian Atkins)
Subject: Re: Sprintf leak in HP-UX Perl 5.004!?!
Message-Id: <60p7h0$mep@fcnews.fc.hp.com>
I'm seeing a nasty memory growth problem using sprintf.
Any information, fixes, whatever, would be greatly appreciated!
Thanks
Brian Atkins
------------------------------------------------------------------------
Brian Atkins atkins@fc.hp.com (970) 229-2114
Hewlett-Packard (MS B0) 3404 E. Harmony Road, Ft. Collins, CO 80525-9599
Here's a test program. Using top(1), this shows huge memory growth:
#!/opt/perl/bin/perl
for (;;)
{
my ($spam) = sprintf "I am %s", "spam";
}
Here's my perl info:
Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
Platform:
osname=hpux, osvers=10, archname=PA-RISC1.1
uname='hp-ux testk200 b.10.10 a 9000819 31621351 two-user license '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
Compiler:
cc='/opt/ansic/bin/cc', optimize='-O', gccversion=
cppflags='-D_HPUX_SOURCE -Aa'
ccflags ='-D_HPUX_SOURCE -Aa'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='ld', ldflags ='-L/usr/local/lib -L/usr/lib/pa1.1'
libpth=/usr/local/lib /usr/lib/pa1.1 /usr/lib /usr/ccs/lib
libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
libc=/usr/lib/libc.sl, so=sl
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='+z', lddlflags='-b -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under hpux
Compiled at Jun 16 1997 10:31:55
@INC:
/opt/perl5.004_01/lib/PA-RISC1.1/5.00401
/opt/perl5.004_01/lib
/opt/perl5.004_01/lib/site_perl/PA-RISC1.1
/opt/perl5.004_01/lib/site_perl
.
------------------------------
Date: Mon, 29 Sep 1997 15:53:06 -0400
From: "Ramon Rodriguez" <ramonr@earthlink.net>
Subject: Test for alphabetic character?
Message-Id: <60p0vd$9ri@news1.zippo.com>
How can I test to see if some user input in a cgi script is text or
numeric(what I'll accept) in Perl5? Thanks in advance.
Ramon Rodriguez
------------------------------
Date: Mon, 29 Sep 1997 18:47:18 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Test for alphabetic character?
Message-Id: <comdog-ya02408000R2909971847180001@news.panix.com>
In article <60p0vd$9ri@news1.zippo.com>, "Ramon Rodriguez" <ramonr@earthlink.net> wrote:
>How can I test to see if some user input in a cgi script is text or
>numeric(what I'll accept) in Perl5? Thanks in advance.
check the perl FAQ (Section 4) [1], which contains the question (and
answer)
How do I determine whether a scalar is a
number/whole/integer/float?
[1] the Perl FAQ is available as part of the bundled manual pages,
and can be accessed from The Perl Language Homepage
<URL:http://www.perl.com>. there's more than one way to do it. ;)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 29 Sep 1997 14:13:32 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Doug Simon <simondr@cig.mot.com>
Subject: Re: write question ?
Message-Id: <Pine.GSO.3.96.970929141023.12373P-100000@usertest.teleport.com>
On Mon, 29 Sep 1997, Doug Simon wrote:
> I am trying to capture the output of :
>
> write;
>
> Into a variable.
Check out the formline function, documented in perlfunc(1).
> I have been successful by redirecting STDOUT to a file, and then reading
> the file into a variable. However, my problem is that I can not get
> STDOUT back to normal!!! I have tried almost everything.
The entry on open() in the perlfunc(1) manpage has information on duping
and re-opening a filehandle, although you could also use write to a
different filehandle than STDOUT. 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/
Ask me about Perl trainings!
------------------------------
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 1100
**************************************