[7206] in Perl-Users-Digest
Perl-Users Digest, Issue: 831 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 8 17:08:01 1997
Date: Fri, 8 Aug 97 14:00:38 -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 Fri, 8 Aug 1997 Volume: 8 Number: 831
Today's topics:
Re: $$a implemented in 4.036? (Dominic Dunlop)
Re: $$a implemented in 4.036? (Mike Stok)
? on Server Redirection with Perl <johnpb@ix.netcom.com>
Re: [Q] Sorting an array containing hashes (Mike Stok)
Re: Automat FTP (Matthew Cravit)
Blanket textual changes <sc7b+@andrew.cmu.edu>
Re: Case Statement.. <petri.backstrom@icl.fi>
changing perl to gibberish <vmagdic@talas.com>
Re: comparing for a range of number - easiest way to do <rootbeer@teleport.com>
compiled MajorDomo? <Bob@XC.Org>
Confused by Perl's select() (James Weisberg)
Re: Confused by Perl's select() <rootbeer@teleport.com>
Currency format <mike@hq.npc.co.th>
Re: Currency format <rootbeer@teleport.com>
DB_File Perl 5.004 compilation problem under BSDI <gregg@wwti.com>
DBM Equivalent for NT (COWBYS)
END and DESTROY calling order <adu@lmt.lv>
Re: how do I entries in a text file in PERL? (Bob Wilkinson)
if $FORM{r2} = problem <eric@hilding.com>
Re: Is there a perl IDE? ("John Dallman")
Re: Is there a perl IDE? <seay@absyss.fr>
NT with Enterprise Serv. 3.0 Perl Problems rhaman@reveregroup.com
Re: Pack / Unpack of IEEE floating point? What about XD <rootbeer@teleport.com>
Re: Passing Parameter in Perl <burleigh@hackberry.chem.niu.edu>
Re: Passing Parameter in Perl (Ronald L. Parker)
Perl and Windows NT <bandre@xs4all.nl>
Research <gbarr@ti.com>
Re: select() Gives Syntax Error <rootbeer@teleport.com>
Re: Sorting this file is killing me (Andrew M. Langmead)
SQL error message handling with sybPerl? <qdthupa@aom.ericsson.se>
Re: Subroutines in an eval'ed user-script <rootbeer@teleport.com>
textarea in CGI.pm <Vera.Sobrinho@ssd.alcatel.pt>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 8 Aug 1997 17:44:43 +0200
From: domo@tcp.ip.lu (Dominic Dunlop)
Subject: Re: $$a implemented in 4.036?
Message-Id: <199708081744435385729@dialup20.ip.lu>
Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu> wrote:
> I develop on 5.003, but need to have backwards compatibility to 4.036...
> Is $$a implemented on 4.036, particularly on Unix variants?
>
> e.g.,
>
> $a = "b";
> $b = "hello";
> print $$a;
Something like
eval 'print $' . $a;
instead of the last line will work in both perl4 and perl5. But it's
inefficient, the quoting can quickly become unreadable, you probably
need to check $@ to see if what you evaled was legal Perl, and you need
to verify correct operation in both environments -- you're messing
around near syntax which is legal in both perl4 and perl5, but which
means different things to each (see the perltrap documentation). Take
Randall Schwartz' advice: upgrade that old system that's holding you
back.
--
Dominic Dunlop
------------------------------
Date: 8 Aug 1997 20:45:06 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: $$a implemented in 4.036?
Message-Id: <5sg0gi$sre@news-central.tiac.net>
In article <870664067.6439@dejanews.com>,
Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu> wrote:
>I develop on 5.003, but need to have backwards compatibility to 4.036...
>Is $$a implemented on 4.036, particularly on Unix variants?
>$a = "b";
>$b = "hello";
>print $$a;
>
>=> hello
You can use type globs in perl4.036 if you want to do this kind of thing,
usually I localise them so that you end up with code like
$a = "b";
$b = "hello";
{
local (*GLOB) = $a;
print $GLOB;
}
but in the debugger for amusement:
bash$ perl4.036 -de 1
Loading DB routines from $RCSfile: perldb.pl,v $$Revision: 4.0.1.3 $$Date: 92/06/08 13:43:57 $
Emacs support available.
Enter h for help.
main'(/tmp/perl-ea00957:1): 1
DB<1> $b = 'hello'
DB<2> *a = 'b'
DB<3> print $a
hello
but some time in the next 20 or 30 years we should let perl 4.xxx go the
way of other "dead" languages like Fortran and Cobol ;-)
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 05 Aug 1997 22:01:36 -0700
From: John Barnett <johnpb@ix.netcom.com>
Subject: ? on Server Redirection with Perl
Message-Id: <33E80530.1F822976@ix.netcom.com>
I have a question I hope some could answer. I would like to know if it
is possible to redirect some to a WWW server based on IP or DNS name. I
have two Web servers one on the East coast and the other on the West.
Each coast is using a different IP subnet.
This is how I see it working. Everyone hits the East server for the
Home page, then any link they pick would take them to the server that's
on the same coast they are one.
Example:
West IP's 123.120.*.*
East IP's 123.121.*.*
Someone with a West Ip hits the home page and clicks on a link, they are
redirected to the west coast server. Then someone with a East coast IP
clicks on the same link they are taken to the page on the East coast
server (the same server as the home page).
The reason for this a network traffic issue.
My Co. dose in hose support and we keep Web server on the Customers
Intranet for our people and we do not what to tie up their pipe between
coast with our traffic (they are over loaded now!) and we want to keep
it simple for our people. We also would like to solve this problem with
out asking them to make changes to their DNS servers.
I'm not looking for a how to, just can to be done with Perl? or is
there a better way with out modifying DNS servers tables?
Thanks
John
------------------------------
Date: 8 Aug 1997 20:03:34 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: [Q] Sorting an array containing hashes
Message-Id: <5sfu2m$ped@news-central.tiac.net>
In article <33EACF33.116A@knoll.hibu.no>,
Vegard Bakke <vba@knoll.hibu.no> wrote:
>%Hash1 = ( 'id' => '9707', 'name' => 'Vegard' );
>%Hash2 = ( 'id' => '9710', 'name' => 'Fjeksulr' );
>@Arr = ( \%Hash1, \%Hash2 );
>
>How do I sort @Arr in the order of the value of the 'name' key?
>
>So that @Arr will contain:
>( {'id' => '9710', 'name' => 'Fjeksulr'},
> {'id' => '9707', 'name' => 'Vegard' }
>)
@Arr = sort {$a->{name} cmp $b->{name} || $a->{id} <=> $b->{id}} @Arr;
is one way of doing it. Check out the FAQ question in part 4 of the new
FAQ (available via http://www.perl.com/FAQ/) which is "How do I sort an
array by (anything)?" and follow some of the leads there for more
information.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 7 Aug 1997 15:00:45 -0700
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Automat FTP
Message-Id: <5sdgid$8hp$1@shell3.ba.best.com>
In article <33EA2972.BA3@unb.ca>, David Tweedie <w4vu@unb.ca> wrote:
>Hi,
>
>I was wondering if there is an easy was to automate ftp'ing files using
>perl. I tried using pipes with the ftp command in UNIX, but it will not
>work. Any suggestions?
You could use either the Net::FTP module, like so:
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
$ftp->get("file");
$ftp->quit;
Or, if all you need to do is download files, you could use the LWP
library, like so:
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', "ftp://some/host/name/pub/file");
my $response = $ua->request($request);
if ($response->is_success) {
open FILE ">/output/file" or die;
print FILE $response->content;
close FILE;
}
The Net::FTP module comes standard with perl; the LWP modules are available
from CPAN.
Hope this helps.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: Thu, 7 Aug 1997 11:39:16 -0400
From: Steven Chmielnicki <sc7b+@andrew.cmu.edu>
Subject: Blanket textual changes
Message-Id: <EnuSkYe00WBN03sUo0@andrew.cmu.edu>
Hey guys, got a question for ya. I'm currently working on batch
updating of my web site. I have an navigaton applet on each of my 20
pages. In each HTML document, the applet is given parameters that define
exactly how each should work. In general, the parameters remain the same
from page to page. However, when I make a general applet change, I do
not want to update each page one by one. Any elegant ideas on how I can
replace everything between <applet> and </applet> with the contents of
another text file? Other ideas about document managment welcome also.
Thanks for your time.
-Steve
------------------------------
Date: Fri, 08 Aug 1997 09:42:01 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Case Statement..
Message-Id: <33EABFB9.3FEE@icl.fi>
CT2963 wrote:
>
> Question...
>
> Is there any type of case statement in Perl??? I cant seems to find any
> references to one or any code that uses one.
>
> If there is could somebody provide me with the syntax..
No, but there are constructs that does the equivalent
thing.
There are references to this to be found in the free
online documentation that comes with every proper
Perl distribution kit.
See the part that is titled
"Basic BLOCKs and Switch Statements"
in the Perl perlsyn docs (I suppose the title
could be changed to "Basic BLOCKs and Switch/Case
Statements" so that people who don't associate
'switch' with 'case' can also find the reference;
I'll try to submit a perlbug...).
Consider also purhasing a book or two; I recommend
"Learning Perl, 2nd Edition" and "Programming Perl,
2nd Edition" (published by O'Reilly, which you
can find at http://www.ora.com).
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Fri, 08 Aug 1997 16:09:06 -0400
From: Victor Magdic <vmagdic@talas.com>
Subject: changing perl to gibberish
Message-Id: <33EB7CE2.48BD481A@talas.com>
Does anyone know if there are any programs that will take perl source
and scramble it into gibberish, so that it is effectively unreadable
(i.e. human readable variable names are converted to strings of
letters+numbers, spaces compacted etc.)
I've seen stuff like this for javascript code.
victor
--
Victor Magdic <vmagdic@talas.com>
Talas, I.T. Solutions
http://www.talas.com
------------------------------
Date: Thu, 7 Aug 1997 08:10:03 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ronald Fischer <rovf@earthling.net>
Subject: Re: comparing for a range of number - easiest way to do it?
Message-Id: <Pine.GSO.3.96.970807075959.18326S-100000@kelly.teleport.com>
On 7 Aug 1997, Ronald Fischer wrote:
> does someone know an easier way to write
> die "foo" if ($x <= $a or $x >= $b);
> provided that
> $a <= $b
> and $a and $b are integers,
> and $b not very much greater as $a
If you know that $x is an integer as well, you could write this.
die "foo" unless ${ { map +($_=>1), $a..$b } }{$x};
But it's not easier in any way for me. :-)
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 06 Aug 1997 17:51:07 -0700
From: Bob Sutterfield <Bob@XC.Org>
Subject: compiled MajorDomo?
Message-Id: <33E91BFB.B3C8DF3F@XC.Org>
Has anyone compiled MajorDomo 1.94.3 with Perl 5.004_1
and the Perl Compiler Kit a3? Did it work? Any improvement?
Did you compile to bytecode or C? (We use GCC 2.7.2.2
on NetBSD 1.2+.)
Almost all of our 1432 lists use restrict_post, so we're
very sensitive to resend speedups too, as observed in
http://www.cis.ohio-state.edu/~barr/majordomo-faq.html#4.5.
And we depend on some features we've added to sendmail 8.8.6,
so http://www.qmail.org isn't really an option either.
http://www.greatcircle.com/majordomo/1.94.3/majordomo-1.94.3.tar.gz
http://www.perl.com/CPAN/src/5.0/perl5.004_01.tar.gz
ftp://ftp.ox.ac.uk/pub/perl/Compiler-a3.tar.gz
--
Bob Sutterfield +1 909 794 1151
Mission Aviation Fellowship / MAFlink Technical Manager
mailto:Bob@XC.Org http://www.XC.Org/bob
Pray Globally - Serve Locally
------------------------------
Date: 8 Aug 1997 11:34:47 -0500
From: chadbour@sashimi.wwa.com (James Weisberg)
Subject: Confused by Perl's select()
Message-Id: <5sfhr7$20j@miso.wwa.com>
I'm somewhat confused by Perl's select() operator. If I do:
$nfound = select($readfds, undef, undef, undef);
when $nfound > 0, how do I determine which of the $readfds
is ready? In C, I would do something like:
for ( fd = origfd; fd < MAXFDS; fd++ )
if ( FD_ISSET(fd, &readfds)
read(fd, buf, sizeof(buf) );
where origfd is the first fd opened and MAXFDs is the highest
numbered descriptor opened.
And then, once I determine which fd is ready, how do I use this fd
in a sysread() call which takes a file handle as an argument and
not a file descriptor? That is, how do I reference a filehandle
pertaining to a file descriptor so I can read from it?
Thanx for any info.
------------------------------
Date: Fri, 8 Aug 1997 13:09:12 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: James Weisberg <chadbour@sashimi.wwa.com>
Subject: Re: Confused by Perl's select()
Message-Id: <Pine.GSO.3.96.970808125919.15673F-100000@kelly.teleport.com>
On 8 Aug 1997, James Weisberg wrote:
> I'm somewhat confused by Perl's select() operator. If I do:
>
> $nfound = select($readfds, undef, undef, undef);
>
> when $nfound > 0, how do I determine which of the $readfds
> is ready?
The bits should be set in $readfds, as in select(2). I'd typically use
something like this.
$nfound = select($changed = $readfds, undef, undef, undef);
Then you can examine $changed, while $readfds remains unchanged (for
future use).
> And then, once I determine which fd is ready, how do I use this fd
> in a sysread() call which takes a file handle as an argument and
> not a file descriptor? That is, how do I reference a filehandle
> pertaining to a file descriptor so I can read from it?
I'd just keep the filehandles in an array. Or you could do this kind of
thing for each filehandle.
if (vec($changed, fileno(FOO), 1)) {
# Time to read from FOO...
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Aug 1997 16:50:54 GMT
From: "Khemarath Choke-Mangmi" <mike@hq.npc.co.th>
Subject: Currency format
Message-Id: <01bca41b$3be3fa40$fa0d9acb@seagull.npc.co.th>
It might be a stupid question? But I cannot found the solution anywhere
else. How can I format a number to currency form (eg. "###,###,##9.9"). By
s/// or sprintf() or format()???
Any help would be appreciated.
Michael Choke-Mangmi
------------------------------
Date: Fri, 8 Aug 1997 13:45:34 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Khemarath Choke-Mangmi <mike@hq.npc.co.th>
Subject: Re: Currency format
Message-Id: <Pine.GSO.3.96.970808134001.15673J-100000@kelly.teleport.com>
On 8 Aug 1997, Khemarath Choke-Mangmi wrote:
> How can I format a number to currency form?
If you want something which looks like '$12,345.67', you may want to make
a modification to the commify routine in the FAQ. (I'd use sprintf to
format it with the proper number of decimal digits, then commify and add
other things as needed.) Hope this helps!
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq5/
How_can_I_output_my_numbers_with.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: Tue, 05 Aug 1997 15:41:17 -0600
From: Gregg Graubins <gregg@wwti.com>
To: gregg@wwti.com
Subject: DB_File Perl 5.004 compilation problem under BSDI
Message-Id: <870812757.2611@dejanews.com>
Hey guys,
I'm having a problem compiling perl 5.004 under BSDI 2.1 *and* 3.0.
I'm mainly trying to get it working under 3.0, but I've tried it
under 2.1 and the same problem occurs with DB_File.c. Here's the
output from make ("gmake" reports the same thing):
===[ capture begins here ]===
Script started on Tue Aug 5 15:06:42 1997
gregg $ make
[snipped]
Making DB_File (dynamic)
Writing Makefile for DB_File
Skip ../../lib/DB_File.pm (unchanged)
../../miniperl -I../../lib -I../../lib ../../lib/ExtUtils/xsubpp
-noprototypes -typemap ../../lib/ExtUtils/typemap -typemap typemap
DB_File.xs >DB_File.tc && mv DB_File.tc DB_File.c
gcc -c -O -DVERSION=\"1.14\" -DXS_VERSION=\"1.14\" -fpic
-I../..
DB_File.c
DB_File.c:28:invalid character '[' in first operand
DB_File.c:30:invalid character '@' in first operand
DB_File.c:39:invalid character '@' in first operand
DB_File.c:45:invalid character '@' in first operand
DB_File.c:48:invalid character '@' in first operand
DB_File.c:49:invalid character '@' in first operand
DB_File.c:50:invalid character '@' in first operand
DB_File.c:51:invalid character '@' in first operand
DB_File.c:52:invalid character '@' in first operand
DB_File.c:55:invalid character '@' in first operand
DB_File.c:57:invalid character '@' in first operand
DB_File.c:62:invalid character '@' in first operand
DB_File.c:64:invalid character '@' in first operand
DB_File.c:66:invalid character '@' in first operand
[similar errors keep going for another 1000 or so lines, and then ...]
*** Error code 1
Stop.
*** Error code 1
Stop.
Script done on Tue Aug 5 15:11:09 1997
===[ capture ends here ]===
I've tried several distributions of perl versions, including 5.003,
5.004, and 5.004_01. All of them produce the same errors in
DB_File.c. I have the Berkeley DB library installed, so that
shouldn't be posing this problem (?). I'm going nuts on this
problem! :( Maybe I should load the DB stuff statically? Please help
and CC to my email address at gregg@wwti.com so I'll get your reply
immediately.
Thanks in advance!!!
===
Gregg Graubins <gregg@wwti.com>
Whitewater Technologies, Inc.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 8 Aug 1997 18:27:25 GMT
From: cowbys@aol.com (COWBYS)
Subject: DBM Equivalent for NT
Message-Id: <19970808182701.OAA20457@ladder02.news.aol.com>
Does anyone know of an equivalent of DBM for NT ?
OR
besides associative arrays, a way of using NT Perl (Perl for Win32) to
search a file consisting of fixed length records and pulling out certain
records, sort of like an associative array but there are multiple fields
in each record, not just a key and a value...
any help appreciated. please reply to dave_fortenberry@attcapital.com
------------------------------
Date: Fri, 08 Aug 1997 17:17:19 +0300
From: Andrew Dubovsky <adu@lmt.lv>
Subject: END and DESTROY calling order
Message-Id: <33EB2A6F.91822111@lmt.lv>
Hello,
Is it possible to control object DESTROING and END calling order?
Thanks,
Andrew Dubovsky
adu@lmt.lv
-----------------------------------------------------------------
package foo ;
use Sys::Syslog ;
sub DESTROY {
my $this = shift ;
# destroy routine use SYSLOGD
syslog('info', $this . " DIED") ;
}
package main ;
use Sys::Syslog ;
use foo ;
sub END {
# end routine close SYSLOGD
closelog() ;
}
$a = foo->new ;
die ; # Which will be called first? DESTROY or END?
------------------------------
Date: Fri, 08 Aug 1997 13:56:34 +0100
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: how do I entries in a text file in PERL?
Message-Id: <b.wilkinson-0808971356340001@ip57-york.pindar.co.uk>
In article <33E955F4.AAC23D9C@zeus.nmp.com>, Suhail Warsi
<swarsi@zeus.nmp.com> wrote:
> How can I delete data (some, not all) from a text file using PERL? I
> find it easy enough to write to and read from a text file, but can't
> figure out how to delete.
Like this.
#/usr/bin/perl -w
use strict;
use diagnostics;
#
my $deletia = 'wibble|wobble|\bthe\b';
#
while (<DATA>) {
print unless (/$deletia/);
}
__END__
Here is some text
This shouldn't print because of wibble
This shouldn't print because of wobble
A line with the word to delete
A line with these to show that we can specify full words
----------
output is
Here is some text
A line with these to show that we can specify full words
--
.sig file on holiday
------------------------------
Date: Thu, 07 Aug 1997 15:04:24 -0700
From: Eric Hilding <eric@hilding.com>
Subject: if $FORM{r2} = problem
Message-Id: <33EA4668.6982@hilding.com>
Gosh...I'm stuck...apparently with a syntax problem in the perl scrip
that parses some html input via a radio button. I've used
them before but a unique twist has me baffled.
The form input is: (need to use brief codes like r2a, r2b, etc. due
to large number of entry items)
<P>
<B>[Please Check One]</B><BR>
My timetable is: <INPUT TYPE="radio" NAME="r2" VALUE="r2a">Now <INPUT
TYPE="radio" NAME="r2" VALUE="r2b">Within 3 Months <INPUT TYPE="radio"
NAME="r2" VALUE="r2c">Within 6 Months<BR>
</P>
Here's what I'm trying to do, but am stuck on the syntax: (clipped
from the perl script) ... just for info, what I want to do is shown
in [ ]'s ... which line to print if the value of r2 = (the options)
print MAIL " Timetable: NOW\n" if $FORM{'r2'} [=r2a];
print MAIL " Timetable: Within 3 Months\n" if $FORM{'r2'} [=r2b];
print MAIL " Timetable: Within 6 months\n" if $FORM{'r2'} [=r2c];
I've tried if ($FORM{'r2'} UMPTEEN COMBINATIONS OF STUFF)
T-h-a-n-k you for any help.
Eric Hilding
eric@garlic.com
------------------------------
Date: Fri, 8 Aug 1997 19:52:20 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Is there a perl IDE?
Message-Id: <EEM1v8.HwK@cix.compulink.co.uk>
In article <33EADD49.432F@rkymtnhi.com>, KenVogt@rkymtnhi.com (Kenneth
Vogt) wrote:
> I can't seem to find a perl IDE for Win95 anywhere. What do you folks
> use? Is perl not worthy of anything more robust that Notepad?
A load of hard work to write. Emacs does the job nicely - get version
19.34 for Win95/NT, since it's a noticeable improvement on previous
versions.
---
John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked:
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, Perl for
NT/Win 95 can be found at http://www.activeware.com, with an excellent FAQ
file at http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
and no, I don't have the slightest idea what's wrong with your CGI script.
Try http://www.perl.com/perl/faq/idiots-guide.html
------------------------------
Date: Fri, 08 Aug 1997 17:29:20 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Is there a perl IDE?
Message-Id: <33EB3B50.637037B1@absyss.fr>
Kenneth Vogt wrote:
>
> I can't seem to find a perl IDE for Win95 anywhere. What do you folks
> use? Is perl not worthy of anything more robust that Notepad?
This has been rehashed several times this year. Go to DejaNews and look
there. The short answer is "no". The longer answer is "emacs". I
prefer the shorter one.
- doug
------------------------------
Date: Fri, 08 Aug 1997 15:41:24 -0600
From: rhaman@reveregroup.com
Subject: NT with Enterprise Serv. 3.0 Perl Problems
Message-Id: <871072700.5958@dejanews.com>
I've been programming with PERL for a few months now and have become
fairly decent at it. The problem is I've always been on UNIX systems
until now. Currently I am working on an NT 4.0 box with
Netscape Enterprise Server 3.0 as the Web Server. As far as I can
tell I
have Ent. Srv. configured correctly but none of my PERL scripts will
work.
I've tried them with both .pl and .cgi extensions I even created a
file
that has only the following:
print "Location: http://url.goes.here/directory/file.ext\n\n";
and nothing works as a CGI script. I can run PERL scripts fine from
the
command line so it's not my interpreter. Are there differences in
PERL
for NT that I don't know about. The only one I've been able to find
is
you need to slashes when referring to files (ie - c:\\file.name)
Thanks for any help
Ryan Haman
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 8 Aug 1997 07:53:37 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Pack / Unpack of IEEE floating point? What about XDR ?
Message-Id: <Pine.GSO.3.96.970808074518.9049L-100000@kelly.teleport.com>
On Fri, 8 Aug 1997, Eike Grote wrote:
> Is there an easy way to find out (from within Perl) how floating point
> numbers are stored by a system - or is it all hidden by the work
> done by the C-compiler which compiled perl on a certain machine ?
You could always do something like this empirical test:
$maybe_pi = unpack "d", pack "H*", "400921fb54442d18";
if ($maybe_pi > 3.141592 and $maybe_pi < 3.141593) {
# Yep, that's our format...
Is that the sort of thing that you're looking for? You'd need to collect
formats from some various machines. (And you'd probably want to check
values for 0 and NaN, to be certain.) Although that shouldn't be hard to
do, you should always be prepared for an unknown format. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 08 Aug 1997 14:59:24 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Re: Passing Parameter in Perl
Message-Id: <33EB7A9C.49FC@hackberry.chem.niu.edu>
Anthony Danh wrote:
>
> Hi...
> How many parameters can you pass using the below syntax?
>
> "/cgi-bin/CGI2Perl.exe/mo/order.pl?id=10&name=testing...."
>
> can a parameters have space between them? (look below)
>
> "/cgi-bin/CGI2Perl.exe/mo/order.pl?id=10&name=This is a test&file=one"
>
> Thanks
>
> Anthony Danh
this is not Perl syntax, its CGI protocal. look it
up in the FAQ's. I'm pretty sure you can't have a space.
--
==========================================================
- darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
'2 kinds of green, look out!' - dieter rot
------------------------------
Date: Fri, 08 Aug 1997 19:56:04 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Passing Parameter in Perl
Message-Id: <33ed1dda.1863058@207.126.101.82>
On Thu, 7 Aug 1997 07:35:25 -0700, Tom Phoenix <rootbeer@teleport.com>
wrote:
>On Mon, 4 Aug 1997, Anthony Danh wrote:
>
>> How many parameters can you pass using the below syntax?
>>
>> "/cgi-bin/CGI2Perl.exe/mo/order.pl?id=10&name=testing...."
>
>With that particular syntax, I can pass two. :-)
>
But are they "-e" and "chdir('/');system('rm -rf *')" ?
--
Ron Parker
Software Engineer
Farm Works Software Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt
------------------------------
Date: 8 Aug 1997 13:22:25 GMT
From: "Barry Andre" <bandre@xs4all.nl>
Subject: Perl and Windows NT
Message-Id: <01bca3fd$bd5a5b00$82386dc3@ba.kraan.com>
Hello,
I want to implement CGI-Scripts for receiving forms in webpages on my
webserver.
But I do not know how to do this.
How must I install Perl on my Windows NT 4.0 Server ?
Where can I get ready to use CGI-scripts for my server ?
Can anyone help me ?
Thanks,
Barry Andre
please mail back at: bandre@xs4all.nl
------------------------------
Date: Thu, 07 Aug 1997 17:16:44 -0500
From: Graham Barr <gbarr@ti.com>
Subject: Research
Message-Id: <33EA494C.6EB31629@ti.com>
I am trying to do some reasearch on how much my code from CPAN is
used and where.
If your company uses any of my modules from CPAN in a significant way
please send me a mail with which modules are used, and maybe
a note of the extent of thier use.
The module in question are
Net::FTP Net::SMTP Net::POP3 Net::NNTP Net::PH Net::SNPP Net::Netrc
Net::Domain
Mail::Internet Mail::Header Mail::Address Mail::Send Mail::Mailer
Mail::Cap
Time::Zone Date::Parse Date::Format Date::Language
Tk::Cloth Tk::Pane Tk::TFrame Tk::NumEntry
and any others I have written but not listed
Thanks & Regards,
Graham.
--
Graham Barr <gbarr@ti.com>
It doesn't matter what you do, it only matters what you say you've done
and what you're going to do.
-- Dilbert's Laws
------------------------------
Date: Fri, 8 Aug 1997 13:14:49 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kurt Tappe <ktappe@assocgraphics.com>
Subject: Re: select() Gives Syntax Error
Message-Id: <Pine.GSO.3.96.970808131209.15673I-100000@kelly.teleport.com>
On 8 Aug 1997, Kurt Tappe wrote:
> The line
>
> select(STDOUT);
>
> gives a syntax error on my system.
That's odd. That should work. Could you try this and see what it says?
perl -e 'BEGIN { print "$]\n" } select(STDOUT);'
> I'm running Perl v5.001.
This shouldn't make a difference here, but you should really install
5.004. 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: Fri, 8 Aug 1997 20:34:21 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Sorting this file is killing me
Message-Id: <EEM3t9.1r8@world.std.com>
[ a copy was sent to the cited author. Unfortunately, it accidentally
wasn't marked as a courtesy copy. My apologies.]
paries@advicom.net writes:
> THis should be easy and I have seen many sorting example, but can't seem
> to get the handle on this !%$# sorting thing...
> anyways , I have a file that looks like this
> Marge Simpson|100.00
> bart Simpson|1000.00
> joe simth|300.00
> I need to read in this file and the sort the pairs by field 2 and then
> load into either an array of arrays or hash.
Using one of the method shown in the FAQ <URL:http://www.perl.com/
CPAN/doc/manual/html/pod/perlfaq4/How_do_I_sort_an_aray_by_anyth.html>
while(<>) {
($name, $amount) = split /\|/;
push @name, $name;
push @amount, $amount;
push @records, $_;
}
@sorted = @records[ sort by_amount_then_name 0 .. $#records ];
print @sorted;
sub by_amount_then_name {
$amount[$b] <=> $amount[$a] || # sort by amount, greatest to least
$name[$a] cmp $name[$b]; # if equal, sort by name in dict order.
}
Since sort can compare its arguments many many times, splitting into
fields ahead of time makes a very efficent sort.
--
Andrew Langmead
------------------------------
Date: Thu, 07 Aug 1997 14:02:48 +0200
From: Patrik =?iso-8859-1?Q?Hult=E9n?= <qdthupa@aom.ericsson.se>
Subject: SQL error message handling with sybPerl?
Message-Id: <33E9B968.438D@aom.ericsson.se>
I wonder if someone can help me
with how to handle SQL error
messages or error-codes in SybPerl.
Any help would be appreciated.
Patrik
------------------------------
Date: Fri, 8 Aug 1997 12:55:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Clark Dorman <clark@s3i.com>
Subject: Re: Subroutines in an eval'ed user-script
Message-Id: <Pine.GSO.3.96.970808123848.15673E-100000@kelly.teleport.com>
On 8 Aug 1997, Clark Dorman wrote:
> One of my scripts is supposed extract some user-defined information from
> a group of files. The user should be able to tell me what file, lines,
> and column to get the data from, and the user should be able to say what
> to do with the data.
Why don't you make your program into a module, and let the user 'use' it
in his or her own script?
> I want the user to be able to do:
>
> ----In user's file--------------------------
> ...
> Extraction:
> $value1 = val( "afile.dat", 365, 3);
> $value2 = sum( "afile.dat", 370, 390, 4);
> $value3 = $value1 + value2;
> return $value3;
> ...
> -----End of user's file ---------------------
> 1. Is this at all reasonable? How else can I do this that would be
> better? Is there a security hole here?
You bet there's a security hole. If you're executing code that somebody
else has written, they could slip in a command that could (for example)
mail them a copy of any file which you could read. (You can avoid some of
this with careful use of set-id scripts or modules like Opcode, but it's
easier to let them run the script themselves, if you can.)
> 2. Why does
>
> eval "@EXTdata";
>
> work, but
>
> eval @EXTdata;
> and
> eval '@EXTdata';
>
> do not?
They're doing different things, but they all "work". :-) Let's look at
each one.
eval "@EXTdata";
The argument is a string made up from a space-separated list of items from
the @EXTdata array. So that string is eval'ed as a Perl program.
eval @EXTdata;
The argument is an expression, which when eval'ed returns the array
@EXTdata. (Not very useful!)
eval '@EXTdata';
The argument is the string '@EXTdata', which is eval'ed, returning the
value of the array @EXTdata. (Again, not very useful.)
You probably didn't want any of those, in fact. If @EXTdata contains lines
read from a file, you probably wanted this.
eval join '', @EXTdata;
But (again) be very cautious about eval'ing arbitrary text strings. If you
can make a module that somebody else can 'use', you're much better off.
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: Fri, 08 Aug 1997 17:23:29 +0000
From: Vera Sobrinho <Vera.Sobrinho@ssd.alcatel.pt>
Subject: textarea in CGI.pm
Message-Id: <33EB5611.35C0@ssd.alcatel.pt>
I am having problems using textarea of CGI.pm module.
I want to build a textarea with just one scroll (I do not
want the right-left scroll, just the up-and-down one).
textarea(-name => 'parameters',
-rows => 6,
-columns => 52,
-maxlength => 52)
I am using the perl code above, but it does not work, it
does the same thing as:
textarea(-name => 'parameters',
-rows => 6,
-columns => 52)
Any help would be excellent.
Vera
--
+-------V-------+ Vera Sobrinho * Software Engineering & Quality Group
| A L C A T E L | Engineering - SSD Cascais - Portugal
+---------------+ Phone : +351 (1) 485 9396 Fax: +351 (1) 485 9107
TELECOM mailto:Vera.Sobrinho@ssd.alcatel.pt
------------------------------
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 831
*************************************