[10851] in Perl-Users-Digest
Perl-Users Digest, Issue: 4452 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 18 11:07:24 1998
Date: Fri, 18 Dec 98 08:00:23 -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 Fri, 18 Dec 1998 Volume: 8 Number: 4452
Today's topics:
Re: "Parse exceptions" using WIN32::ODBC <cbeatson@mail.ci.lubbock.tx.us>
Re: $&, $', and $` and parens.... (Bart Lateur)
Re: A basic module not found <jdf@pobox.com>
Re: Can this be done (Henry Lifton)
Re: CGI.pm and fileupload <cbeatson@mail.ci.lubbock.tx.us>
Re: CGI.pm and fileupload (Larry Rosler)
Re: Close and ReOpen File (Bryce Pursley)
Re: Close and ReOpen File (Bart Lateur)
Re: First German Perl Workshop 1.0 (Juergen Christoffel)
Re: Happy Birthday! (I R A Aggie)
Re: hashes <r28629@email.sps.mot.com>
Installing pm files for Perl Win32 <bstickel@dot.state.oh.us>
Re: mails <r28629@email.sps.mot.com>
MAPLE V Win32::OLE; <str@zhwin.ch>
multi-dimensional arrays <teun@bye.nl>
Re: multi-dimensional arrays <due@murray.fordham.edu>
numbers in base 36 deja@kiama.com
perl CGI variables ken@symbolicmedia.com
Re: perl CGI variables <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: perl CGI variables <flavell@mail.cern.ch>
Re: Perl, ORacle & Linux (John D Groenveld)
Re: perlcc on Win32 link error wkw@htc.com
Re: problem naming a directory with a number <due@murray.fordham.edu>
Re: problem with grep and readdir for subdirectories <r28629@email.sps.mot.com>
Re: Recursion Hell <jdf@pobox.com>
regular expressions <Derek.Chaloner@securepay.co.uk>
Re: regular expressions <jdf@pobox.com>
Setuid problems <keith@uk.so-net.com>
Re: Unix Perl interfacing with NT ODBC (John D Groenveld)
URGENT - Testing Cgi melita@my-dejanews.com
Re: URGENT - Testing Cgi <Allan@due.net>
Re: URGENT - Testing Cgi (Bart Lateur)
Using the same filehandle twice <anton@urc.ac.ru>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 18 Dec 1998 08:27:59 -0600
From: "Chris Beatson" <cbeatson@mail.ci.lubbock.tx.us>
Subject: Re: "Parse exceptions" using WIN32::ODBC
Message-Id: <75dp2p$efi$1@spider.ci.lubbock.tx.us>
>I think it finds it, but screws up somewhere in the interpreting the
>API. It doesnt even matter if I use any methods from the api. I
>do not even have to connect and open a source, it is just in typing
>in the USE Win32::odbc; It does not like this at all!
This may be because the call you need is:
use Win32::ODBC not use Win32::odbc.
Upper case not lower case!
Chris
------------------------------
Date: Fri, 18 Dec 1998 10:36:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $&, $', and $` and parens....
Message-Id: <367d2f8b.4701580@news.skynet.be>
Larry Rosler wrote:
>You *never* need to use $`, $&, $'.
>
>my ($pre_match, $match, $post_match) = /(.*)(...whatever...)(.*)/s;
At first sight, I would *seriously* doubt that
/(.*?)(... whatever...)(.*)/
would be faster than the much simpler regex
/...whatever.../
plus $`, $&, $'.
Of course, I didn't benchmark. ;-) If it is, there must be something
wrong.
Bart.
------------------------------
Date: 18 Dec 1998 16:24:45 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: digicat@mindspring.com (Kevin M. Counts)
Subject: Re: A basic module not found
Message-Id: <m3lnk55v7m.fsf@joshua.panix.com>
digicat@mindspring.com (Kevin M. Counts) writes:
> Am I crazy or should Text::Balanced be included w/ the Perl 5.04
> distribution?
If those are the only two choices, and they're mutually exclusive,
then you've got a problem.
You must go to the CPAN, fetch the module you want, and install it.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 18 Dec 1998 14:59:35 GMT
From: henlif@elsfl.com (Henry Lifton)
Subject: Re: Can this be done
Message-Id: <75dqfo$ocg$1@remarQ.com>
Thank you both for your help. I am so thick and stupid that I must have
missed something easy.
This is the exact code I am using and the results of it. I would gladly pay
for the correct solution.
Thanks
Henry
#! /usr/local/bin/perl
#require("cgi-lib1.pl");
# -------------------------- Open the files
my %land;
open(LAND,'/data/land.txt') || die "can't open file land";
# -------------------------------- Setup the HTML
print "content-type: text/html\n\n";
print "<body bgcolor='ffffff'>";
print "<basefont face = Arial, Helvetica size=2>";
# -------------------- Make Array
my %land;
while(<LAND>)
{
my ($id,@rest)=split('\t',$_);
$land{$id}=\@rest;
}
close LAND;
# --------------------Get Link Info from Previous page $key is $id
$key=$ENV{'PATH_INFO'};
$key =~ s|/||;
$info=$land{$key};
($id,$address,$city,$type,$imp,$desc,$terms,$comments)=split('\t',$info);
print "
key= $key<BR>
info= $info<BR>
land=$land{$key}<BR>
id=$land($id)<BR>";
# This is what shows up
# key= 4561 this is correct
# info= ARRAY(0x100082cc) should be 4561
# land=ARRAY(0x100082cc) I don't know what this is
# id=(ARRAY(0x100082cc)) This should be 4561
In article <36788A6C.796C8844@home.com>, Rick Delaney <rick.delaney@home.com>
wrote:
>[posted & mailed]
>
>jamesht wrote:
>>
>> Here you go:
>>
>> my %land;
>> open(LAND, "land.file") || die "$!";
>> while(<LAND>) {
>> ($id, @rest) = split('\|', $_);
>> $land{$id} = \@rest;
>
>Oops, @rest is being given new values on each iteration of the loop but
>$land{$id} contains the same reference to @rest for all values of $id.
>Outside the loop, @{$land{$id}} will return the fields of the last line in
>the file, regardless of what $id is.
>
>You could declare @rest local to the while loop:
>
> my ($id, @rest) = split /\|/;
> $land{$id} = \@rest;
>
>or use an anonymous copy:
>
> $land{$id} = [@rest];
>
>> }
>> close LAND;
>
>The former is probably faster since there is no copying. Also, since you're
>going to have to declare all your variables anyway when you put 'use strict'
>at the top of your program -- you will do this, right? -- you might as well
>declare them in the while loop.
>
------------------------------
Date: Fri, 18 Dec 1998 08:15:24 -0600
From: "Chris Beatson" <cbeatson@mail.ci.lubbock.tx.us>
Subject: Re: CGI.pm and fileupload
Message-Id: <75dob6$62v$1@spider.ci.lubbock.tx.us>
>I am trying to make a fileupload script with the CGI module.
>But this module creates temporary files in a directory called tmp.
>How can I change this to anothher by my choice, I have looked in the
>docs, and Dejanews -> now(answers)
The variable that you use to reference your file can also be used as a
filehandle to that temporary file. This way, you can copy that file to
another file at any location and with any name.
e.g
use CGI qw("param");
my $file=param("myfile");
open (OUT, ">somefilename");
binary(OUT); # if it is an image
while (<$file>) {
print OUT "$_";
}
close (OUT);
Chris Beatson
------------------------------
Date: Fri, 18 Dec 1998 07:36:56 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: CGI.pm and fileupload
Message-Id: <MPG.10e416775471f0a4989965@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <75dob6$62v$1@spider.ci.lubbock.tx.us> on Fri, 18 Dec 1998
08:15:24 -0600, Chris Beatson <cbeatson@mail.ci.lubbock.tx.us> says...
...
> binary(OUT); # if it is an image
Do you mean that to be binmode?
> while (<$file>) {
> print OUT "$_";
> }
It is peculiar to quote a simple scalar, and unnecessary to name $_ in
any case. How about just this:
print OUT while <$file>;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 18 Dec 1998 13:13:46 GMT
From: hbpursle@duke-energy.com (Bryce Pursley)
Subject: Re: Close and ReOpen File
Message-Id: <367c5114.2483780858@news.infoave.net>
On Fri, 18 Dec 1998 00:27:32 -0500, rjk@linguist.dartmouth.edu (Ronald
J Kimball) wrote:
>Bryce Pursley <hbpursle@duke-energy.com> wrote:
>
>> Is there any reason I can't close and then immediately reopen a file?
>> The code doesn't work when I do it in consecutive lines of one program
>
>No, there's no reason why you can't close and then immediately reopen a
>file.
>
>There must a bug in your code. I'd say it's where you... oh, wait, I
>haven't actually seen your code. Never mind.
My apologies for not sending any code. (A strickly personal decision
based on the necessary size of the sample.)
For those of you who responded I wanted to be curtious enough to
provide the solution I found to the problem. Early in the program I
had issued the following command . . .
$/ = "";
This allowed me to read and process multiple lines of the input file.
When I closed and then reopened the file I needed to read lines
separated by carriage returns but I had not changed the $/ setting.
When I used a separate script the default $/ setting was \n which
worked great. I have added the new setting . . .
$/ = "\n";
just prior to reopening the file and everything works fine.
Thanks for the ideas.
Bryce Pursley
P.S. I realize that I could use other methods to accomplish this
without closing and reopening files (an array would work nicely) but
I'm learning and trying to take things a step at a time. When I get
it all working the way I want then I'll go back and try to improve
things.
------------------------------
Date: Fri, 18 Dec 1998 13:40:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Close and ReOpen File
Message-Id: <367a5b16.15820816@news.skynet.be>
Bryce Pursley wrote:
>$/ = "";
>This allowed me to read and process multiple lines of the input file.
>
>When I closed and then reopened the file I needed to read lines
>separated by carriage returns but I had not changed the $/ setting.
>When I used a separate script the default $/ setting was \n which
>worked great. I have added the new setting . . .
>$/ = "\n";
>just prior to reopening the file and everything works fine.
Maybe you should use
{
local $/;
# read the while file in one string
...
}
since this won't permanently change the global $/.
Bart.
------------------------------
Date: 18 Dec 1998 14:35:26 +0100
From: jc@gmd.de (Juergen Christoffel)
Subject: Re: First German Perl Workshop 1.0
Message-Id: <75dlmu$b0o@alice.gmd.de>
[mailed and posted]
In <75abr0$hi4$3@penthesilea.Materna.DE> Juergen.Puenter@materna.de (J|rgen P|nter) writes:
>In article <7596r6$3vu$1@nnrp1.dejanews.com>, birgitt@my-dejanews.com
>says...
>>
>>This announcement was NOT made in de.comp.lang.perl, nor in clpm, nor in
>>clp.announce. Just in clp.moderated.
>>
>>Is it worth wondering why ?
Wonder? Why? It should be easy to deduce.
>Perhaps because 90% of us would be banned from it from the
>start.
No, that wasn't the main reason. It was first submitted to clp.announce by
the end of November but Randal (or some semi-automated incarnation of him)
rejected it because it didn't contain the "right keywords" without further
regard to the contents.
It wasn't posted to clp.misc because that's the high-volume group where
postings get drowned in the traffic and clp.moderated was added to the clp
hierarchy for exactly that reason. And, mind you, cross-posting between
clp.moderated and clp.misc wouldn't be that good an idea.
And, yes, it wasn't posted to de.comp.lang.perl because 90% of the
readership wouldn't be able to attend the workshop anyway (see below for
details). But we expect the remaining 10% of the readership to also follow
at least clp.moderated and so feel free to join the mailing list if you
read clp.moderated regularly.
>Roughly translated from http://www.gmd.de/Events/Perl-WS99/ :
>"Since this is a meeting meant for experience-exchange, noone
>who has not written larger Perl-programs will be allowed to
>participate..."
A more appropriate translation would be "we regret that due to the _limited
number of seats available_ we have to impose some restrictions on possible
participants."
>In short, Gurus only. No wonder considering that they have room
>for only 40-70 participants and demand a little 'what I have done
>with Perl'-speech from everyone.
Your reasoning is more or less correct. But it's not limited to gurus
(whatever that is) only. If you've read the camel book and regularly
consult the perl faqs (which, btw, 90% of the people posting in
de.comp.lang.perl won't do :-()) you might qualify already. First of all,
we have limited space available as is clearly stated. Second, this isn't a
commercial conference. We plan a _workshop_ so everybody should be able to
work with everybody else and they should be able and willing to present
their work with Perl. And last but not least nobody would be happy if the
levels of experience would be too different. So that's were we drew the
line. So if you want to participate, get on the list.
If you have a problem with these "restrictions" feel free to contact me via
e-mail as I don't think the topic isn't of much interest to the regular
reader of this group.
--jc
P.S. When I came up with the idea of organizing "such a thing" last year
(after having been to the first perl conference in san jose) I thought that
a German or maybe even a European conference might be a good idea. But
after talking with various people who supported the idea and even running a
BOF at this year's perl conference, we decided to start with a small
workshop and scale it up afterwards if the workshop succeeds.
--
E-Mail: christoffel@gmd.de or one of {ftp,news,web}master@gmd.de
GMD - German National Research Center for Information Technology
"Lesen erspart Ueberraschungen!" Hermann Heimpel, Historiker
------------------------------
Date: Fri, 18 Dec 1998 10:40:59 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Happy Birthday!
Message-Id: <fl_aggie-1812981040590001@aggie.coaps.fsu.edu>
In article <75co4t$1gk$1@picasso.op.net>, mjd@plover.com (Mark-Jason
Dominus) wrote:
+ Perl is 11 years old today.
At least I'm using a language younger than I am...
James
------------------------------
Date: Fri, 18 Dec 1998 08:42:33 -0600
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: hashes
Message-Id: <367A69D9.CEB616D6@email.sps.mot.com>
Ala Qumsieh wrote:
>
> tabo <cswfrank@rica.net> writes:
>
> >
> > is there a way to get the number of items in a hash table?
>
> $num = scalar keys %hash;
^^^^^
$num is already a scalar.
-TK
------------------------------
Date: Fri, 18 Dec 1998 07:30:59 -0500
From: "Bob Stickel" <bstickel@dot.state.oh.us>
Subject: Installing pm files for Perl Win32
Message-Id: <367a56d4.0@socnm002.dot.state.oh.us>
I just got started with ActiveState's version 5.005_02 under 95 and NT with
no particular problems. Now I would like to install some modules but can't
figure out exactly what I need to do. I understand the make commands from
previous Linux experience but I don't have a C compiler installed on my
Win32 platforms. Do I need to get the GNU DOS version and compile the
modules before they can be installed or do I need to have a Win32 C
compiler? I have Borland and Msoft available for installation but really
don't want to install them unless absolutely necesssary.
Thanks
Bob
------------------------------
Date: Fri, 18 Dec 1998 08:40:42 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Herger Peter <peter.herger@swisslife.ch>
Subject: Re: mails
Message-Id: <367A696A.C3676FF4@email.sps.mot.com>
[posted to clp.misc and copy emailed]
Herger Peter wrote:
>
> Hi everybody
>
> I've wrote a little script like that:
>
> use Mail::Send;
>
> $mail=Mail::Send->new(
> Subject => "blablabla",
> To => 'user@remote.host.com',
> To => 'user2@remote.host.com');
> .....
>
> How can I add more recipients with "To=>"?
> If I do it like the example above, it is only delivered to the first
> recipient.
I had the same question when I first used Mail::Send, and somehow I feel
that the pod for Mail::Send need to be updated for this. In any case,
you can do either of these:
@list = ('user@remote.host.com', 'user2@remote.host.com');
$mail = Mail::Send-new(
To => join ',', @list
);
or
$mail = Mail::Send-new();
$mail->to(@list);
or
$mail = Mail::Send-new();
$mail->to(join ',', @list); # of 'cos this seems awkward
-TK
------------------------------
Date: Fri, 18 Dec 1998 16:07:02 +0100
From: Guido Steiner <str@zhwin.ch>
Subject: MAPLE V Win32::OLE;
Message-Id: <367A6F96.999548A2@zhwin.ch>
I'm looking for a possible way to start the MAPLE V Application with the
help of a Perl script.
Please find below a short test sequence, which starts the MATLAB command
window.
use Win32::OLE;
$obj= Win32::OLE ->new('Matlab.Application' ) || die "CreateObject :
$!";
$obj ->MaximizeCommandWindow;
$obj->Execute("surfl(peaks)");
$obj->Execute("shading interp");
$obj->Execute("colormap(gray)");
$_=<>;
Now I'm battling in the office to find a way to apply the same structure
but with MAPLE V. The documentation of MAPLE V declares that MAPLE
includes the OLE standard.
I already tried several combinations of names like :
$obj= Win32::OLE ->new('MAPLE.Application' ) || die "CreateObject :
$!";
or
$obj= Win32::OLE ->new('WMAPLE.Application' ) || die "CreateObject :
$!";
and so on.....
but up to now without success.
Maybe somebody can give me a hint, how I should proceed.
Any answers will be highly appreciated
Many thanks
Guido
------------------------------
Date: Fri, 18 Dec 1998 10:43:16 +0100
From: "Teun" <teun@bye.nl>
Subject: multi-dimensional arrays
Message-Id: <367a22a3.0@news.goldmine.nl>
Is it possible to use two- or three dimensional arrays in perl?
what would a foreach-loop look like then?
Thanks.
Teun van Eijsden
------------------------------
Date: 18 Dec 1998 11:07:40 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: multi-dimensional arrays
Message-Id: <75dd1s$ptg$0@206.165.165.142>
Teun wrote in message <367a22a3.0@news.goldmine.nl>...
|Is it possible to use two- or three dimensional arrays in perl?
|what would a foreach-loop look like then?
The cool thing is that not only can create complex data structures with Perl,
all the documentation you need to learn how to create and use such structures
is provided in the docs. Check out:
perldoc perldsc
perldoc perllol
AmD
------------------------------
Date: Fri, 18 Dec 1998 09:58:37 GMT
From: deja@kiama.com
Subject: numbers in base 36
Message-Id: <75d90c$h4f$1@nnrp1.dejanews.com>
Is there a way for perl to read numbers in bases other 8,10, and 16?
There is a function in Java to format an integer in any base, I would like to
create a base 36 number in java and pass it to a perl script. Can perl convert
it back to decimal?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 18 Dec 1998 12:47:07 GMT
From: ken@symbolicmedia.com
Subject: perl CGI variables
Message-Id: <75disa$opr$1@nnrp1.dejanews.com>
I have a variable in a Perl application called $xtime that contains a value
like "06:00 PM". I am using an http:// statement to send it to another Perl
CGI app. The statement is like --
http://url.com/cgi-bin/newapp.cgi?time=$xtime&other=$other&more=$more
The stream is parsed by the 2nd app. The problem is that in Internet
explorer, $xtime shows up as "06:00 PM" but in NetScape the "PM" is not
passed. Also, some of the other variables that get passed using IE Explorer
are apparently not getting passed when using the NetScape browser.
What's going on? Am I not aware of something special about NetScape and CGI?
Any light on this matter would be much appreciated. Thank you.
ken@symbolicmedia.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 18 Dec 1998 14:07:57 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: perl CGI variables
Message-Id: <83n24lfviq.fsf@vcpc.univie.ac.at>
Re: perl CGI variables, ken <ken@symbolicmedia.com>
said:
ken> I have a variable in a Perl application called
ken> $xtime that contains a value like "06:00 PM". I
ken> am using an http:// statement to send it to
s/statement/request/
ken> another Perl CGI app. The statement is like --
ken> http:/...[snip]
ken> The stream is parsed by the 2nd app. The
ken> problem is that in Internet explorer, $xtime
ken> shows up as "06:00 PM" but in NetScape the "PM"
ken> is not passed. Also, some of the other
ken> variables that get passed using IE Explorer are
ken> apparently not getting passed when using the
ken> NetScape browser.
Spaces are not allowed in URLs. IE is wrong,
Netscape is right (or at least, not as wrong :-).
You must encode the space (as %20), e.g. using the
query_form() method in the URI::URL module and then
pass it onto an HTTP::Request and LWP::UserAgent.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 18 Dec 1998 14:07:34 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: perl CGI variables
Message-Id: <Pine.HPP.3.95a.981218140527.11077C-100000@hpplus01.cern.ch>
On Fri, 18 Dec 1998 ken@symbolicmedia.com wrote:
> I have a variable in a Perl application called $xtime that contains a value
> like "06:00 PM". I am using an http:// statement to send it to another Perl
> CGI app. The statement is like --
> http://url.com/cgi-bin/newapp.cgi?time=$xtime&other=$other&more=$more
So it's an invalid URL when your value contains a space.
Read up about URLencoding. RFC1738, isn't it, perhaps RFC2396 now.
------------------------------
Date: 18 Dec 1998 08:56:51 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Perl, ORacle & Linux
Message-Id: <75dmv3$ig5$1@tholian.cse.psu.edu>
There were at least 3 patches to the beta.
John
groenveld@acm.org
------------------------------
Date: Fri, 18 Dec 1998 13:52:40 GMT
From: wkw@htc.com
Subject: Re: perlcc on Win32 link error
Message-Id: <75dmn6$s5j$1@nnrp1.dejanews.com>
I had the unix equivalent of the same problem.
A gentleman named "Vishal Bhatia" helped by pointing me to
release perl5.00554, in which this bug is fixed. He was
kind enough to respond to me directly via email, so the
response may not have been posted. This fixed it.
Subsequently though, my compiled Perl progs would bail
(always at the header of a foreach or other loop) with
nonsensical error messages, at which point he recommended
using the "C" backend as opposed to the "CC". (-MO=CC on
the Unix cmd line; I suppose for NT it's click this, check
that :-) ). I don't quite understand why (CC on most flavors
of Unix implies the C++ compiler, yet the intermediate code is
called ".c" and appears to be C source, and is compiled by "cc",
the 'C' compiler, so I don't quite get the difference), but this
DOES work!!!! I compiled 600 lines of Perl into 8K lines of C, and
then it gets linked into an executable which behaves identically to
the Perl source!!!!
The only battle now is that it is not completely standalone; it still
"requires" the modules, so I need to figure out how to get those resolved
and linked statically into an executable I can more easily distribute.
Thanks Vishal, Keith
In article <01be2955$bfc573a0$5a0c4a0c@sirwin.ati.att.com>,
"Scott Irwin" <the.irwins@worldnet.att.net> wrote:
> I have built Perl5.005_02 on my NT box with VC++ 6.0.
>
> My print "Hello World\n"; compiles, links and executes fine.
>
> Now I need to compile a somewhat larger program. The link step fails when
> it can't resolve _runops(). It appears that many references to variations
> of _runops appear in the source code. I executed the nmake -f Makefile
> test script and all passed except one POSIX test (no big deal).
>
> It was late and I never tried putting the -lperl again on the file list.
> I've done compiles before on Unix where that actually resolved the problem.
> I'll give it a shot Thursday, but I'm not holding my breath.
>
> Thanks in advance.....
>
> Scott Irwin
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 18 Dec 1998 11:17:50 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: problem naming a directory with a number
Message-Id: <75ddku$qvo$0@206.165.165.142>
Brendan Murphy wrote in message ...
|Hello!
Hi, and welcome to the Psychic Friends of Perl Network. ;-)
|I am trying to have a cgi redirect to a page such as
|http://www.hello.com/redirect1111
|But instead of directing to that page it goes to
|http://www.hello.com/redirect111
|Please, help.... must be some reason....
I dust of the magic eightball and the answer is : Yes!
Shoot, that doesn't help. No, no wait, poltergeists? No? Ok then, hmm, I
guess you are choping something when you don't meant to or should be chomping
but my psychic skills are pretty rusty. <g> You will probably have to post a
small snippet of the your code which illustrates the problem.
AmD
------------------------------
Date: Fri, 18 Dec 1998 08:18:38 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Emmett McLean <emclean@slip.net>
Subject: Re: problem with grep and readdir for subdirectories
Message-Id: <367A643E.597A9E6F@email.sps.mot.com>
[posted to clp.misc and copy emailed]
Emmett McLean wrote:
>
> In article <xbEd2.99$595.86@nsw.nnrp.telstra.net>,
> Martien Verbruggen <mgjv@comdyn.com.au> wrote:
> >
> >Please, please, please, always consult the documentation first if you
> >have a problem with a certain function.
> >
> As is typical in this group, don't give any answers and
> wine that the answer is in the documentation.
well, if I knew "the answer is in the documentation", I wouldn't ask.
> Gees.
>
> I'd recommend you get a find command which works for you on
> the unix command line and use qx. As in
>
> @mydirs = qx/find rootdir -type d (blah blah blah)/;
use File::Find;
this is also (somewhere) in the documentation ;-)
-TK
------------------------------
Date: 18 Dec 1998 16:20:05 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "BenJamin Prater" <jipes@ispchannel.com>
Subject: Re: Recursion Hell
Message-Id: <m3ogp15vfe.fsf@joshua.panix.com>
"BenJamin Prater" <jipes@ispchannel.com> writes:
> For the last week (literally), I've been banging my head against a
> wall.
Well, good. It should be nice and soft, and therefore receptive to
advice.
> The module is called 'TemplateAgent' and what is does is parses a
> HTML template searching for a set of tags ($tagset) and replacing
> them with the corresponding anonymous sub that also rides in with
> the $tagset hash.
It parses HTML? Maybe you ought to go to the CPAN and grab the
modules that already do it correctly. You can subclass HTML::Parser,
for example.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 18 Dec 1998 13:27:36 -0000
From: "Derek Chaloner" <Derek.Chaloner@securepay.co.uk>
Subject: regular expressions
Message-Id: <367a5849.0@nnrp1.news.uk.psi.net>
sub doLine
{
my $line = shift;
foreach $key (keys(%sub))
{
print " substituting <$sub{$key}> for <$key>\n" if
$line=~s/$key/$sub{$key}/g;
}
return $line;
}
This snippet of code is part of a script which reads a file of substitutions
to make and enters them into a hash.
The target files are then read and all of the substitutions are made a line
at a time by this sub-routine.
This works well for normal substitutions (I don't really care if it is not
the most optimum for speed :-) ) but the replacement strings from the hash
may contain $1, $2, $& etc and I cannot get the extracted sub-strings into
the replacement.
I have tried /e option and eval but whatever combination I have tried I
cannot get it to work.
Derek Chaloner
Racal-Datacom (SPS)
Work mailto:Derek.Chaloner@racalitsec.com
Home mailto:derek@chaloner.globalnet.co.uk
Web http://www.users.globalnet.co.uk/~chaloner
------------------------------
Date: 18 Dec 1998 16:47:38 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Derek Chaloner" <Derek.Chaloner@securepay.co.uk>
Subject: Re: regular expressions
Message-Id: <m3iuf95u5h.fsf@joshua.panix.com>
"Derek Chaloner" <Derek.Chaloner@securepay.co.uk> writes:
> $line=~s/$key/$sub{$key}/g;
> This works well for normal substitutions (I don't really care if it
> is not the most optimum for speed :-) ) but the replacement strings
> from the hash may contain $1, $2, $& etc and I cannot get the
> extracted sub-strings into the replacement.
If I understand you, you want something like this:
$sub{foo} = '<a href="$2" name="$1">';
and to have the $1 and $2 be evaluated in the context of the match,
yes? Well, it's doable, but you have to play a trick. Here's a
simple example:
my $bob = '"$2 before $1"';
my $carol = 'alice';
$carol =~ s/(..)(...)/$bob/ee;
print $carol;
If you need quote characters inside the replacement string, make sure
you escape them:
my $bob = '"\"$2\" before \"$1\""';
Or, if all of that escaping strikes you as ugly, use the generalized
quoting operators:
my $bob = 'qq("$2" before "$1")';
Why "ee"? If you just have "e", that evaluation is equivalent to the
interpolated value of the variable, and gets you nothing. Evaluating
the resulting string a second time gives you the next level of
interpolation, and the literal string '$1' becomes whatever $1
contains. The trick is that the substitution variable must be a
valid Perl expression (or else the second eval will choke).
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 18 Dec 1998 11:53:08 +0000
From: Keith Oborn <keith@uk.so-net.com>
Subject: Setuid problems
Message-Id: <367A4224.AB16F3B1@uk.so-net.com>
I wonder if anyone can help with an suid problem? I need to run certain
cgi scripts setuid, and I'm running into a brick wall. I've tried all
the methods I can find (cgiwrap, #define SETUID_SCRIPTS_ARE_SECURE_NOW (it's
under Solaris 2.6), suidwrap), but to no avail. The problems arise from
operations like:
system("touch $file");
open(FILE,">$file");
$output = `$ext_binary -i $bin_temp`;
print "$output";
unlink($bin_temp);
Now I freely admit my Perl is not great, and to add insult someone walked off
with my copy of the "bible".
Does anyone have any (printable!) suggestions? Email please, I'll summarise
back if necessary.
Thanks!
--
Keith Oborn Sony Communication Network 0171 426 8655
15th Floor, Commercial Union Tower, 1, Undershaft, London EC3A 8NP
keith@uk.so-net.com
------------------------------
Date: 18 Dec 1998 08:55:31 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Unix Perl interfacing with NT ODBC
Message-Id: <75dmsj$iff$1@tholian.cse.psu.edu>
I just used Openlink's multitier ODBC broker to connect from Solaris(sparc)
to NT and MS Access. The client used the Perl modules DBI/DBD::ODBC.
http://www.openlinksw.com/
John
groenveld@acm.org
------------------------------
Date: Fri, 18 Dec 1998 10:08:17 GMT
From: melita@my-dejanews.com
Subject: URGENT - Testing Cgi
Message-Id: <75d9ih$hic$1@nnrp1.dejanews.com>
Hi
I am looking for a module that could do the test for cgi-scripts easier. I
want to test my cgi-script locally and not in the web server. I want to write
the input for my form in a file and run the cgi script locally for testing.
I will try explain more what I mean.
If I have in my form the fields: field1 and field2.
Then I want write in a file :
field1 : xxx
field2 : yyy
And run the CGI locally with this file as input.
Does anybody know how to do that ?
Does anybody have a module that can do that ?
Thanks in advance
Melita
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 18 Dec 1998 07:35:39 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: URGENT - Testing Cgi
Message-Id: <75dhsr$o0u$1@camel15.mindspring.com>
melita@my-dejanews.com wrote in message <75d9ih$hic$1@nnrp1.dejanews.com>...
>Hi
>I am looking for a module that could do the test for cgi-scripts easier. I
>want to test my cgi-script locally and not in the web server. I want to
write
>the input for my form in a file and run the cgi script locally for testing.
>I will try explain more what I mean.
>If I have in my form the fields: field1 and field2.
>Then I want write in a file :
>field1 : xxx
>field2 : yyy
>And run the CGI locally with this file as input.
Jeopardy style:
A:The best way to create and test CGI or do anything that involves CGI and
Perl.
Q: What is CGI.pm.
As another option, you can also download and install a server for your
system to assist you in your testing. A popular (most popular?) server is
available free at www.apache.org.
HTH
AmD
------------------------------
Date: Fri, 18 Dec 1998 13:02:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: URGENT - Testing Cgi
Message-Id: <36804f59.12827019@news.skynet.be>
melita@my-dejanews.com wrote:
>If I have in my form the fields: field1 and field2.
>
>Then I want write in a file :
>field1 : xxx
>field2 : yyy
>
>And run the CGI locally with this file as input.
>
>Does anybody know how to do that ?
>Does anybody have a module that can do that ?
Yes, I have my own CGI library (largely based upon CGI.pm, but only
containing the stuff I always need), and I do it in a way ressembling
this.
What I do in &parseFormData is checking the REQUEST_METHOD environment
variable, and if it doesn't exist, I read the key/value pairs from a
file.
You could do something like this:
if($ENV{REQUEST_METHOD}) {
... normal processing
} else {
print STDERR "Debugging mode\n"
open(IN,"query.txt")
or die "Please provide a file 'query.txt'";
while(<IN>) {
chomp;
my($key,$value) = split(/\s*:\s*/,$_,2;
$form{$key} = $value;
}
}
Of course, you might need a more elaborate approach if you could have
multiline or multiple occurrences fields.
HTH,
Bart.
------------------------------
Date: Thu, 17 Dec 1998 15:54:36 +0500
From: Anton Voronin <anton@urc.ac.ru>
Subject: Using the same filehandle twice
Message-Id: <3678E2EB.966440E4@urc.ac.ru>
Hello!
The use of an existing filehandle associated with opened file is incorrect
like in the following situation:
open FH, "testfile.txt";
print scalar ( <FH> );
&routine;
print scalar ( <FH> ); # this won't work if routine open()s with FH too
without localizing *FH
close FH;
But if we do:
open FH, "testfile.txt";
...
close FH;
# and then we use FH again:
open FH, "testfile2.txt";
...
close FH;
In most cases it works fine, but I have a perl application which sometimes
die()s (though rarely) because either close() does not return true or SIGPIPE
is received. I am not sure if it happens right where FH is used again or
not... So I am asking - is it absolutely safe or not?
Thanks in advance,
Anton
--
Anton Voronin | Ural Regional Center of FREEnet,
anton@urc.ac.ru | Southern Ural University, Chelyabinsk, Russia
http://www.urc.ac.ru/~anton | Programmer & System Administrator
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4452
**************************************