[12593] in Perl-Users-Digest
Perl-Users Digest, Issue: 6193 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 1 15:07:20 1999
Date: Thu, 1 Jul 99 12:00:23 -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 Thu, 1 Jul 1999 Volume: 8 Number: 6193
Today's topics:
Re: Apples and Oranges (M.J.T. Guy)
Re: Apples and Oranges (Kevin Reid)
Re: Clueless and in need of help! (Harmanie)
Re: Clueless and in need of help! (Jerome O'Neil)
Re: Communication between CGI and apache manitee@my-deja.com
Re: Copying Lines to File (Andrew Allen)
Re: Copying Lines to File (Neko)
cryptswitch tram@olympic.seas.ucla.edu
Re: Date Bug??? (I R A Aggie)
Re: differentiate btw big-endian machine and small-endi <doughera@lafayette.edu>
Re: Forms Processing - thread started in HTML group (Ken)
Re: Forms Processing - thread started in HTML group <rick.delaney@home.com>
Re: Forms Processing - thread started in HTML group <emschwar@rmi.net>
Re: hiring perl programmers (Neko)
Re: In Mountain View did Larry Wall (Steve Linberg)
Re: Is perl 8-bit safe? <d-edwards@uchicago.edu>
listen: Operation not supported (Norman Branitsky)
Re: make my day fix an array :-) <sulakshan.shetty@wcom.com>
Re: Making things go "BEEP!" (Andrew Allen)
Re: Newbie is back!! This time knows his stuff (he thin (Andrew Allen)
Newbie questions <jamescwalker@csi.com>
None (Cory C. Albrecht)
Re: PCI66 / UDMA66 / Ultra66 / Linux? (Kevin Reid)
Re: Robot email/poster (new proposal) <gt7202e@prism.gatech.edu>
Re: Robot email/poster for this group (John Stanley)
running perl script gqc2017@is.nyu.edu
Re: Spell Checker (Greg Snow)
Re: SSI exec with POST? <ehpoole@ingress.com>
Re: text editing question???? <emschwar@rmi.net>
Re: Top 10 responses to the Robot/email idea (I R A Aggie)
Re: Top 10 responses to the Robot/email idea <revjack@radix.net>
Re: write and Page Size i.e. number of rows (John Borwick)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Jul 1999 17:11:50 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Apples and Oranges
Message-Id: <7lg7gm$c49$1@pegasus.csx.cam.ac.uk>
In article <377ab02c.25324711@news.pacifier.com>,
doug edmunds <edmundsMUNGED@pacifierMUNGED.com> wrote:
>On 30 Jun 1999 18:32:21 GMT, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>>
>>And if you add the extra line to the end of your test
>>
>> print \$$t, \$1, \$2, "\n";
>>
>>you get the extra output (for example)
>>
>> SCALAR(0xb3e48)SCALAR(0xb3f08)SCALAR(0xb3f44)
>>
>>showing that $$t and $1 are *not* the same variable.
>
>But they are both references to the same memory location.
No. The printing of the references shows that they are references to
different variables - the hex numbers are the memory addresses of
the variables. But it is true that the value of one variable changes
to track the value of the other, and that is what was causing me puzzlement.
Guy Decoux has kindly explained in private email what is going on.
Variables like $1 are "magical". They don't have a real value;
rather special code is called to determine their value whenever they are
read. perl marks as magical (and incidentally read-only) any
variable whose name begins with a (non-zero?) digit (rather than, as
one might expect, variables whose names consist of digits only).
And the magic code does atoi() on the variable name, so the two
variables appear to have the same value.
Mike Guy
------------------------------
Date: Thu, 1 Jul 1999 14:22:47 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Apples and Oranges
Message-Id: <1du7e8x.1rj1h3sz4fqpsN@[192.168.0.1]>
doug edmunds <edmundsMUNGED@pacifierMUNGED.com> wrote:
> >In fact, in her infinite magnanimity, perl has
> >allowed you to create a variable with a blank in its name.
>
> But wait! theres more! How about parentheses, curly brackets,
> some exclamation points and even a new line?.
>
<code snipped>
#!perl
${"$,"} = $0;
print ${"$+"};
__END__
--
Kevin Reid: | Macintosh: | print$"x(sin($i++/5)*30+30),"*$/"while 1
"I'm me." | Think different.|
------------------------------
Date: 01 Jul 1999 18:19:52 GMT
From: harmanie@aol.com (Harmanie)
Subject: Re: Clueless and in need of help!
Message-Id: <19990701141952.05699.00004356@ng-fh1.aol.com>
>
>http://www.yoursite.com/cgi-bin/acecard.pl
>
>should work if you have it all installed correctly and have chmod acecard.pl
>to 755 and uploaded it to your server in ascii.
Well, Jody, you had me all excited there...could it really be that easy? NOPE
:) I reuploaded it, just to be sure that I did it as ASCII, then I set the
chmod to 777 (thought I would throw in a few extra permissions there:), went to
run it and got this:
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, webmaster@harmaniedesigns.com and
inform them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error log.
Sooo, I went back and changed the chmod to 755 like you told me to in the first
place and got the same message. Any other suggestions?
Christine
------------------------------
Date: 1 Jul 1999 18:39:35 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
To: harmanie@aol.com (Harmanie)
Subject: Re: Clueless and in need of help!
Message-Id: <7lgcl7$uds$1@brokaw.wa.com>
[Posted and mailed]
In article <19990701141952.05699.00004356@ng-fh1.aol.com>,
harmanie@aol.com (Harmanie) writes:
> More information about this error may be available in the server error log.
>
> Sooo, I went back and changed the chmod to 755 like you told me to in the
> first place and got the same message. Any other suggestions?
What does it tell you in your server logs?
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.i-filezone.com
------------------------------
Date: Thu, 01 Jul 1999 17:56:47 GMT
From: manitee@my-deja.com
Subject: Re: Communication between CGI and apache
Message-Id: <7lga4o$k9v$1@nnrp1.deja.com>
Well James, it seems that you take this perhaps a bit too seriously.
Many people who use perl use it to author CGI's, and thus may have had
experience with apache interaction.
I dont feel that this post is misdirected, though I do feel that your
seemingly militant responses are.
hah hahahh ah hha
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 1999 17:31:32 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Copying Lines to File
Message-Id: <7lg8lk$f26$4@fcnews.fc.hp.com>
Iain Chalmers (bigiain@mightymedia.com.au) wrote:
: In article <MPG.11e5cb2f2f43307b989ad2@news-server>,
: e-lephant@b-igpond.com (elephant) wrote:
: > rt_daemon@my-deja.com writes ..
: > >I am a novice.
: > >I would like to know how could I possibly read a file and start copying
: > >lines to another file until a certain line. Here's an example.
: > >
: > >Text, Text
: > ><!--Start-->
: > >....................
: > >....................
: > >....................
: > >....................
: > ><!--End-->
: > >More Text
: > >
: > >Copy everything between Start and End to another file.
: >
: how about:
<snip>
: while(<IN>){
: $mode=1 if /^<!--START-->/;
: $mode=0 if /^<!--END-->/;
: print OUT $_ if $mode;
: }
I'd use:
print OUT $_ if /^<!--START-->/../^<!--END-->/;
if you don't wnat the delimiting lines,
print OUT $_ if /^<!--START-->/../^<!--END-->/ && !/^<!--(START|END)-->/;
see ".." in perlop.
Andrew
------------------------------
Date: 1 Jul 1999 17:54:38 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Copying Lines to File
Message-Id: <7lga0u$qvn$1@216.39.141.200>
On Thu, 01 Jul 1999 18:42:19 +1000, bigiain@mightymedia.com.au (Iain
Chalmers) wrote:
>#!usr/perl -w
>use strict;
>my $mode=0;
>open(IN,"filename")||die $!;
>open(OUT,">newfilename")||die $!;
>while(<IN>){
> $mode=1 if /^<!--START-->/;
> $mode=0 if /^<!--END-->/;
> print OUT $_ if $mode;
>}
Along the same lines:
perl -ne 'print if /^<!--START-->/ .. /^<!--END-->/' file.in > file.out
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: Thu, 01 Jul 1999 18:55:56 GMT
From: tram@olympic.seas.ucla.edu
Subject: cryptswitch
Message-Id: <377bb91b.3483992@172.16.10.16>
I have been looking all over the web, faqs, and newsgroups, but I
can't find anything on cryptswitch. I saw on the web somewhere that
mentions you can use cryptswitch to hide your source code. I was
wondering if anybody out there can give me an example of how to use it
or point me to a web site that gives examples of its use? I also try
to look in the toke.c file from the perl distribution, but I can't
find it there either.
------------------------------
Date: 1 Jul 1999 17:41:32 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Date Bug???
Message-Id: <slrn7nna6n.e59.fl_aggie@thepentagon.com>
On Thu, 01 Jul 1999 15:30:57 GMT, fliboy@my-deja.com <fliboy@my-deja.com>, in
<7lg1jh$gk8$1@nnrp1.deja.com> wrote:
+ There is probably some simple explanation, but it eludes me!
I've seen several polite answers to this. And they say that clpm is
populated by surly people...
James - try 'man localtime'
------------------------------
Date: Thu, 1 Jul 1999 14:37:45 -0400
From: Andy Dougherty <doughera@lafayette.edu>
Subject: Re: differentiate btw big-endian machine and small-endian machine
Message-Id: <Pine.GSU.4.05.9907011436020.8269-100000@newton.phys>
On Thu, 1 Jul 1999 bennycc@pacific.net.sg wrote:
> How can i differentiate btw big and small endian machine in my
> codes?
One way is to C<use Config;> and check out $Config{byteorder}. Check out
the Config.pm man page under byteorder for more details.
Hope this helps,
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Thu, 01 Jul 1999 17:05:57 GMT
From: kloomis@it-resourcesNOSPAM.com (Ken)
Subject: Re: Forms Processing - thread started in HTML group
Message-Id: <377b9ec4.7863302@news.tiac.net>
abigail@delanet.com (Abigail) wrote:
>Ken (kloomis@it-resourcesNOSPAM.com) wrote on MMCXXVIII September
>MCMXCIII in <URL:news:3778fac7.13647775@news.tiac.net>:
>"" I have a form on a website that directs people to fill in infomation
>"" and check boxes. If all is well, the form info gets sent and a
>"" message appears that thanks them and provides further instructions.
>""
>"" I want to have it so that if a certain box is checked, the info is not
>"" set and a different web message appears that tells them that for some
>"" reason they are disqualified.
>""
>"" Can someone suggest how this would be done?
>
>
>Easy. You check which box is checked, and if a certain box is checked,
>your print the different web message. You just omit the step where you
>set the info.
>
>Did you have any Perl specific question,
Sounds like Perl to me. Am I wrong?
>Abigail
>or you like to hang out in
>different groups and ask random questions? Maybe you should ask about
>penguins in rec.furniture, they have much more humour than we have.
>
Is it worse not to know something, or to be rude and insulting?
Ken
Ken Loomis
IT Resources
Lexington, MA
www.it-resources.com
------------------------------
Date: Thu, 01 Jul 1999 17:30:12 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Forms Processing - thread started in HTML group
Message-Id: <377BA56D.2034D4AC@home.com>
Ken wrote:
>
> Sounds like Perl to me.
It sounded a lot like CGI to me. It could have been something else but
there was definitely no Perl content.
> Am I wrong?
Yes.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 01 Jul 1999 11:46:03 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Forms Processing - thread started in HTML group
Message-Id: <xkfoghwi7qc.fsf@valdemar.col.hp.com>
kloomis@it-resourcesNOSPAM.com (Ken) writes:
> abigail@delanet.com (Abigail) wrote:
> >Easy. You check which box is checked, and if a certain box is checked,
> >your print the different web message. You just omit the step where you
> >set the info.
> >
> >Did you have any Perl specific question,
>
> Sounds like Perl to me. Am I wrong?
Yep. You'd have to do the exact same steps whether you were using Perl,
ADA, C, SNOBOL, or APL. It's nothing to do with Perl, just general
control-flow issues.
> Is it worse not to know something, or to be rude and insulting?
Better than either is to realize that just because you're having trouble
doing something with Perl, that doesn't mean it's Perl's fault.
-=Eric
------------------------------
Date: 1 Jul 1999 17:38:08 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: hiring perl programmers
Message-Id: <7lg920$qvn$0@216.39.141.200>
On 30 Jun 1999 11:31:14 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
>Rather tangential to your point, but not to the grandparent
>article, standard programming problems we made the interviewee write
>extemporanously, although in any programming language they cared to use,
>often included these:
>
> 1) You have an array of non-negative integers. Move all the
> zero-valued elements to the front of that array.
My first thought was a simple sort:
@array = sort @array; # One round of Perl golf :)
Then I finished reading the instructions:
my $size = @array;
@array = grep $_, @array;
unshift @array, (0) x ($size - @array);
> 2) You have the head node of a doubly linked list and a target value.
> Delete the first node in the list whose value matches your target.
Is this cheating?
my $node = $head_node;
while (1) {
$node->delete, last if $node->value eq $target_value;
$node = $node->next;
}
Or maybe:
my $found;
my $i = 0;
for (@array) {
$found++, last if $_ eq $target_value;
$i++;
}
splice @array, $i, 1 if $found;
>Furthermore, they were told to pay especial attention to the space and
>time complexities of their algorithms. It's remarkable how many made
>it through paper and phone screening, but who completely crashed and
>burned horrendously on these simple programming problems. It was also
>a bit sad how few came up with optimal solutions.
These are actually kind of fun. Hopefully, I wasn't too sub-optimal. :)
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: Thu, 01 Jul 1999 14:01:48 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: In Mountain View did Larry Wall
Message-Id: <linberg-0107991401480001@ltl1.literacy.upenn.edu>
Brilliant! :)
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Thu, 1 Jul 1999 18:22:47 GMT
From: Darrin Edwards <d-edwards@uchicago.edu>
Subject: Re: Is perl 8-bit safe?
Message-Id: <tgr9msp6vc.fsf@noise.bsd.uchicago.edu>
Harriet Severinio <hseverin@bbn.com> writes:
> I am using perl scripts quite heavily, and we need to add support for
> European languges to our product. This means 8-bit character encoding.
>
> Has anyone tested perl 4 and perl 5 for handeling 8-bit characters?
#!/usr/local/bin/perl -w
print "a PO^EMU BY NET?\n";
print "\307\304\305\n";
For me this outputs (perl, version 5.004_04 built for aix)
a PO^EMU BY NET?
GDE
This is KOI-8 Cyrillic, by the way, but the principle should be
encoding-independent. You might need to use single quotes more
often then you otherwise would, e.g. a statement like
$foo{POKA} = "bye";
gives the error "Unrecognized character \320 at...", but
$foo{'POKA'} = "bye";
print "$foo{'POKA'}\n";
gives
bye
I find it interesting that those single quotes in the print are
needed even inside the double quotes, i.e. the double quotes alone
won't prevent perl from complaining about unrecognized chars.
You can however use these chars unquoted in a pattern match:
my $search = "dAJ pERUN BULATNYJ ME^ MNE PO RUKE";
my @found = ($search =~ m/(M..)/g);
print "found @found\n";
gives me
found ME^ MNE
Unfortunately, although "." still matches any character, you
can't expect things like "\w" and "\b" to work on these
(8th bit on) chars; I believe there are locale-specific modules
available (check CPAN) to help you if you need to do this though.
Did you have something more complex in mind than this kind of
text processing?
Cheers,
Darrin
------------------------------
Date: Thu, 01 Jul 1999 18:15:12 GMT
From: norman@cherniak.on.ca (Norman Branitsky)
Subject: listen: Operation not supported
Message-Id: <377baee3.157275402@client.news.psi.ca>
Hello!
I'm trying to run satan v1.1.1 on my UnixWare 7 box.
Starting the satan script generated the following error:
listen: Openration not supported on transport endpoint at perl/html.pl
line 132.
Here's the excerpt from that perl program around line 132:
# Set up a listener on an arbitrary port. There is no good reason to
# listen on a well-known port number.
#
sub start_html_server {
local($sockaddr, $proto, $junk);
$sockaddr = 'S n a4 x8';
($junk, $junk, $proto) = getprotobyname('tcp');
socket(SOCK, &AF_INET, &SOCK_STREAM, $proto) || die "socket: $!";
listen(SOCK, 1) || die "listen: $!";
($junk, $html_port) = unpack($sockaddr, getsockname(SOCK));
}
Any suggestions will be apreciated.
------------------------------
Date: Thu, 01 Jul 1999 17:27:25 GMT
From: Sulakshan Shetty <sulakshan.shetty@wcom.com>
Subject: Re: make my day fix an array :-)
Message-Id: <377BA53D.BC1D9A41@wcom.com>
I have some code which will help you sort on date in the same year
#!/usr/local/bin/perl -w
$date1 = "Jun 10 00:57:15";
$date2 = "Jun 10 00:55:10";
%months = ( 'Jan', 1,
'Feb' , 2,
'Mar' , 3,
'Apr' , 4,
'May' , 5,
'Jun' , 6,
'Jul' , 7,
'Aug' , 8,
'Sep' , 9,
'Oct' , 10,
'Nov' , 11,
'Dec' , 12);
($month1, $day1, $time1 ) = split(/ /, $date1);
($month2, $day2, $time2 ) = split(/ /, $date2);
if ( $months{$month1} > $months{$month2} )
{
print "[$date2] is before [$date1]\n";
}
elsif ( $months{$month1} < $months{$month2} )
{
print "[$date1] is before [$date2]\n";
}
else
{
if ( $day1 > $day2 )
{
print "[$date2] is before [$date1]\n";
}
elsif ( $day1 < $day2 )
{
print "[$date1] is before [$date2]\n";
}
else
{
if ( $time1 gt $time2 )
{
print "[$date2] is before [$date1]\n";
}
elsif ( $time1 lt $time2 )
{
print "[$date1] is before [$date2]\n";
}
else
{
print "Dates are the same\n";
}
}
}
You can use that to sort the dates.
Also if all your times are going to be on the same day you can
compare the dates directly.
And if some other script/program of yours is generating the date
in your data file, you might want to print out what "time()" in perl
returns, this is the easiest way to sort and also you could
use gmtime()/localtime() to retrieve the date from it.
Hope this helps,
:)
Sulakshan
"Mr. Dave" wrote:
>
> This is a snippet of a data file that my script will work on
>
> =casper64= Jun 10 00:45:42, dane
> =maddog= Jun 10 00:54:15, dane
> =casper64= Jun 10 00:56:12, jamesgr
>
> Any one know an efficiant way to eliminate lines that have the same
> =user= and are within one minute of each other? Keep in mind the array
> might me as large as 800 or more elements! If I sort the array (=user=
> will be in ABC order) I have a subroutine that can eliminate entries
> within a minute of each other. But I need the entries in chronological
> order....
>
> Any help would be greatly appreciated =]
> Thanx in advance!!
--
----------------------------------------------------------------------
-- sulakshan.shetty@wcom.com | --
-- Phone +719-265 0162 | Hey! It compiles! Ship it! --
-- Loc. F5-0521B | --
----------------------------------------------------------------------
------------------------------
Date: 1 Jul 1999 17:22:00 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Making things go "BEEP!"
Message-Id: <7lg83o$f26$2@fcnews.fc.hp.com>
David Efflandt (efflandt@xnet.com) wrote:
: >print chr(7);
: That works from the Linux console, but not in xterm
It works in _my_ xterm. When did yours get a beepectomy?
Andrew
------------------------------
Date: 1 Jul 1999 17:25:02 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Newbie is back!! This time knows his stuff (he thinks)
Message-Id: <7lg89e$f26$3@fcnews.fc.hp.com>
Cameron Graham (cameron_graham@clear.net.nz) wrote:
: heres the new code, disect it, tell me whats wrong, tell me ways of
: improving PLEASE! =) thanx...
Not to be rude, but comp.lang.perl.misc is a perl discussion group,
not a code review service. You'll get better responses by asking
specific questions accompanied by minimal code examples.
Andrew
------------------------------
Date: Thu, 01 Jul 1999 10:19:30 -0800
From: CapWalker <jamescwalker@csi.com>
Subject: Newbie questions
Message-Id: <930853172.25358@www.remarq.com>
Sorry to double post, but I can't find my first message...
As a total newbie I need some guidance, either to a FAQ or
if someone can reply...
1 - What programs should I get to start Perl ? I've gotten
version 5.x and the PDK from Activestate
2 - What program in the two above will create a stand alone
executable ?
3 - I'm going out tonight and buying the camel book from
O'reilly. Are there others that speak to a Windows 9x
or NT environment ?
Thanks
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Thu, 01 Jul 1999 18:56:49 GMT
From: coryalbrecht@hotmail.com (Cory C. Albrecht)
Subject: None
Message-Id: <7lgdlh$1222k_002@news.sentex.ca>
--============__930855409__==
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Hello all,
I'm trying to embed a perl interpreter in C programme by following the
various *.pod/*.html files that come with the latest ActivePerl 518 and
Gurusamy Sarathy's (sp?) 5.004_02 binary distribution for Windows. The
attached files, perl-*.cpp are each a snippet from perlembed.pod in the
various distributions, what I am using to try and just get things to
compile. Problem is, it isn't working (Duh, why else would I write
this? :-) )
My files compile to *.obj just fine, but when it comes to linking it
fails. With ActivePerl it tells me there is an undefined symbol
"unsigned int near PL_na". With 5.004_02, that undefined symbol is
called "unsigned int near Perl_na".
I have tried defining or undefining every symbol I have seen from "perl
-V" and from looking through perl source code, such as WIN32, _CONSOLE,
NO_STRICT, HAVE_DES_FCRYPT, MULTIPLICITY, EMBED, PERL_OBJECT,
PERL_CAPI, and WIN32IO_IS_STDIO, yet nothings seems to banish that one
undefined symbol. I've also tried including this *.lib and that *.dll,
again to no avail:-(
Since I use Watcom C/C++ 11.0, I had to do some changes to to the *.h
files in /perl5.00402/lib/CORE and /ActivePerl/lib/CORE, but they
essential minor changes: altering any #ifdefs with _MSC_VER in them to
respond the same to __WATCOMC__, and changing where required the
typedefed name "DIR" to "DIR_T" so it wouldn't conflict with another
structure that is typedefed "DIR" in Watcom C's <direct.h>. However,
that is all minor stuff, and nothing that should affect linkage with
the various *.lib or *.dll files.
What are these undefined symbols PL_na/Perl_na, and what needs must I
do to get them defined? Help!
P.S. It would be very helpful if I could just get a list, from somebody
who has successfully compiled perl on a Win32 platform, of all the files
that go into perl.exe, perll.dll, and so forth, as well as the defines
used while compiler. Those Makefiles are wee bit too complicated for me
to follow. Ideally, I'd like to eventually have a Watcom C project file
rather than running things through my NMAKE clone.
--============__930855409__==
Content-Type: application/x-cpp-source
Content-Disposition: attachment; filename="perl-embed.cpp"
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
int main (int argc, char **argv, char **env)
{
char *embedding[] = { "", "-e", "0" };
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 3, embedding, NULL);
perl_run(my_perl);
/** Treat $a as an integer **/
perl_eval_pv("$a = 3; $a **= 2", TRUE);
printf("a = %d\n", SvIV(perl_get_sv("a", FALSE)));
/** Treat $a as a float **/
perl_eval_pv("$a = 3.14; $a **= 2", TRUE);
printf("a = %f\n", SvNV(perl_get_sv("a", FALSE)));
/** Treat $a as a string **/
perl_eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE);
printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), na));
perl_destruct(my_perl);
perl_free(my_perl);
return (0);
}
--============__930855409__==
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
--============__930855409__==
Content-Type: application/x-cpp-source
Content-Disposition: attachment; filename="perl-activestate.cpp"
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
main (int argc, char **argv, char **env)
{
STRLEN n_a;
char *embedding[] = { "", "-e", "0" };
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 3, embedding, NULL);
perl_run(my_perl);
/** Treat $a as an integer **/
perl_eval_pv("$a = 3; $a **= 2", TRUE);
printf("a = %d\n", SvIV(perl_get_sv("a", FALSE)));
/** Treat $a as a float **/
perl_eval_pv("$a = 3.14; $a **= 2", TRUE);
printf("a = %f\n", SvNV(perl_get_sv("a", FALSE)));
/** Treat $a as a string **/
perl_eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE);
printf("a = %s\n", SvPV(perl_get_sv("a", FALSE), n_a));
perl_destruct(my_perl);
perl_free(my_perl);
}
--============__930855409__==
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
--
Cory C. Albrecht
http://www.sentex.ca/~cory/
--============__930855409__==--
------------------------------
Date: Thu, 1 Jul 1999 14:22:45 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: PCI66 / UDMA66 / Ultra66 / Linux?
Message-Id: <1du65l0.1ipkk753qlvsaN@[192.168.0.1]>
Marcel Grunauer <marcel.grunauer@lovely.net> wrote:
> On 29 Jun 1999 09:59:56 +0100, Jonathan Stowe
> <gellyfish@gellyfish.com> wrote:
>
> >Vincent Van Gough
>
> tr/u//;
$_ = "Vincent Van Gough\n";
tr/u//; print;
tr/u//d; print;
--
Kevin Reid: | Macintosh: | print$"x(sin($i++/5)*30+30),"*$/"while 1
"I'm me." | Think different.|
------------------------------
Date: Thu, 01 Jul 1999 14:28:03 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: Robot email/poster (new proposal)
Message-Id: <377BB333.20354F5E@prism.gatech.edu>
Lee wrote:
> It's mostly a Q and A group. Most of the Qs are FAQs and most of the As are
> rude. I'm glad that a solution to this is being sought, because I would
> like to see some actual discussion now and then.
>
> Now that we know what you stand against, can you tell us what you stand
> for? Do you like the group as-is? If not, do you have a suggestion that
> does not (presumably) involve bots?
>
> Lee
The bot solution would not reduce traffic, even if it works well; it
would just automate RTFM responses.
If we want to reduce the traffic, we should use.. moderation! Suppose
the moderator was a bot. It could accept all postings that contain a
line /^\s*--\s*$/, which with we would prefix our sigs. We can put the
"posting secret" in the FAQ. (The rejection notices should explain that
the posting secret is a FAQ.) Also, the bot could grab all interesting
words from the rejected post and do a keyword search on the docs to
explicitly specify which may be of interest. Other words, such as
"cgi","form", etc., could trigger the inclusion of pointers to the CGI
FAQs and tutorials. (Of course, there's already a moderated perl group.
But, this wouldn't 'really' be moderation, since discussions wouldn't be
moderated!)
And i would prefer it be called the "clpm traffic controller" (or
something) rather than a cutsey name like "miscy". :)
--
andy!
------------------------------
Date: 1 Jul 1999 17:18:59 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Robot email/poster for this group
Message-Id: <7lg7u3$np6$1@news.NERO.NET>
In article <B3A083809668F4693@204.112.166.88>, Lee <rlb@intrinsix.ca> wrote:
>In article <7lecnn$o37$1@news.NERO.NET>,
>stanley@skyking.OCE.ORST.EDU (John Stanley) wrote:
>
>>People discussing perl is what this group was created for.
>
>Maybe, but that's rarely what it's used for.
So? Let's all just blow right through those stop signs.
>It's mostly a Q and A group. Most of the Qs are FAQs and most of the As are
>rude. I'm glad that a solution to this is being sought, because I would
>like to see some actual discussion now and then.
Here's the simple solution to rude responses to questions: stop posting
rude responses. If you don't like the question, don't answer it. Simple.
Works every time it is used. If you don't like the rude response someone
else has posted, tell them to stop.
Tell me, how will a bot that emails the answer to someone stop anyone
from posting a rude response to the question, unless the question is
mailed to the bot and not posted? Answer: it won't. The only way a bot
would scratch the itch for those who think a questioner needs to be
flamed is if it flamed them, too. And then it is never as satisfying
to let someone else do it for you.
>Now that we know what you stand against, can you tell us what you stand
>for? Do you like the group as-is?
I like it better than if it were to become the input to a robot oracle.
>If not, do you have a suggestion that does not (presumably) involve bots?
Suggestion that does not involve bots: don't run a bot in the group.
------------------------------
Date: Thu, 01 Jul 1999 17:03:55 GMT
From: gqc2017@is.nyu.edu
Subject: running perl script
Message-Id: <7lg71j$iv2$1@nnrp1.deja.com>
When I try to run a perl script on Windows NT's iis server, I encounter
this error message "HTTP/1.1 500 Server Error". So how do I fix this
problem?
Thanks
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 1999 16:48:40 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: Spell Checker
Message-Id: <7lg658$t64$1@junior.statsci.com>
In article <7lddnn$hhc$1@nnrp1.deja.com>, <pyammine@my-deja.com> wrote:
>Has anybody ever seen or worked with a spell checker with Perl.
>Something that would spell check a users input before saving the data.
>
>I appreciate the help.
>
check out the Perl Power Tools project at:
http://language.perl.com/ppt/
------------------------------
Date: Fri, 02 Jul 1999 13:36:50 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: SSI exec with POST?
Message-Id: <377CF8B2.609A439@ingress.com>
jeffhsu@my-deja.com wrote:
>
> I'm having the hardest finding documentation on whether you can use the
> SSI exec with the POST method. Exec uses QUERY_STRING which is used by
> GET but is it possible to use the POST method instead and feed
> paramaters with STDIN?
>
> In short...
> Can you use the POST method with <!--#exec......>
In short, to help you answer your own question... How exactly would you
propose passing POST parameters via the SSI syntax of <!--#directive
command="action..."-->?
Also, just as an additional point, not all servers support the GET method
(QUERY_STRING) with an "exec cgi=" command. Some will argue this is
correct behavior, others (such as myself) will argue it is just fine. I
am of the opinion that the author should be in control of what is passed
in the QUERY_STRING to the SSI application. I do not, however, believe it
reasonable to try and pass POST parameters via an SSI directive, nor can I
see a reasonable means by which to accommodate such a request.
--
Ethan H. Poole **** BUSINESS ****
ehpoole@ingress.com ==Interact2Day, Inc.==
(personal) http://www.interact2day.com/
------------------------------
Date: 01 Jul 1999 11:42:55 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: text editing question????
Message-Id: <xkfr9msi7vk.fsf@valdemar.col.hp.com>
Ray McCormack <ray_mccormack@vcd.hp.com> writes:
> I have the following simple perl script. The intent was to run this on
> a bunch of web pages so that the text inside placed into the $_ variable
> would be inserted into the file right where the first <br> appears.
It wouldn't do that, even if it compiled.
> Perl does not like the line formating I have ... Is there something
> special I am supposed to do to make this work?
Quote properly?
> #!usr/bin/perl -w
That should probably be:
#!/usr/bin/perl -w
That first / is important. Kudos to you for using -w, though! Now, all
you're lacking is "use strict;"
> $^I = '.old';
I get squicked when I see this sort of thing done through variables
instead of command-line switches. Maybe you should think about using
'-i.old' on your shebang line above?
> $iterate=0;
my $iterate = 0;
or even:
my $iterate;
> while (<>) {
> if (m/<BR>/s) {
> if ($iterate) {
This tests if $iterate is non-zero. This means that the first time it
hits a "<BR>" in your data, this test will evaluate to false (since you
initialize $iterate to 0), and your data will never print.
Just as a matter of style, I've more or less gone off relying on implicit
conversions to true or false in tests. I find, personally, it's clearer
to explicitly test against the value I'm expecting, even if it's just
"true". This test I'd have written as:
if($iterate != 0)
except that that's the opposite of what you *really* want, namely:
if($iterate == 0)
> $_="<sidebar width=138 align=left>
^ You open the quote here
> <table cellpadding=0 cellspacing=0 border=0>
> <tr><TD colspan=1 ALIGN=CENTER valign=top bgcolor=#000000><br><a
> href="http://www.hp.com/go/webtvprint"><img HSPACE=0 VSPACE=0 border=0
^ and close it here. Not Good(tm).
Also, you're using double-quotes, but I can't see any variable
interpolation or even stringifying going on here. That's somewhat
misleading. I'd recommend you use single-quotes instead; that will also
let you use double-quotes in your HTML.
But why not replace this whole mess with a here-doc?
$_ = <<EOHTML;
<sidebar width=138 align=left>
..
..
..
EOHTML
looks so much simpler.
<snip HTML>
> $iterate++;
See above comments on your "if($iterate)" test. I don't think you're
doing what you think you're doing.
> }
> }
> print;
Why not add a -p switch to your shebang line, and save yourself the
trouble?
> }
-=Eric
------------------------------
Date: 1 Jul 1999 17:46:27 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <slrn7nnafv.e59.fl_aggie@thepentagon.com>
On Thu, 01 Jul 1999 09:52:13 -0400, John Nolan <nolanj00@mh.us.sbphrd.com>, in
<377B728D.8C43F0C1@mh.us.sbphrd.com> wrote:
+ 7. Alongside the new c.l.p.m. Infobot, we also can create
+ a c.l.p.m. Contempt-bot. Not to spread information, but to
+ send degrading comments to new users. (This would
+ *really* take a load off the gurus' shoulders.)
Ah, but which gives more job satisfaction, you sniveling ingrate?
+ 3. O'Reilly's latest book: "Stifling Usenet Questions:
+ How to Shame Users Into Silence and Passivity."
They really should think about publishing "How to Read the Perl
Documentation".
James
------------------------------
Date: 1 Jul 1999 18:30:17 GMT
From: revjack <revjack@radix.net>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <7lgc3p$lpo$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
I R A Aggie explains it all:
:On Thu, 01 Jul 1999 09:52:13 -0400, John Nolan <nolanj00@mh.us.sbphrd.com>, in
:<377B728D.8C43F0C1@mh.us.sbphrd.com> wrote:
:+ 3. O'Reilly's latest book: "Stifling Usenet Questions:
:+ How to Shame Users Into Silence and Passivity."
:They really should think about publishing "How to Read the Perl
:Documentation".
The tough greetings one gets here have shamed me into reading
the documentation, using -w and strict, looking up answers in
the online FAQs and testing code before posting it here. Notice
I don't post many questions here? It's not because I don't have
any perl questions - I got a million of 'em. I just know how to
find most of the answers now. It works.
------------------------------
Date: Thu, 1 Jul 1999 17:24:03 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: write and Page Size i.e. number of rows
Message-Id: <377ba259.18148035@newshost.unx.sas.com>
On 1 Jul 1999 16:15:41 +0100, db@maths.tcd.ie (David Broderick) wrote:
>Hi,
> I am trying to print a report, from a stored procedure, and then
>to turn the subsequent file into html/pdf/etc. Ho can I tell the write
>func about my page size. I would like to be able to control this as a
>command line argument to my filter program.
I hope you are using a format. If you are, try...
use English;
$FORMAT_LINES_PER_PAGE = $Number_of_Lines;
also try man perlform
Hope this helps
_
John Borwick
------------------------------
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 6193
**************************************