[6487] in Perl-Users-Digest
Perl-Users Digest, Issue: 112 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 13 18:08:57 1997
Date: Thu, 13 Mar 97 15:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 13 Mar 1997 Volume: 8 Number: 112
Today's topics:
a CGI.pm question... (Lindsay Feuling)
Announce : SWIG 1.1b5 (David Beazley)
Re: Awk is better than Perl? <tchrist@mox.perl.com>
db_file/irix6.2/perl5 (Jon Drukman)
Re: db_file/irix6.2/perl5 <scotth@sgi.com>
Re: Efficient multiple regexp searching (Tad McClellan)
Re: Elegant way to strip spaces off the ^ and $ of a va <merlyn@stonehenge.com>
Executing a PERL program by dropping a file in a direct <mstearns@darkwing.uoregon.edu>
Re: Executing a PERL program by dropping a file in a di <anirvan@crl.com>
Re: Form to File .cgi <lweston@aw.sgi.com>
Re: how do i read "man page" of a module on a PC? (Mik Firestone)
Re: I'm scared and don't know what to do. Do you know?? <Tom@intermart.co.uk>
Re: I'm scared and don't know what to do. Do you know?? (Kent Perrier)
Re: Is possible in perl run a string like a piece of pr (I R A Aggie)
multi column format <brandon@physics.utexas.edu>
Re: NT 4.0 Perl 5 (A. Deckers)
Re: Numeric function <tchrist@mox.perl.com>
PERL on a local PC <acooper@edelman.com>
Perl that FTP's a file? carlson@smart.net
Please Help Me! -- Unsigned Integers <emosterd@sundance.usd.edu>
Redirection doesn't work through telnet? <michaeli@dra.com>
Re: Sort question <tchrist@mox.perl.com>
Re: We've baffled tech support, now on to Usenet... (I R A Aggie)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Mar 1997 14:53:53 -0600
From: feuling@bangs.gcg.com (Lindsay Feuling)
Subject: a CGI.pm question...
Message-Id: <rn67yvpl7h.fsf@bangs.gcg.com>
Hi.
I'm using the CGI::Push method, right now figuring out how to make it
work. With the example, I have:
use CGI::Push qw(:standard);
do_push(-next_page=>\&next_page,
-last_page=>\&last_page,
-delay=>0.5);
sub next_page {
my($q,$counter) = @_;
return undef if $counter >= 10;
return start_html('Test'),
h1('Visible'),"\n",
"This page has been called ", strong($counter)," times",
end_html();
}
sub last_page {
my($q,$counter) = @_;
return start_html('Done'),
h1('Finished'),
strong($counter),' iterations.',
end_html;
}
And that is all very well and good, but what I want to do is have the
last_page subroutine load a new URL, say like calling redirect(). But
that doesn't work for me.
I could print some HTML like:
<HEAD>
<META HTTP-EQUIV=Refresh CONTENT=1; URL=http://xxx.yyy.zzz/>
</HEAD>
But I'm not entirely satisfied with that solution.
Thanks
feuling@earthling.net
------------------------------
Date: 13 Mar 1997 21:25:45 GMT
From: beazley@sol.cs.utah.edu (David Beazley)
Subject: Announce : SWIG 1.1b5
Message-Id: <5g9rcp$90i$1@nadine.teleport.com>
March 13, 1997
I'm pleased to announce the availability of SWIG 1.1b5 which can
be obtained via anonymous FTP at :
ftp://ftp.cs.utah.edu/pub/beazley/SWIG/swig1.1b5.tar.gz
What is SWIG? (The 30 second overview)
--------------------------------------
SWIG is a compiler that takes ANSI C/C++ declarations and builds
a scripting language interface to a number of different scripting
languages including Perl, Python, Tcl, and Guile. It supports most
kinds of constructs that would appear in a typical ANSI C program,
and a subset of C++. The general idea behind SWIG is relatively
simple--you specify an interface that might look something like this:
// File : example.i
%module example
extern int fact(int n);
class List {
public:
List();
~List();
void insert(char *);
int lookup(char *);
void remove(char *);
void output();
... etc ...
};
This file is then parsed by SWIG into an extension module as follows :
% swig -tcl example.i # Build a Tcl module
% swig -perl5 example.i # Build a Perl5 module
% swig -python example.i # Build a Python module
Well, you get the general idea. At this point, you can start
accessing your C functions and classes from a scripting
language interface.
What's new in this release?
---------------------------
The SWIG 1.1b5 release features a substantial number of improvements
over the previous 1.0 release. Some of these features include :
- Better support for C++. This includes, multiple inheritance,
default arguments, performance improvements, better
code generation.
- Support for typemaps. Typemaps allow SWIG's treatment of
any datatype to be user-definable. With a little work it
is possible to change the default behavior and pass lists,
arrays, tuples, and other kinds of scripting language
constructs into a C extension.
- A completely revised automatic documentation system.
- A user-definable exception handling mechanism. With this,
you can turn C-level exceptions into scripting language
exceptions. It also works with C++ exceptions.
- A large number of bug fixes and enhancements throughout
the system and for all language modules.
- Revised and reorganized documentation (but still a work
in progress).
What's new for Perl?
--------------------
- SWIG can now integrate C++ classes and C structures with
object oriented features of Perl5. In other words, a C++
class gets wrapped into an equivalent Perl5 class. You
can even inherit from these classes. Of course, the
details of how this works are too hideous to describe
here (besides, you really don't want to know)
- Support for the ActiveWare Perl for Win32 port. Code
generated by SWIG will compile under both Unix and Win32
versions of Perl without modification.
What's new for Tcl?
-------------------
- A new object-oriented interface that allows C++ objects and
C structures to behave alot like widgets when used in Tcl.
- Support for Tcl 8.0a2. SWIG can generate C extensions that
use Tcl_Objects instead of strings for a big performance
improvement. (note : this does not work with Tcl 8.0a1
so you should upgrade).
What's new for Python?
----------------------
- Many code generation improvements--particularly to C/C++
handling and shadow classes.
- Somewhat better support for working with multiple files
and modules.
System requirements
-------------------
In order to compile and install SWIG, you will need a working
C++ compiler such as g++ and at least one of the following scripting
languages
- Tcl 7.3/Tk 3.6 or any newer version (including Tcl 8).
- Perl4 (Unix only)
- Perl5.002 or later.
- Python 1.3 or later.
- FSF Guile 1.0. (Unix only)
Earlier versions of these packages may still work, but this is
not guaranteed.
Supported Platforms
-------------------
SWIG should compile cleanly on most Unix platforms and uses a
GNU autoconf script for configuration.
Makefiles are also included for compiling SWIG under Windows 95 and NT
using MSVC++ 4.0. SWIG can currently build extensions to Windows
versions of Perl, Python, and Tcl.
A highly experimental and largely untested Macintosh port of SWIG is
also included in this release.
Standard Disclaimers
--------------------
This is beta release software. While it has been thoroughly tested,
there may be unforeseen problems--especially on Non-Unix platforms.
Additional Information
----------------------
Additional SWIG information can be found at
http://www.cs.utah.edu/~beazley/SWIG
Discussion of SWIG related issues can also be found on the SWIG
mailing list at swig@cs.utah.edu. To subscribe, send a message
'subscribe swig' to 'majordomo@cs.utah.edu'.
Cheers,
Dave
----------------------------------------------------------------
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: 13 Mar 1997 22:28:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Awk is better than Perl?
Message-Id: <5g9v23$37n$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Randall W. Hron" <randall.hron@paranet.com> writes:
:The new Perl FAQ is great,
Thank you.
:but it gives an answer I don't want.
:Here's the FAQ question and answer:
:
:I put a pattern into $/ but it didn't work. What's wrong?
:
:$/ must be a string, not a pattern. Awk has to be better for something.
::-)
:I want to break the text into paragraphs. I wanted to
:use a line beginning with a number as the paragraph delimeter,
:but the FAQ says $/ must be a string. Anyone know a clever way
:to split multi-line text so the input above would be three lines
:and beginning with the whatever comes after the number in the
:first column?
undef $/;
@records = split /^\d+/, <FH>;
Hm... I wonder whether we don't need a FileHandle->slurp()
method? :-)/2
@records = split /^\d+/, FH->slurp();
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"A ship then new they built for him/of mithril and of elven glass"
--Larry Wall in perl.c from the v5.0 perl distribution,
citing Bilbo from Tolkien's LOTR
------------------------------
Date: 11 Mar 1997 20:50:10 GMT
From: jsd@cyborganic.com (Jon Drukman)
Subject: db_file/irix6.2/perl5
Message-Id: <5g4gi2$2o7$1@its.hooked.net>
please help me build perl5 with DB_File on IRIX 6.2.
i managed to build and install the db library successfully.
however, when i go to build perl, here's what happens:
it identifies that DB is available and puts it in the appropriate
extension lists in config.sh. good.
when it gets to compile the DB_File package, it gives a billion
errors about conflicting types. so i switched to gcc, which gave only
one error (pgno_t). i commented out the definition of pgno_t in db.h
and it compiled fine. it doesn't pass the tests however. it hangs
forever on lib/db-btree.
has anyone managed to successfully do this?
---jsd
------------------------------
Date: 13 Mar 1997 14:12:12 -0800
From: Scott Henry <scotth@sgi.com>
Subject: Re: db_file/irix6.2/perl5
Message-Id: <yd8u3mfh26b.fsf@hoshi.corp.sgi.com>
>>>>> "J" == Jon Drukman <jsd@cyborganic.com> writes:
J> please help me build perl5 with DB_File on IRIX 6.2.
J> i managed to build and install the db library successfully.
A minor patch to db.h is needed to make things work.
J> it identifies that DB is available and puts it in the appropriate
J> extension lists in config.sh. good.
J> when it gets to compile the DB_File package, it gives a billion
J> errors about conflicting types. so i switched to gcc, which gave only
J> one error (pgno_t). i commented out the definition of pgno_t in db.h
J> and it compiled fine. it doesn't pass the tests however. it hangs
J> forever on lib/db-btree.
Here's a patch from the default db.h to one compilable on IRIX:
*** ../../../include/db.h Fri Mar 15 14:26:52 1996
--- db.h Wed Mar 27 17:34:04 1996
***************
*** 49,54 ****
--- 49,61 ----
#define RET_SUCCESS 0
#define RET_SPECIAL 1
+ #if (defined(__sgi) || defined(sgi))
+ /* sys/types.h->sgidefs.h already defines these */
+ # ifndef __BIT_TYPES_DEFINED__
+ # define __BIT_TYPES_DEFINED__
+ # endif
+ #endif
+
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef __signed char int8_t;
***************
*** 62,67 ****
--- 69,81 ----
typedef unsigned long long u_int64_t;
#endif
#endif
+
+ /*
+ * XXX
+ * Important: Don't use the IRIX pgno_t typedef.
+ * It causes an endless loop in btree
+ */
+ #define pgno_t db_pgno_t
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
typedef u_int32_t pgno_t;
J> has anyone managed to successfully do this?
Yes. See the SGI Freeware CDs. See:
https://www.sgi.com/TasteOfDT/public/freeware.html
For perl5.003 with DB_File 1.85, see:
http://reality.sgi.com/scotth/info/perl5.html
--
Scott Henry <scotth@sgi.com> / Help! My disclaimer is missing!
Networking Services, / GIGO *really* means: Garbage in, Gospel Out
Silicon Graphics, Inc / http://reality.sgi.com/scotth/
------------------------------
Date: Thu, 13 Mar 1997 07:34:01 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Efficient multiple regexp searching
Message-Id: <9ov8g5.ro.ln@localhost>
Tom Christiansen (tchrist@mox.perl.com) wrote:
: You may be able to use an approach related to this one:
: =head2 How do I efficiently match many regular expressions at once?
: The following is super-inefficient:
: while (<FH>) {
: foreach $pat (@patterns) {
: if ( /$pat/ ) {
: # do something
: }
: }
: }
: Instead, you either need to use one of the experimental Regexp extension
Which, by the way, is from the new perl FAQ (part 6).
Get the new FAQs at a newsgroup near you!
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 13 Mar 1997 14:19:09 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: abigail@ny.fnx.com
Subject: Re: Elegant way to strip spaces off the ^ and $ of a variable containing a sentence.
Message-Id: <8c3etzxzg2.fsf@gadget.cscaper.com>
>>>>> "Abigail" == Abigail <abigail@ny.fnx.com> writes:
Abigail> Elegant you said... Here's a way without using ()'s in the
Abigail> regex, or having to type the variable twice. And it's easy to
Abigail> add more variables.
Abigail> map {s/^\s+//; s/\s+$//;} $variable;
No, abigail! Void use of map invalidates your Perl wizard's license!
for ($variable,$v2,$v3,$v4) { s/^\s+//; s/\s+$//; }
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 536 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 13 Mar 1997 14:50:26 -0800
From: Michael Stearns <mstearns@darkwing.uoregon.edu>
Subject: Executing a PERL program by dropping a file in a directory?
Message-Id: <332884B2.DC126F2@darkwing.uoregon.edu>
Is it possible to execute a Perl program that processes a file just by
putting (ftpping) the file in a specific directory?
So basically I'd like the script to be smart, or alert, enough to look
for files coming into the directory.
Thanks,
Michael Stearns
University of Oregon
------------------------------
Date: 13 Mar 1997 22:27:49 GMT
From: Anirvan Chatterjee <anirvan@crl.com>
Subject: Re: Executing a PERL program by dropping a file in a directory?
Message-Id: <5g9v15$3rh@nexp.crl.com>
-----BEGIN PGP SIGNED MESSAGE-----
Michael Stearns <mstearns@darkwing.uoregon.edu> wrote:
: Is it possible to execute a Perl program that processes a file just by
: putting (ftpping) the file in a specific directory?
Offhand, I'd guess that the two ways to do this would be to either [1]
have the relevant perl processing script be called regularly by cron
(say every minute or so), or [2] by turning the perl program into a
daemon process that lingers in the background, checking the directory
at some set small interval and processing files as they come in.
_______________________________________________________________
Anirvan Chatterjee . anirvan@crl.com . <URL:http://www.mx.org/>
PGP 0x93C5C165 . finger for PGP/geek . encrypted mail preferred
http://www.mx.org/bookfinder/ : online book comparison shopping
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBMyh/X2TQ0LuTxcFlAQE2xQQApv0D1Ymbky6y3FDj6dTpLDqlqi8STY9K
MRNltVGPA+rKCDTCEeYr7/yqgOk7TdpO4uXNHA3dHxxZeZWh+7sDN6wYhbBs00Yr
DkaOmg8u9RYoTS89UcxBnKAtJtLFV2DFzVqyIxbN4RpNa4qGJekpfgFrh7fPTha6
gkdMSrm7GuU=
=PVTa
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 13 Mar 1997 16:43:44 +0000
From: Lee Weston <lweston@aw.sgi.com>
To: dvess@grafxfactory.com
Subject: Re: Form to File .cgi
Message-Id: <33282EB2.2923@aw.sgi.com>
>Subject: Form to File .cgi
>Date: Mon, 10 Mar 1997 21:33:12 -0600
>From:dvess@grafxfactory.com
>Organization:the Grafx Factory
>Newsgroups: comp.lang.perl.misc
>
>
>I have been searching the net for a perl script that will
>take data from an html form and add it to a .data file that
>can be accessed via server side includes. More specifically,
>the data contained in the .data file would require a configuration
>file that would allow control of how the data would be displayed
>in the html document. I know this sounds confusing, but a file
>called form-file.cgi is available at Concentric.net, but they
>will not allow anyone to use the .cgi program.
>It would also be necessary to be able to select only the LAST
>set of data elements in the .data file or the ability to
>clear the data before appending the NEW data that is entered
>in the form. Any help or suggestions would be greatly appreciated.
Here are the two subroutines I use to do this.
If you can write Perl this may help.
Note:
1) I reads the new form data into FORM, so I read/write the file data
into something else. Otherwise if you use more than 1 form you would
lose the values from the other forms.
2) Remember that the new file is created by the httpd deamond (not
you!), so the target directory's permissions will need to allow httpd to
create a file (httpd usually runs as nobody).
Use:
$path = '/xxx/xxx/xxx/'; #remeber the permissions (see note #2)
# Read the form data into FORM (or whatever)
$ID = &readVars($ID);
# Move FORM to vars (see note #1)
$ID = &writeVars($ID);
sub readVars
{
#print "Content-type: text/plain\n\n";
local ($theID) = @_;
local ($filename);
return time if($theID < 1); #it's new - assign ID and return
$filename = '<' . $path . $theID . '.data';
if (open(VARS, $filename)) {
while (<VARS>) {
($a, $b) = split(/\t/,$_);
chop($b);
$b =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; #de hex the
nasties
$vars{$a} = $b;
}
close (VARS);
}
# %vars is passed globally
$theID;
}
#----------------
sub writeVars
{
#print "Content-type: text/plain\n\n";
local ($theID) = @_;
local ($filename);
$theID = time if($theID < 1); #it's new - assign ID before writing
$filename = '>' . $path . $theID . '.data';
open(VARS, $filename) || die;
while (($key,$value) = each %vars) {
# trouble if write a \n or \t so HEX it (and others)
$value =~
s/([\000-\037%&+<>?\177-\377])/sprintf('%%%02x',ord($1))/eg;
print VARS "$key\t$value\n";
}
close (VARS);
# %vars is passed globally
$theID;
}
------------------------------
Date: 13 Mar 1997 17:13:29 GMT
From: mfiresto@vnet.ibm.com (Mik Firestone)
Subject: Re: how do i read "man page" of a module on a PC?
Message-Id: <5g9cjp$o9e$1@mail.lexington.ibm.com>
In article <b.wilkinson-1303971506060001@ip57-york.pindar.co.uk>,
Bob Wilkinson <b.wilkinson@NOSPAM.pindar.co.uk> wrote:
>In article <5g8kks$csp@srv13s4.cas.org>, lvirden@cas.org wrote:
>
>Failing that (I presume you'd like to read this info. soon), take a text
>editor to the module.pm file, since the documentation is generally stored
>with the source code. Search for a line starting with "=pod" - the
>documentation should start there.
>
AHHH! A text editor? Good god man, at least use Perl to do this. A text
editor? Geez, my eye doctor would just love you as a patient. If you are
going to go to all this trouble, read the bloody docs on Pod::Text, which
is included in the standard ( including DOS ) distribution. Saves a lot
of eyestrain.
>Note that this is a pragmatic, rather than elegant, solution.
>
But why not go for the elegance? Find yourself a copy of pod2html, a rather
standard script released with the Unix versions. You can do this by either
finding a friend who has Perl installed on Unix, or downloading the Unix
distribution and extracting that one file.
Run pod2html whenever you download a new module. This will extract the pod
into an html doc, which you can then add to main index.html.
I have used this script right after ftp'ing it from one of my Unix boxes to
my DOS box. It worked fine, with no modifications and no apparent errors.
I will admit the module I tried it on did not produce huge amounts of
output, so I cannot claim to have severely stress tested it.
I have sent some email ( note - that was not "an email". "An email" hits
my ears like fingernails on a chalkboard ) to the webpage manager for
ActiveWare, aka Hip, asking him to include this very useful piece of perl
code on the webpage for those of us who must Perl in DOS.
A text editor? AHHHHHHH!
-----
Mik Firestone mfiresto@mindspring.com
Evil Overlord Rule #16: One of my advisors will be an average
five-year-old child. Any flaws in my plan that he is able to spot will
be corrected before implementation.
------------------------------
Date: Thu, 13 Mar 1997 21:11:55 +0000
From: Tom Holder <Tom@intermart.co.uk>
Subject: Re: I'm scared and don't know what to do. Do you know??
Message-Id: <pCGqxEAb2GKzEwB7@resmon.demon.co.uk>
In article <crusso-1303970756230001@buzz.alink.net>, Chris Russo
<crusso@alink.net> writes
>Save yourself a lot of anguish by hiring someone to do the project for
>you. In such a short time-frame, you're not going to learn all you need
>in order to do a good job on the project. Be prepared to spend a bit o'
>money.
>
>Regards,
>
>Chris Russo
You obviously didn't read my original post carefully enough. I mentioned
the word student, this means I am very skint. I can't afford a bus
ticket let alone a CGI programmer. Thanks for your help anyway.
--
Tom,
Tom@ednet.co.uk
Tom@intermart.co.uk
------------------------------
Date: 13 Mar 1997 09:01:58 -0600
From: kperrier@Starbase.NeoSoft.COM (Kent Perrier)
Subject: Re: I'm scared and don't know what to do. Do you know??
Message-Id: <csu3mfq1i1.fsf@Starbase.NeoSoft.COM>
In article <RFBUAFAIOxJzEwu1@resmon.demon.co.uk> Tom Holder
<Tom@intermart.co.uk> writes:
>
>Hi, like the title says, I am very scared and lost.
>
>I have a web development project for the next 8 weeks and require the
>use of CGI. Firstly I know nothing about CGI but as this is a perl group
>I will not offend you by posting CGI queries.
>
>The problem is, I have to do some pretty heavy programs (Chat, Message
>board etc.) and I know NOTHING about perl.The only thing I do know is
>that it is an interpreted language and to be honest this scares me even
>more. The next big worry is that I am using win95 but the servers must
>have perl scripts. What do I do? Isn't it just UNIX? I'm not prepared to
>use Linux either because my knowledge of UNIX is very thin to say the
>least and with only 8 weeks I don't want to learn a totally new O/S.
>
Hum, it sounds like the keyword to learn here so that this will be a
successful project is SUBCONTRACT. You hire someone else to do a lot
of it for you and you do a little bit, asking him for help as you need
it. BTW, if the target environemnt is unix you will be a lot better
off developing on Linux or *BSD than under Windows (IMHO).
Or you could just quit.
Kent
--
Kent Perrier If Bill Clinton is the answer, then it must
kperrier@neosoft.com have been a really stupid question.
Corporations don't have opinions, people do. These are mine.
PGP 2.6 Public Key available by request and on key servers
PGP encrypted mail preferred!
------------------------------
Date: Thu, 13 Mar 1997 11:14:17 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Is possible in perl run a string like a piece of program?
Message-Id: <fl_aggie-ya02408000R1303971114170001@news.fsu.edu>
In article <5g5v72$r5n@server-b.cs.interbusiness.it>, Maurizio Belluati
<Maurizio.Belluati@cselt.stet.it> wrote:
[posted && cc'd]
+ Does perl have it?
Do a 'man perlfunc', and look for "eval".
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Thu, 13 Mar 1997 14:40:25 -0600
From: "Brandon W. Metcalf" <brandon@physics.utexas.edu>
Subject: multi column format
Message-Id: <33286639.41C6@physics.utexas.edu>
Does anyone know how to create an output format that will start a new
column on the same page when $= is reached or is it even possible?
Thanks.
--
Brandon Metcalf
UNIX Systems Administrator
Department of Physics - UT Austin
brandon@physics.utexas.edu
------------------------------
Date: 13 Mar 1997 21:30:43 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: NT 4.0 Perl 5
Message-Id: <slrn5igsg4.ffu.Alain.Deckers@nessie.mcc.ac.uk>
In <331dfef1.1379944@news.eclipse.net>,
Lon Hosford <lon@hosfordusa.com> wrote:
>Is it possible to run and learn Perl 5 if you have a NT 4.0
>Workstation?
>And if so where do you obtain a copy and installation info?
>
>Lon Hosford
>May many happy bits flow your way!
See URLs below.
--
Alain.Deckers@man.ac.uk <URL:http://www.man.ac.uk/%7Embzalgd/>
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl software: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: 13 Mar 1997 22:17:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Numeric function
Message-Id: <5g9uef$2db$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
somsky@dirac.phys.washington.edu (William R. Somsky) writes:
:Yep. The simple \d+ -> \d* transformation won't do what you want.
:If you want .2 to be acceptable, then what you'll want is something like:
:
: warn "not a decimal number" unless /^[+-]?(\d+\.?\d*|\.\d+)$/
Based on Jeffrey's suggestions, how about this:
/^-?(?:\d+(?:\.\d*)?|\.\d+)$/
I don't count a leading + as part of a valid number, intentionally.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
It is Unix. It is possible to overcome any number of these bogus features. --pjw
------------------------------
Date: Thu, 13 Mar 1997 15:56:35 -0500
From: Adam Cooper <acooper@edelman.com>
Subject: PERL on a local PC
Message-Id: <33286A03.4FD5@edelman.com>
Is anyone aware of a way to run a Web site with PERL scripts locally on
a PC? I need to demo a site that is 70% cgi-scripted and really don't
want to have to devise HTML pathways to compensate.
Any help would be greatly appreciated.
-AC
acooper@edelman.com
------------------------------
Date: Thu, 13 Mar 1997 22:11:00 GMT
From: carlson@smart.net
Subject: Perl that FTP's a file?
Message-Id: <5g9u07$c2o$1@news.smart.net>
Does anyone know of a Perl script that will do the following:
From an html page a perl script is executed to
FTP a file to REMOTE_HOST ?
This would not be from an anonymous ftp directory.
Example: Someone purchases software over the web...they pay w/credit
card , then download from a directory that is not anonymous.
Any help would be appreciated....thank you.
Chris Carlson , carlson@smart.net
----------------------------------------------------------------
------------------------------
Date: Thu, 13 Mar 1997 15:00:20 -0600
From: Eric Mosterd <emosterd@sundance.usd.edu>
Subject: Please Help Me! -- Unsigned Integers
Message-Id: <33286AE4.531E@sundance.usd.edu>
I am writing a program to convert ASCII to the IBM Mainframe EBCDIC
character set for my Data Communications class. What I need to know is
if there is a way to read/write unsigned integers to a file?
Thanks in advance for your help.
Eric Mosterd
emosterd@sundance.usd.edu
http://www.usd.edu/~emosterd
------------------------------
Date: Thu, 13 Mar 1997 17:07:50 -0500
From: Michael Iles <michaeli@dra.com>
Subject: Redirection doesn't work through telnet?
Message-Id: <33287AB6.16EF@dra.com>
I've written a bunch of Perl scripts that we've been using happily for a
while, but the other day someone tried to run them through a telnet
session and they bombed. We're using NT 4.0 and an OpenNT telnet daemon.
I traced the problem to using 2>&1 with backticks. (This redirects
STDERR to STDOUT so the backticks return all the output from the
command.)
Using 2>&1 has worked fine for me up until now, but when used through an
OpenNT telnet session, it simply returns _nothing_ (not even normal
STDOUT output).
I've since found that if I add the (seemingly useless) line,
open( STDERR, ">&2" );
before I use 2>&1 with the backticks, then everything functions
normally.
For example,
print `dir 2>&1`;
doesn't work through a telnet session (it returns nothing), but
open( STDERR, ">&2" );
print `dir 2>&1`;
_does_ work. (These both work fine in normal, non-OpenNT-telnet use.)
Can anyone suggest a reason for this? I'm stumped.
Mike.
------------------------------
Date: 13 Mar 1997 21:25:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Sort question
Message-Id: <5g9rcs$sca$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bet@nospam.interactive.net (Bennett Todd) writes:
:my(%Mon) = ( Jan => 0, Feb => 1, Mar => 2, Apr => 3, May => 4, Jun => 5,
: Jul => 6, Aug => 7, Sep => 8, Oct => 9, Nov => 10, Dec => 11 );
:print map { $_->[0] }
: sort { $b->[2] <=> $a->[2] or $b->[1] <=> $a->[1] }
: map { /(...)(..)/; [ $_, $Mon{$1}, $2 ] } <>;
Why stop there? :-)
print map { $_->[0] }
sort { $b->[2] <=> $a->[2] or $b->[1] <=> $a->[1] }
map { /(...)(..)/; [ $_, { Jan=>0,Feb=>1,Mar=>2,Apr=>3,
May=>4,Jun=>5,Jul=>6,Aug=>7,
Sep=>8,Oct=>9,Nov=>10,Dec=>11
}->{$1}, $2 ] } <>;
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Don't wear rollerskates to a tug-of-war." --Larry Wall
------------------------------
Date: Thu, 13 Mar 1997 11:07:05 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: We've baffled tech support, now on to Usenet...
Message-Id: <fl_aggie-ya02408000R1303971107050001@news.fsu.edu>
In article <ebohlmanE6yqCq.7v8@netcom.com>, ebohlman@netcom.com (Eric
Bohlman) wrote:
+ Now if you were using cgi.pm, you'd have been able to test this from the
+ command line, using the -w switch, and you'd have gotten a complaint
+ about the mismatched quotes.
Or if he had just run it against 'perl -c source_code'...
James
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
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 112
*************************************