[7079] in Perl-Users-Digest
Perl-Users Digest, Issue: 699 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 7 22:47:20 1997
Date: Mon, 7 Jul 97 18:01:36 -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, 7 Jul 1997 Volume: 8 Number: 699
Today's topics:
$| and STDOUT (Frank Heckes)
Re: $| and STDOUT <Mark_Gardner@merck.com>
12 FREE Perl Scripts... <webmaster@stepweb.com>
Re: 12 FREE Perl Scripts... (Jeremy D. Zawodny)
Re: 500 Server Error - Perl & Win 95 PWS (Michael Adams)
Re: 500 Server Error - Perl & Win 95 PWS <waikong@verdana.com>
Re: 500 Server Error - Perl & Win 95 PWS <rootbeer@teleport.com>
Re: [error message] Premature end of script headers <rootbeer@teleport.com>
[HELP Perl 5.004] how to release resources occupied by (Iap SinGuan)
Re: A logical Problem: Rounding to $ and Cents (Tad McClellan)
Re: a2p subroutine not found [THANKS] (David Zeng)
Advice sought: java for perl programmers <Axel_Mahler@acm.org>
Re: Advice sought: java for perl programmers (Tad McClellan)
Altering auto.direct (Patrick Baldwin)
Announce : SWIG 1.1 (David Beazley)
ANNOUNCE: Net::DNS 0.11 (Michael Fuhr)
Re: Any Module for TAR archives available? (Michael Schilli)
Re: Arrays of filehandles (Non-OOP) <zenin@best.com>
Re: Arrays of filehandles (Non-OOP) (Bart Lateur)
Beginning Perl Programming Tutorial (John Donnelly)
Re: Benchmark Perl5 Processing 1 Gig (Abigail)
Best idiom for defaulting, getting & untainting an env (dave)
Re: C to Perl.... <xrcc0494@dcaca037.ca.boeing.com>
Re: Can an array have two subscripts (i.e., @array (i,j (Tad McClellan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Jul 1997 17:05:03 GMT
From: hz258he@vol-hrz.uni-duisburg.de (Frank Heckes)
Subject: $| and STDOUT
Message-Id: <5pr7jv$jtr$1@news-hrz.uni-duisburg.de>
Hello,
I set $| to 1 (nevertheless 0 yields the same result) open a file for
(open(NOTEFILE, ">>$notefile"); ) writing and use
print( NOTEFILE "echo \"$source_pobnotice\" >> $bop\n");
to write to the file specified by filehandle NOTEFILE. The program writes
only once to stdout, too. If I give a longer string as argument to print
all lines will be printed on stdout (btw the print statement is inside a
while loop). Can someone explain this to me? Thanks in advance.
Bye
Frank Heckes
------------------------------
Date: Mon, 07 Jul 1997 15:46:12 -0400
From: "Mark J. Gardner" <Mark_Gardner@merck.com>
Subject: Re: $| and STDOUT
Message-Id: <33C14784.43C6026A@merck.com>
Frank Heckes wrote:
> I set $| to 1 (nevertheless 0 yields the same result) open a file for
> (open(NOTEFILE, ">>$notefile"); ) writing and use
>
> print( NOTEFILE "echo \"$source_pobnotice\" >> $bop\n");
>
> to write to the file specified by filehandle NOTEFILE. The program
> writes
> only once to stdout, too. If I give a longer string as argument to
> print
> all lines will be printed on stdout (btw the print statement is inside
> a
> while loop). Can someone explain this to me? Thanks in advance.
Setting $| only affects the currently-selected filehandle. To change the
behavior of the NOTEFILE handle, first do select(NOTEFILE). This will
make things like print go to NOTEFILE instead of STDOUT.
--MJG
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: Fri, 4 Jul 1997 01:40:45 GMT
From: webmaster <webmaster@stepweb.com>
Subject: 12 FREE Perl Scripts...
Message-Id: <ECrr4B.M0G@nonexistent.com>
Hi everybody,
We have written written 12 Perl Scripts that
can be used by any personal website for FREE.
The Scripts are:
+ CheckME version 3.2
+ MessageBulletin version 2.1
+ MicroNet version 1.1
+ SWS version 2.1
+ Counter version 1.0
+ GuestPost version 2.0
+ AutoMail version 2.0
+ BanEx version 2.1
+ Fake AutoResponder version 1.0
+ Reciprocator version 1.2
+ Hi5 version 1.1
+ StatsCounter version 1.0
And all these for absolutely FREE!
http://www.stepweb.com
Pay us a visit, but please remember that our
entire website is under construction.
Sincerely,
StepWeb.Com Staff
------------------------------
Date: Mon, 07 Jul 1997 16:50:48 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: 12 FREE Perl Scripts...
Message-Id: <33c11e2e.443533277@igate.hst.moc.com>
On Fri, 4 Jul 1997 01:40:45 GMT, webmaster <webmaster@stepweb.com>
wrote:
>Hi everybody,
>
>We have written written 12 Perl Scripts that
>can be used by any personal website for FREE.
Great.
> http://www.stepweb.com
>
>Pay us a visit, but please remember that our
>entire website is under construction.
Then why advertise it? why not spend a few hours getting it done and
then letting the world to know? Wouldn't we have a better perception
of what you're about?
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com
------------------------------
Date: Mon, 7 Jul 1997 19:53:21 GMT
From: msadams@netcom.com (Michael Adams)
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <msadamsECysKy.8E@netcom.com>
Abigail (abigail@fnx.com) wrote:
: Michael Adams (msadams@netcom.com) wrote on 1404 September 1993 in
: <URL: news:msadamsECv9zp.FDw@netcom.com>:
: ++
: ++ It would appear that it is not loading the Perl script.
: So, it's not a Perl question. Try a more appropriate group, like
: rec.pets.penguins, sci.trainspotting, comp.infosystems.www.authoring.cgi,
: misc.test, comp.infosystems.www.servers.ms-windows or alt.tla.
I am sorry to bother you and everyone else on this Usenet with my
"inappropriate" questions, but I have reached a deadend. I figured if
anyone would know the answer it would be people on this Usenet. You can
see I did not just post my stupid question without doing some research. I
am also not the only one with this problem. You will find another one
just two entries below mine.
I bought S. Sol's book over the weekend, and he mentions that the 500
error is a catchall, meaning that I could do a number of things and get
the same 500 Server Error. It is obvious that the ActiveWare Perl for Win32
is incomplete in its installation. I would just like to get some help
from someone who has already gone through this.
Any help would be appreciated.
Michael Adams
--
msadams@netcom.com
------------------------------
Date: Mon, 07 Jul 1997 16:42:24 -0700
From: Wai-Kong Sung <waikong@verdana.com>
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <33C17EE0.5FAD@verdana.com>
Michael Adams wrote:
>
> Abigail (abigail@fnx.com) wrote:
> : Michael Adams (msadams@netcom.com) wrote on 1404 September 1993 in
> : <URL: news:msadamsECv9zp.FDw@netcom.com>:
> : ++
> : ++ It would appear that it is not loading the Perl script.
>
> : So, it's not a Perl question. Try a more appropriate group, like
> : rec.pets.penguins, sci.trainspotting, comp.infosystems.www.authoring.cgi,
> : misc.test, comp.infosystems.www.servers.ms-windows or alt.tla.
>
> I am sorry to bother you and everyone else on this Usenet with my
> "inappropriate" questions, but I have reached a deadend. I figured if
> anyone would know the answer it would be people on this Usenet. You can
> see I did not just post my stupid question without doing some research. I
> am also not the only one with this problem. You will find another one
> just two entries below mine.
>
> I bought S. Sol's book over the weekend, and he mentions that the 500
> error is a catchall, meaning that I could do a number of things and get
> the same 500 Server Error. It is obvious that the ActiveWare Perl for Win32
> is incomplete in its installation. I would just like to get some help
> from someone who has already gone through this.
>
> Any help would be appreciated.
>
> Michael Adams
> --
> msadams@netcom.com
Take a look this entry in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script
Map
You should have an value mapping .pl(plx) to your perl.exe(perl.dll).
hope it helps!
wai-kong
------------------------------
Date: Mon, 7 Jul 1997 16:15:02 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Adams <msadams@netcom.com>
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <Pine.GSO.3.96.970707160940.10643R-100000@kelly.teleport.com>
On Mon, 7 Jul 1997, Michael Adams wrote:
> I am sorry to bother you and everyone else on this Usenet with my
> "inappropriate" questions, but I have reached a deadend.
I have a lot of sympathy, but that doesn't make your question
appropriate.
You've said that you can't get the server to use Perl to execute your
script. Therefore, it doesn't matter how much we can tell you about Perl,
that script ain't getting executed.
You need to read your server's docs to find out how to configure it. If
that doesn't give you the answer, then find a server newsgroup and see
whether they've been discussing this already (they have) and whether
they've got an answer to your problem (they probably do). If you can't
find an answer that way, check that newsgroup's FAQ, which probably has
the answer. If, after all this, you still haven't found what you need, you
should be able to post the question on the newsgroup about servers.
Then, when you've got your server set up to run your scripts, if you can't
get Perl to do what you want, once you've read the docs and FAQs, come
back here. We know all about Perl here, and we welcome your questions.
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: Mon, 7 Jul 1997 10:04:06 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Max <pyz@panix.com>
Subject: Re: [error message] Premature end of script headers
Message-Id: <Pine.GSO.3.96.970707100347.9019Z-100000@kelly.teleport.com>
On 7 Jul 1997, Max wrote:
> Subject: [error message] Premature end of script headers
> Everytime I've run this script which I've been testing I get the above
> error message.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!
http://www.perl.com/perl/
http://www.perl.com/perl/faq/
http://www.perl.com/perl/faq/idiots-guide.html
--
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: 7 Jul 1997 07:31:39 GMT
From: iap@iis.sinica.edu.tw (Iap SinGuan)
Subject: [HELP Perl 5.004] how to release resources occupied by no longer used modules in which "unimport" method is not defined ?
Message-Id: <5pq60r$k9r$1@gate.sinica.edu.tw>
I installed the Perl 5.004, and test the following code:
use CGI;
$cgi=new CGI;
no CGI;
Then got the following error message:
Undefined subroutine CGI::unimport
BEGIN failed--compilation aborted at - line 3.
But , this did not cause an error in Perl 5.003.
In fact, all modules which have not a sub routine called "unimport" will
cause this kind of error in Perl 5.004.
My question is , in Perl 5.004,
how to release resources occupied by no longer used modules
in which "unimport" method is not defined ?
Thanks for any suggestion.
Iap SinGuan
------------------------------
Date: Mon, 7 Jul 1997 06:19:49 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: A logical Problem: Rounding to $ and Cents
Message-Id: <lcjqp5.ql.ln@localhost>
Scarcat (scarcat@followme.com) wrote:
: O.K. here we go...
: Assuming: a numnerical value of 12.34
: was read in from a file, and placed inside the variable $sum
Consider having $sum = 1234 instead. Work with integers for as
long as you can, then convert to "dollars and cents" only on final
output. By working with integers, you avoid the issue of floating
point representations in binary.
: and...
: you multiply the variable sum by 2 using
: $sum = $sum *2;
: you should get 24.68, correct?... uh no.
: instead I get 24.679999999999999
: ...
: I've tried to get around it a number of ways including multiplying it by 100,
: then throwing the
: $sum=INT($sum);
: command to work on it, but calculating the decimal places is
: more work than it it worth.
: ...
: Can Someone tell me what the heck is going on here?
What is going on here is a consequence of how floating point numbers
are stored in computers. Some FP numbers cannot be represented exactly.
The best solution is to work with integers, and only convert to FP
when done with your calculations.
A less satisfying "solution" is to use sprintf() to round off the number.
: Please e-mail me @
: hector@netside-cafe.on.ca should you have any suggestions.
Please read the newsgroup where you asked the question should you
want the answer to the question.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 7 Jul 1997 16:33:47 -0700
From: dizzy@soda.CSUA.Berkeley.EDU (David Zeng)
Subject: Re: a2p subroutine not found [THANKS]
Message-Id: <5prucr$kij@soda.CSUA.Berkeley.EDU>
Thanks for all the answers and tips I've already got within a couple
hours of posting my questions. I really appreciate it.
Here's my first impression about this newsgroup:
Friendly and Helpful People
David Zeng
------------------------------
Date: Fri, 04 Jul 1997 14:55:08 +0200
From: Axel Mahler <Axel_Mahler@acm.org>
Subject: Advice sought: java for perl programmers
Message-Id: <33BCF2AC.340A63C4@acm.org>
I hope I won't get hung for treason, but....
Does anybody out there know of a guide to "doing perl-ish things in
Java" - especially regexps, signal handling, etc. ?
--
Axel.
===============================================================================
Axel Mahler
Lampen & Mahler Software-Engineering GmbH, Berlin
------------------------------
Date: Fri, 4 Jul 1997 13:35:36 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Advice sought: java for perl programmers
Message-Id: <opfjp5.f2a.ln@localhost>
Axel Mahler (Axel_Mahler@acm.org) wrote:
: I hope I won't get hung for treason, but....
: Does anybody out there know of a guide to "doing perl-ish things in
: Java" - especially regexps, signal handling, etc. ?
I've been meaning to check out these two "perl style regex"
Java packages:
http://www.oroinc.com/
http://www.win.net/~stevesoft/pat/
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 3 Jul 1997 21:16:47 GMT
From: pbaldwin@mrst.com (Patrick Baldwin)
Subject: Altering auto.direct
Message-Id: <slrn5ro5nl.r5f.pbaldwin@spectre.mrst.com>
I've been having to alter the auto.direct file on MANY systems
lately, making the same changes to all of them. Basically,
I either comment out or add in the same entry on a variety of machines,
as old systems are taken offline or put back on the network.
This seems to me to be a good task for Perl.
Essentially, I believe these would be the necessary steps:
1)Login as root
2)edit the auto.direct to reflect the change (either commenting out, or
adding in, possibly through un-commenting)
3)Find automount process ID
4)Kill automount
5)Re-start automount
6)logout
Also, I'd be making the same set of changes to many different machines.
My actual questions are:
1)Would Pearl be better than a shell script?
2)Does a tool to do this sort of thing already exist? It seem like
a common enough task that their should be somehting, but no archives
I found had anything, nor did Deja-News turn up anything.
Any implementation suggestions also more than welcome.
Thank you for your time.
-P. Baldwin
------------------------------
Date: 6 Jul 1997 20:06:12 GMT
From: beazley@elmo.cs.utah.edu (David Beazley)
Subject: Announce : SWIG 1.1
Message-Id: <5potrk$l6p$1@nadine.teleport.com>
Announcing SWIG 1.1
July 5, 1997
I'm pleased to announce the release of SWIG 1.1 which is available via
anonymous FTP at
ftp://ftp.cs.utah.edu/pub/beazley/SWIG
The distribution has also been uploaded to a number of other
locations so it may be available from common FTP archives.
More information is available on the SWIG homepage at
http://www.cs.utah.edu/~beazley/SWIG
1. What is SWIG? (Short Summary)
----------------------------------
SWIG (Simplified Wrapper and Interface Generator), is a programming
tool that has been developed to simplify the integration of C, C++,
and Objective-C with common scripting languages and interpreted
environments including Perl, Python, and Tcl. In a nutshell, SWIG is
a compiler that turns ANSI C/C++ declarations into the bindings needed
to access C from a scripting language. SWIG requires few (if any)
modifications to the underlying C code and allows scripting to be
added to most types of existing C and C++ programs. SWIG is
independent of the target scripting language--providing the "freedom
of choice" to use your favorite scripting language (or the language
best suited for the task at hand). Scripting languages have a proven
record in the development and management of complex software, creation
of user interfaces, rapid prototyping, component gluing, tool
construction, and code development. By (hopefully) simplifying the
process of building scripting interfaces, SWIG hopes to bring many of
the benefits of scripting to C-based applications.
2. A Simple SWIG Example
-------------------------
Suppose you really liked computing factorials and you wanted to have
a scripted version of the factorial function. Here's a C function :
/* fact.c */
int fact(int n) {
if (n <= 1) return 1;
else return n*fact(n-1);
}
Here's a SWIG interface specification file for it:
// fact.i : SWIG Interface file
%module fact
extern int fact(int n);
Now, let's build a few scripting language modules. First, a Perl module :
unix> swig -perl5 fact.i
Making wrappers for Perl5
unix> gcc -c fact.c fact_wrap.c \
-I/usr/local/lib/perl5/sun4-solaris/5.003/CORE
unix> ld -G fact.o fact_wrap.o -o fact.so
unix> perl5
use fact;
print fact::fact(4),"\n";
<ctrl-d>
24
Now a Python module :
unix> swig -python fact.i
Making wrappers for Python
unix> gcc -c fact.c fact_wrap.c -I/usr/local/include/python1.4 \
-I/usr/local/lib/python1.4/lib
unix> ld -shared fact.o fact_wrap.o -o factmodule.so
unix> python
Python 1.4 (Mar 26 1997) [GCC 2.7.2]
Copyright 1991-1996 Stichting Mathematisch Centrum
Amsterdam
>>> import fact
>>> print fact.fact(4)
24
Finally, a Tcl module :
unix> swig -tcl fact.i
Making wrappers for Tcl.
unix> gcc -c fact.c fact_wrap.c -I/usr/local/include
unix> ld -shared fact.o fact_wrap.o -o fact.so
unix> tclsh
% load ./fact.so fact
% fact 4
24
%
By now, you get the idea. In a matter of minutes, we've created
interfaces to three different scripting languages. Our original C
function remains unchanged as does our SWIG interface file. Of
course, this is only a simplistic example--SWIG interfaces can contain
hundreds of functions, variables, constants, structures, and class
definitions.
3. SWIG Features
-----------------
SWIG has been designed to work with most types of C code and a moderate
subset of C++ and Objective-C. Here is a short summary of SWIG's
capabilities :
C Support
* Uses ANSI C/C++ syntax (if you've written a header file, then
you know how to use SWIG).
* Supports almost all C fundamental datatypes
(int, short, char, long, float, double, void)
* Provides type-checked C/C++ pointers for manipulating
arrays, structures, and objects.
* C++ class parsing
* Constructors
* Destructors
* Member functions and attributes
* Virtual functions
* Static functions.
* Public inheritance (including multiple inheritance)
* References
* Partial template support
* Objective-C parsing (experimental). SWIG can turn Objective-C
interface definitions into scripting language bindings.
* Requires no modifications to existing code (works with ordinary C
functions).
* Can operate with incomplete and partial information.
Target scripting languages :
* Perl5 (including Perl 5.004 and ActiveWare Perl for Win32)
* Python (version 1.3 or later)
* Tcl (7.3 or later, including 8.0b1)
Other SWIG features :
* Extensive support for multiple files and modules.
* Advanced customization options. SWIG's output can be
customized in almost any manner giving a programmer
a great deal of flexibility.
* Automatic documentation generation (ASCII, HTML, LaTeX).
* User definable exception handling.
* Extensible with new language modules
* Fully documented (> 300 pages)
* Easy installation via a GNU autoconf configure script.
* Includes a large directory of examples.
4. Object-Oriented Features
---------------------------
Given the definitions of C structures, C++ classes, and Objective-C
interfaces, SWIG can produce "object-oriented" scripting interfaces. This
makes full use of the object-oriented features of the target scripting
language. For example, C++ classes can be accessed as if they were Perl 5
classes. Objective-C interfaces look and act like Python classes. C
structures can become Tcl objects--well you get the idea. It is also
possible for SWIG to turn ordinary C structures into scripting language
classes with constructors, destructors, and method functions.
A key aspect of SWIG's support for objects is that it manipulates all
C/C++/Objective-C objects by reference (ie. type-checked pointers).
This approach avoids problems related to object "representation" and
allows SWIG to work with almost any kind of object. Such a scheme is
critical for working with legacy applications--especially situations
where the structure of underlying objects can not be modified or can
not be easily represented in a scripting environment.
5. Developed for real applications
----------------------------------
SWIG was originally developed in the Theoretical Physics Division at
Los Alamos National Laboratory to build scripting interfaces to
high-performance simulation codes, supercomputing applications,
visualization libraries, and data analysis tools. It was critical
that SWIG be able to work with "legacy" codes, be relatively easy to
use, and operate effectively in a hostile environment of rapidly
changing systems and software. One of SWIG's strengths is its ability
to work with existing code and to build interfaces from only partial
information.
Because of SWIG's flexibility, it is now being used in an increasing
number of applications areas such as CAD, scientific computing,
financial, Internet, database, and program development. SWIG has even
been used to build scripting interfaces to systems relying on other
tools such as COM and CORBA.
6. Limitations of SWIG
------------------------
While SWIG handles a wide variety of C/C++ code, SWIG does not currently
support every conceivable C/C++ feature. Most notably, there are problems
with the following :
* Variable length arguments
* Overloading (functions or operators)
* Function pointers (partially supported with typedef).
* An assortment of C++ features (pointers to member functions,
expression templates, namespaces, etc...)
Many of these limitations may be lifted in future releases.
It should also be noted that SWIG lacks an degree of "formalism" that
might be found in more sophisticated "software engineering" tools.
SWIG was developed to build scripting interface to real code--it does
very little in the way of enforcing specific rules, requiring a
particular programming style, or legislating programming "morality." I
believe these are positive qualities, but also emphasize that some
software projects may demand more "formality" than SWIG can provide.
In other words, your mileage may vary.
7. Compatibility
-----------------
SWIG supports most flavors of Unix and Windows NT/95. It fully supports
Perl, Python, and Tcl programming on both platforms. An experimental
Macintosh version of SWIG is also available.
To compile and use SWIG, you will need :
* A C++ compiler (e.g. g++, MSVC++)
* An ANSI C compiler (if using C code).
* yacc or bison (only needed if rebuilding the SWIG parser)
* At least one supported scripting language (or SWIG will
be fairly useless).
8. SWIG is free
----------------
SWIG is free software. You can do anything you want with it (including
modification and distribution), provided that you retain its original
copyright notices, don't claim that you wrote it, and don't sue people if
it breaks (SWIG comes "as is").
The code generated by SWIG can be used in any manner (including
commercial). The SWIG compiler can also be distributed provided its
copyright notices are retained. By making the compiler freely
distributable, not only can SWIG be used to build scripting-based systems,
it can be given to users as a tool for extending such systems with new
C/C++ functions.
9. Availability and Resources
--------------------------------
SWIG is available via anonymous FTP at :
ftp://ftp.cs.utah.edu/pub/beazley/SWIG
The SWIG homepage contains up-to-date information and online documentation :
http://www.cs.utah.edu/~beazley/SWIG
You can subscribe to the SWIG mailing list by sending a message to
'Majordomo@cs.utah.edu' with the following body :
subscribe swig
The mailing list currently has about 190 subscribers and is a forum
for discussing SWIG's future development, announcement of new releases,
and other related information.
SWIG is extensively documented and comes with a 300 page user manual
describing everything from how to use SWIG with various scripting
languages to how to write your own scripting language modules.
Further questions about SWIG can be sent to the e-mail address below.
Cheers,
Dave Beazley
---------------------------------------------------------------------
Dave Beazley
Department of Computer Science
University of Utah
Salt Lake City, Utah 84112
beazley@cs.utah.edu http://www.cs.utah.edu/~beazley
---------------------------------------------------------------------
------------------------------
Date: 6 Jul 1997 20:08:50 GMT
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: ANNOUNCE: Net::DNS 0.11
Message-Id: <5pou0i$la0$1@nadine.teleport.com>
Net::DNS is a module for making DNS queries from a Perl script. Here
are the significant new features in version 0.11:
* The ability to create an RR object from a string. Examples:
$a = new Net::DNS::RR("foo.bar.com. 86400 A 10.1.2.3");
$mx = new Net::DNS::RR("bar.com. 7200 MX 10 mailhost.bar.com.");
$cname = new Net::DNS::RR("www.bar.com 300 IN CNAME www1.bar.com");
$txt = new Net::DNS::RR("baz.bar.com 3600 HS TXT 'text record'");
* New functions to ease the creation of dynamic update packets:
$prereq_rr = nxrrset("foo.bar.com. A");
$update_rr = rr_add("foo.bar.com. 86400 A 192.168.1.2");
$prereq_rr = yxdomain("foo.bar.com");
$update_rr = rr_del("foo.bar.com");
See the Net::DNS and Net::DNS::Update manual pages for documentation
and examples.
Net::DNS 0.11 is making its way around CPAN; you can also get it from:
http://www.dimensional.com/~mfuhr/perldns/
Happy resolving!
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 4 Jul 1997 21:47:20 GMT
From: schilli@tep.e-technik.tu-muenchen.de. (Michael Schilli)
Subject: Re: Any Module for TAR archives available?
Message-Id: <5pjr18$dgr@sunsystem5.informatik.tu-muenchen.de>
> find2perl contains the basics, actually, to implement the -tar switch.
> tar has probably changed a little since then, though. Try `man 5 tar'.
What I'd like to see is a module that lets me create a tar archive
without actually using existing files. I'd like to send file data along
with path names to the archive, like this:
use Mytar;
$archive = Mytar->new();
$archive->add("file data ...", "path1/path2/filename");
$archive->writetarfile("mytarfile.tar");
I started with a cheap implementation, creating a temporary
directory and putting temporary files in there. But this screws up with
pathnames like "..", what I really want is a module that keeps the
data in memory and uses tar-format to create the final tarfile (unfortunately
you can't do that with the 'tar' command).
Anybody got anything like that?
--
Michael
------------------------------
Date: 3 Jul 1997 19:27:06 GMT
From: Zenin <zenin@best.com>
Subject: Re: Arrays of filehandles (Non-OOP)
Message-Id: <5pguea$9m7$1@nntp2.ba.best.com>
matthew.freake@smlawpub.co.uk wrote:
> I've consulted the Perl faq regarding creating an array of files handles
> and the suggested method is Object Oriented. Given that TMTOWTDI, is there
> any non Object Oriented means to achieve the same result.
> Failing that it looks like it might be time for me to finally learn OOP.
Reference a typeglob:
open SESAME, ">file" or die $!;
$MyArray[$i] = \*SESAME;
print {$MyArray[$i]} "Stuff\n";
mySub ($MyArray[$i]);
sub mySub {
my $FH = shift;
print $FH "Stuff\n";
}
--
-Zenin
zenin@best.com
------------------------------
Date: Fri, 04 Jul 1997 10:29:30 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Arrays of filehandles (Non-OOP)
Message-Id: <33c9cc0f.6476920@news.tornado.be>
matthew.freake@smlawpub.co.uk wrote:
>I've consulted the Perl faq regarding creating an array of files handles
>and the suggested method is Object Oriented. Given that TMTOWTDI, is there
>any non Object Oriented means to achieve the same result.
>Failing that it looks like it might be time for me to finally learn OOP.
Yes there is, although I'll probably get flamed for this.
You can use a string as a name for a filehandle, even one constructed
atrun time. For example, I have used this in a (possibly recursive) sub
to read multiple text files:
sub processFile {
my($file) = shift;
my($handle) = 'IN' . ++$count;
open($handle,$file);
....
close($handle);
$count--;
}
Bart.
------------------------------
Date: 7 Jul 1997 12:02:34 -0600
From: johnd@xor.com (John Donnelly)
Subject: Beginning Perl Programming Tutorial
Message-Id: <5pravq$9mh@xor.com>
**Upcoming Beginning Perl Programming Tutorial**
*****
Sessions are held at our training facility in Boulder, CO.
Contact me for further information, registration forms.
--John Donnelly, Training Coordinator
XOR Network Engineering, Inc.
http://www.xor.com/ johnd@xor.com 303-448-4816
*****
Beginning Perl Programming
(Three Day Hands-on Lecture/Lab)
Tom Christiansen, Consultant
Wednesday-Friday, July 30-August 1, 1997
*****
------------------------------
Date: Thu, 3 Jul 1997 23:30:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Benchmark Perl5 Processing 1 Gig
Message-Id: <ECrnyu.HI8@nonexistent.com>
Michael Heim (mike@mheim.com) wrote on 1401 September 1993 in
<URL: news:01bc8687$228c53a0$9b199bcf@pandora>:
++ Anyone used Perl5 on large amounts of data (about
++ a gigabyte)?
++
++ Any idea how long it might take with these specifics:
++
++ SUN Sparc 20
++ Solaris 2.6
++ Perl5
++ Parsing 1 gig of ASCII text
++ Putting the data into Oracle database
++ Using embedded SQL to read, insert, update, delete....
++
That depends what you want to do. "Parsing" is a vague term.
If it means "counting newlines", then it can be done fast.
If you have some highly inefficient regex, you can make coffee.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Mon, 07 Jul 1997 22:15:15 GMT
From: over@the.net (dave)
Subject: Best idiom for defaulting, getting & untainting an env variable.
Message-Id: <33c168fe.4150187@news.one.net>
Right now I'm doing:
$inval = "defaultval" unless $inval = $ENV{INVAL};
$inval = $1 if $inval =~ /^(expression)$/; # untaint
Since I assume this might be required a lot, I'm looking for simpler
alternatives.
Thanks,
Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________
------------------------------
Date: Mon, 7 Jul 1997 19:18:00 GMT
From: "robert c. combs" <xrcc0494@dcaca037.ca.boeing.com>
Subject: Re: C to Perl....
Message-Id: <33C140E8.7D2E@dcaca037.ca.boeing.com>
What the...???
Maybe you should post this in comp.lang.perl.developer.sucker
-bob
Michael Lauzon wrote:
>
> I am wondering, if anyone can change thise C program into Perl...I am
> posting the program here; and hopefully one of you has the knowledge of C
> and Perl to do so. So here is the program, please...email it to me; when
> you have changed it from a C program into a Perl program. The email
> address where it should be sent is:
>
> tal@sdf.lonestar.org
>
> And, now...here is the program:
>
> #include <stdio.h>
> #include <sys/param.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <netdb.h>
> #include <stdarg.h>
>
> void smtp_connect(char *server);
>
> int thesock; /* the socket */
>
> void smtp_connect(char *server)
> {
> struct sockaddr_in sin;
> struct hostent *hp;
>
> hp = gethostbyname(server);
> if (hp==NULL) {
> printf("Unknown host: %s\n",server);
> exit(0);
> }
> bzero((char*) &sin, sizeof(sin));
> bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);
> sin.sin_family = hp->h_addrtype;
> sin.sin_port = htons(25);
> thesock = socket(AF_INET, SOCK_STREAM, 0);
> connect(thesock,(struct sockaddr *) &sin, sizeof(sin));
> }
>
> void main(int argc, char **argv)
> {
> char buf[1024];
>
> if (argc != 4) {
> printf("usage: mflash smtp_server from to\n");
> exit(0);
>
> }
> printf("Connecting to SMTP Server %s\n",argv[1]);
> smtp_connect(argv[1]);
> printf("Sending Mail Flash To %s\n",argv[3]);
> sprintf(buf, "helo a\nmail from: %s\nrcpt to: %s\ndata\nSUBJECT: \033c\033(0\
> 033#8\033[1;3r\033[J\033[5m\033[?5h\n.\nquit\n",argv[2],argv[3]);
> send(thesock, buf, strlen(buf), 0);
> /* I am not sure how to check when this buffer is done being sent.
> If you are having any problems increase the sleep time below! */
> printf("Sleeping To Make Sure Data Is Sent ...\n");
> sleep(3);
> printf("Done!\n");
> }
> --
> Michael
> Free email address: http://www.hotmail.com/
>
> 'Eat, drink, and be merry, for tomorrow you may work.'
------------------------------
Date: Mon, 7 Jul 1997 06:25:29 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can an array have two subscripts (i.e., @array (i,j))?
Message-Id: <9njqp5.ql.ln@localhost>
Iap SinGuan (iap@iis.sinica.edu.tw) wrote:
: In article <33C05907.9D8D343@cc.memphis.edu>, fdeng@cc.memphis.edu says...
: >
: >Sorry for asking a question that may be too elementary. Can an array
^^^^^^^^^^^^^^
This should have been a clue to you that this could very likely be
covered in the copious free documentation that is included in the
perl distribution...
: >have two subscripts, such as @array(i,j)? I have looked my Teach
: >Yourself Perl 5 in 21 days and found no answer.
: >
: >Thanks for helping.
: >
: >Johnny
: Try:
: @array=([0,1],[a,b]);
: print $array[1][0];
: it will print 'a' for you.
: I am sure that "Teach Yourself Perl 5 in 21 days" has materials about this.
: But I don't know in which pages, because I don't have it in hand.
The 'perllol' man page is titled "Manipulating Lists of Lists in Perl".
The docs included with perl are often more accurate than books are too...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
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 699
*************************************