[9307] in Perl-Users-Digest
Perl-Users Digest, Issue: 2902 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 18 16:07:21 1998
Date: Thu, 18 Jun 98 13:00:27 -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, 18 Jun 1998 Volume: 8 Number: 2902
Today's topics:
Re: 2D arrays <tam.mcl@futureview.net>
Re: ?CGI scripts & Explorer (Larry Rosler)
Beginner <apminc@cvn.net>
Re: Beginner (Steve Linberg)
Checking for timeouts when using IO:Socket::INET (Phoenixl)
Re: exception handlng with eval <rootbeer@teleport.com>
Re: first language (Rich Morin)
How to sort alphanumeric string using "sort" function <margaret.lee@tandem.com>
Re: if (something eq "somethingfgjhf") (Stuart McDow)
Re: if (something eq "somethingfgjhf") <kenkim@gncom.com>
Re: Little help on grabbing text <rootbeer@teleport.com>
Making Life Easy - Templates, XSSI, Variables and such <geoffhudik@cyberdude.com>
Need help with substr() <pierre_porter@y2k1000.ps.compuware.com>
Re: Need help with substr() (Stuart McDow)
Net::Ftp module <allen@retina.net>
Re: Pod::Text -- Unix only? (Stuart McDow)
Re: Q: grep/map and regex recompilation (Mark-Jason Dominus)
Re: RegExp Error Under UNIX PERL Runs Under Win32 PERL <bowlin@sirius.com>
Re: REVIEW: Perl CGI Programming - No Experience Requir (Paul David Fardy)
Re: Search a file on a unix system. (Steve Linberg)
Some buggyness with P5004_66 build (Anthony Mutiso)
Re: SORTING HASHES (THE NEWBIE WAY!!) <ajohnson@gpu.srv.ualberta.ca>
Re: subject and sender using open mail <mike@newfangled.com>
Re: Using PERL to do a remote TELNET <kenkim@gncom.com>
Re: Using PERL to do a remote TELNET <kenkim@gncom.com>
Re: Using STDIN as a symbolic reference? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Jun 1998 20:14:56 +0100
From: Thomas McLaughlin <tam.mcl@futureview.net>
Subject: Re: 2D arrays
Message-Id: <35896730.8EB788D1@futureview.net>
Mike Stok wrote:
> In article <01bd9a8f$58d1fec0$26c809c0@internet>,
> Thomas Mclaughlin <it.sllas@btinternet.com> wrote:
> >I have been looking thru the "Learning Perl" book on arrays but cannot find
> >2D arrays. I am a perl newbie and want to use a 2D array like in C (it has
> >been a few
> >years since I wrote any C code and now write shell scripts). I want to
> >write a perl
> >prog to calculate the size of an Informix database table from the following
> >format:
>
> You probably want to look at the perllol (lists of lists) and perldsc
> (data structures cookbook) man pages which come with recent perl
> distributions. You can use the perldoc command to view them:
>
> perldoc perllol
>
> If there's anything which you want to know which isn't covered in tho
> supplied documentation (including the frequently asked questions and their
> answers - perlfaq) then you might post a question asking about it.
>
> If you don't have the docs on line then you might look at
> http://www.perl.com/CPAN-local/doc/manual/html/pod/index.html (which may
> be a little old, but should tide you over until you can find more recent
> versions.)
>
> Remember that you can play with the debugger to get an idea of what's
> going on, you can start the debugger using the command line
>
> perl -de 1
>
> DB<1> $struct{'Absent Lovers'}[0][3] = 'Thela Hun Ginjeet'
>
> DB<2> $struct{'Absent Lovers'}[0][8] = 'Three Of A Perfect Pair'
>
> DB<3> $struct{'Absent Lovers'}[2][1] = 'Sartori In Tangier'
>
> DB<4> X struct
> %struct = (
> 'Absent Lovers' => ARRAY(0x14019fb08)
> 0 ARRAY(0x14019fb38)
> 0 undef
> 1 undef
> 2 undef
> 3 'Thela Hun Ginjeet'
> 4 undef
> 5 undef
> 6 undef
> 7 undef
> 8 'Three Of A Perfect Pair'
> 1 undef
> 2 ARRAY(0x14019bd68)
> 0 undef
> 1 'Sartori In Tangier'
> )
>
> Hope this helps,
>
> Mike
>
>
Thanks a lot. I've had trouble installing the perl man pages on SCO
OpenServer.Despite reading how to do this in several pages it is not working yet -
something strange is
going on that I still have to suss out. I will use perldoc. Now that I know it can
be done in
perl I will continue my learning t a fast pace rather than trying to find some
other means to
do it. This script may be a bit too ambitious for me but I will not do any harm
and will
certainly help me learn.
------------------------------
Date: Thu, 18 Jun 1998 12:27:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: ?CGI scripts & Explorer
Message-Id: <MPG.ff309e9be35cabc98969a@nntp.hpl.hp.com>
In article <358952ED.6CD8CB72@inlink.com>, perlguy@inlink.com says...
> Actually there was NOTHING wrong with MY script that I was referring
> to. I DID contact Microsoft and their response was:
>
> "We have no interest in fixing it because it is in an old version of the
> browser." (Version 3.02 & 3.03)
At least you got a response. When I complained about a standards
violation in the poor-excuse-for-a-browser that comes bundled with
FrontPage, I never even got an acknowledgment. (It was the same problem
that I mentioned in the previous post, which Netscape fixed. Because I
approached them through HP's VIP-customer channel. Technical details are
off-topic here.)
> If I have to deal with dumbshit reasoning like that, I'd rather lose the
> poor souls running Internet Exploder than have to jump through hoops to
> get Microsofts software to work.
>
> BUT, since I run a mixed browser extranet, and not all users could run
> IE 4 (which worked), I did come up with a fix to the problem.
I also papered over a bug in MSIE 3, because I couldn't insist they
upgrade to MSIE 4. Essentially our CGI code has to be tested on a
variety of clients (as well as, in my case, hosts -- HPUX and NT), which
is a great pain.
> Yes it WAS a problem with the browser and NO I don't see why *I* should
> have to come up with creative solutions to program around Microsoft's
> bugs, but the people who sign my paycheck wanted it done.
This is my point. I was willing to tell my customers who used the
FrontPage browser to use a real one, but I could hardly tell them to use
Netscape instead of M$ Explorer. Yet that's what the glib responses here
tried to do.
> ...
> Thanks for the lively conversation today!
>
> Brent
Glad to keep you amused. :-)
I hope posters are getting the idea -- that real life now involves n * m
client-host combinations. Standard protocols and quasi-portable
languages such as Perl help a lot. "Use Unix" and "Use Netscape" don't
help at all.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 18 Jun 1998 14:56:47 -0400
From: Chris Miller <apminc@cvn.net>
Subject: Beginner
Message-Id: <358962EF.DB81ABA0@cvn.net>
I'm in the process of trying to teach myself Perl. If anyone has any
suggestions on where to start such as literature, etc. I'd appreciate
it.
thanks,
Chris Miller
------------------------------
Date: Thu, 18 Jun 1998 15:59:38 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Beginner
Message-Id: <linberg-1806981559380001@projdirc.literacy.upenn.edu>
In article <358962EF.DB81ABA0@cvn.net>, Chris Miller <apminc@cvn.net> wrote:
> I'm in the process of trying to teach myself Perl. If anyone has any
> suggestions on where to start such as literature, etc. I'd appreciate
> it.
>
> thanks,
> Chris Miller
http://www.perl.com
your local bookstore
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 18 Jun 1998 19:46:08 GMT
From: phoenixl@aol.com (Phoenixl)
Subject: Checking for timeouts when using IO:Socket::INET
Message-Id: <1998061819460800.PAA26082@ladder03.news.aol.com>
I've got this example working with no problem, but I'm not sure what code need
to add to
see if there was a timeout while reading. Can someone give me a suggestion?
Thanks very much.
--------------------------------------------------------------------------
-----------------------------------------
use IO::Socket;
$socket = IO::Socket::INET->new(PeerAddr => 'www.aol.com',
PeerPort => 'http(80)',
Proto => 'tcp',
Timeout => 120);
if( ! defined $socket)
{
print "Bad address\n";
exit;
}
# set for no buffering
$old_fn = select($socket);
$| = 1;
select($old_fn);
# turn off character mapping
binmode($socket);
print $socket "GET / HTTP/1.0\n\n";
while(<$socket>)
{
print $_;
}
------------------------------
Date: Thu, 18 Jun 1998 19:18:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: exception handlng with eval
Message-Id: <Pine.GSO.3.96.980618121818.13348d-100000@user2.teleport.com>
On Thu, 18 Jun 1998, Bing Ran wrote:
> Why does the following code not work?
It worked for me. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 18 Jun 1998 12:06:16 -0700
From: rdm@cfcl.com (Rich Morin)
Subject: Re: first language
Message-Id: <rdm-1806981206170001@140.174.42.30>
In article <6mbktf$5qp$1@msunews.cl.msu.edu>, Dan Nguyen
<nguyend7@egr.msu.edu> wrote:
> Ada (??): something the DoD made up
Actually, Ada is a very interesting case study. The DoD had a very real
need to fill:
a language suitable for building mission-critical embedded systems. They
also had a
plethora of one-off languages which had been written for individual
projects. They
thought that by designing a single language, by committee and review, they
could get
a language that met all of their needs. Some very smart people were
involved in this
effort; don't take their effort lightly!
I don't work in the military arena, so I don't know whether Ada is meeting
the needs
of its intended audience. I do believe, however, that the "combinatorial
complexity"
of Ada makes it a difficult language to learn, maintain, support, etc.
And, because
most of us do not write "mission-critical embedded systems", we aren't
willing to
work that hard. Hence, Ada remains a "curiosity", rather than a popular
language.
-r
--
Canta Forda Computer Laboratory | Prime Time Freeware - quality
UNIX consulting, training, & writing | freeware at affordable prices
+1 415-873-7841 | +1 408-433-9662 -0727 (Fax)
Rich Morin, rdm@cfcl.com | www.ptf.com, info@ptf.com
------------------------------
Date: Thu, 18 Jun 1998 19:00:35 GMT
From: Margaret Lee <margaret.lee@tandem.com>
Subject: How to sort alphanumeric string using "sort" function
Message-Id: <35896405.62761A69@tandem.com>
Hi,
In my program I have alphanumeric strings hash keys like the
following:
abc1d2, abc11d2, abc2d2, abc2e, def<0>, def<11>, def<1> def<2>
I would like to retrieve the keys in the following order:
abc1d2, abc2d2, abc11d2, abc2e, def<0>, def<1>, def<2>, def<11>
I have been using the following format and has been unsuccessful in
generating the appropriate MY_SORT function to give the above
result.
foreach $name (sort MY_SORT keys %list)
{ ... }
The sorted list that my MY_SORT generated thus far is
abc1d2, abc11d2, abc2d2, abc2de, def<0>, def<11>, def<1> , def<2>
which is not quite what I want.
If you have any suggestion as to what MY_SORT should be, please
let me know. Any suggestions will be greatly appreciated.
Please reply back to my email address at mlee@loc3.tandem.com
Thanks in advance,
Margaret Lee
------------------------------
Date: 18 Jun 1998 19:21:04 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: if (something eq "somethingfgjhf")
Message-Id: <6mbpb0$i7u$1@ns1.arlut.utexas.edu>
Brian Charles <brian.charles@orst.edu> writes:
>
> I need the following statement to be true as long as the first 9
> characters are the same. I don't care about what follows the 9
> characters.
>
> if (something eq "somethingetdsfg.....................")
perldoc -f substr
if(substr($something, 0, 9) eq substr($someotherthing, 0, 9)) {
}
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Thu, 18 Jun 1998 15:48:07 -0400
From: "Kenneth" <kenkim@gncom.com>
Subject: Re: if (something eq "somethingfgjhf")
Message-Id: <6mbr4p$s8t$2@demon.uunet.ca>
You may want to try something along the lines of:
$something = "somethingfgjhf";
$match = "something";
if ($something =~ /$match/i)
{
do.........
}
else
print "Sorry.. This does not qualify\n";
exit;
}
Gorkem Yuksel
SysAdmin
GlobeNet Communications
WWW: http://www.gncom.com
EMAIL: gorkem@gncom.com
Brian Charles wrote in message <3589630B.469C767C@orst.edu>...
>Hi,
>Is it possible to only test the first 8 characters/digits to see if a
>statement is true?
>
>I need the following statement to be true as long as the first 9
>characters are the same. I don't care about what follows the 9
>characters.
>
>if (something eq "somethingetdsfg.....................")
>
>then....
>
>
>Thanks
>Brian
>
------------------------------
Date: Thu, 18 Jun 1998 19:12:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Little help on grabbing text
Message-Id: <Pine.GSO.3.96.980618120924.13348a-100000@user2.teleport.com>
On Thu, 18 Jun 1998, Michael S. Brito, Jr. wrote:
> read(STDIN,$buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
>
> foreach $pair (@pairs) {
> ($name,$value) = split(/=/,$pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $value =~ s/~!/ ~!/g;
> $FORM{$name} = $value;
> }
If you're going to do this yourself, rather than using a module, be sure
that you do it right. (You're not doing it right. :-)
> open(OUTF,">>email.txt");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> $indata = <INF>;
Were you complaining that you were only getting one line here? Maybe you
want to change that line.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 18 Jun 1998 15:45:13 -0400
From: "Geoff Hudik" <geoffhudik@cyberdude.com>
Subject: Making Life Easy - Templates, XSSI, Variables and such
Message-Id: <6mbqn8$stf@sjx-ixn11.ix.netcom.com>
I'm considering ways to make updating my site easier (before it gets too
big). I'm thinking that I can use Perl and/or XSSI to do this. Say, for
example, that I want to change colors on my site, but I don't want to go
through and edit every individual web page. I could do the following:
<!--#set var="color" value="#99CCCC" -->
<td width="26%" bgcolor="<!--#echo var='color' -->">
but that only works on one page. Is there a way to use some sort of
"global" variable so I can change the color variable once and it will change
every color attribute on my site? I thought I'd be clever and use a SSI to
include a file full of nothing but variables, but this did not work.
I'm basically just looking for ways to make updating my site easier. The
color problem is just one example. I'd like to use a template, variables,
Perl, whatever... so that I will have to change a value once, and only once.
Is there any way to do this?
Thanks for your time,
Geoff Hudik
geoff@cyber-edge.net
www.cyber-edge.net
------------------------------
Date: Thu, 18 Jun 1998 13:50:55 -0500
From: Pierre Porter <pierre_porter@y2k1000.ps.compuware.com>
Subject: Need help with substr()
Message-Id: <3589618F.33052659@y2k1000.ps.compuware.com>
Fellow Perl users,
Greetings.
The program below was designed to extract a column of
numbers found between two "|" characters. It works
fine in Perl for DOS version 4.0, Revision 4.0.1.8 2/5/93 Patch level 36
and Perl for NT version 4.0, Revision 4.0.1.8 Patch level 36.
# col1.pl
$ln=0;
while (<>){
chop;
if(substr($_,7,1) eq '|'){
print substr($_,11,8), "\n";
$ln++;
}
}
print "Number of lines=$ln\n";
However for the Win32 version 5.003_07 Build 313, it runs but
I get the following warning:
Use of uninitialized value at col1.pl line 6, <> chunk 111.
substr outside of string at col1.pl line 6, <> chunk 123.
Can anyone shed some light on this?
Thanks in advance.
-Pierre Porter
--
Mr. Porter does not speak
for Compuware Corporation
or any of its affiliates
------------------------------
Date: 18 Jun 1998 19:23:56 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Need help with substr()
Message-Id: <6mbpgc$ioq$1@ns1.arlut.utexas.edu>
Pierre Porter <pierre_porter@y2k1000.ps.compuware.com> writes:
>
> The program below was designed to extract a column of numbers found
> between two "|" characters. It works fine in Perl for DOS version
> 4.0, Revision 4.0.1.8 2/5/93 Patch level 36 and Perl for NT version
> 4.0, Revision 4.0.1.8 Patch level 36.
The split() function is ideal for this application. I believe you'll
find it much easier to work with than using substr().
Also, if at all possible, it would be good to upgrade to the lastest
version of perl. Currently that is 5.004_04
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Thu, 18 Jun 1998 12:22:53 -0700
From: Wirehead <allen@retina.net>
Subject: Net::Ftp module
Message-Id: <3589690D.5846A852@retina.net>
I had been looking around for examples of an ftp client until someone
mentioned something about the Net::Ftp module. I hear theres an example
in the modules book within the perl kit. Unfortunately, I don't have
the money at this time to get the kit. Are there any examples or info
around concerning this module? I'm sure its very simple to implement.
Thank you,
Allen
------------------------------
Date: 18 Jun 1998 19:12:11 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Pod::Text -- Unix only?
Message-Id: <6mboqb$gkr$1@ns1.arlut.utexas.edu>
pehanna@my-dejanews.com writes:
>
> then why bother to use readdir instead of `ls`?
Performance, mostly.
use Benchmark;
timethese(10000, {
'ls' => 'undef(@d) ; chomp(@d = `ls -a`)',
'readdir' => 'undef(@d) ; opendir(D, ".") ; @d=readdir(D) ; closedir(D)',
});
Benchmark: timing 10000 iterations of ls, readdir...
ls: 238 secs ( 4.94 usr 19.11 sys + 27.28 cusr 74.60 csys = 125.93 cpu)
readdir: 33 secs ( 1.64 usr 1.55 sys = 3.19 cpu)
If it wasn't for the large time disparity, I'd probably use ls all the
time. In fact, a long time ago, I did use ls exclusively, but that was
False Laziness.
> Many Perl scripts need to operate in both Unix and Windows NT environments --
> *most* Fortune 500 companies use both. This is hardly an off-the-wall
> situation. It is also one of Perl's great strengths that it can do this.
Agreed, for the most part. But let's never forget that the toolkit
approach to solving problems is usually the best way to
proceed. Having to sacrific the toolkit paradigm for the sake of
portability is a PITA at best and counterproductive at worst,
IMO. Reinventing the wheel (especially for things like stty) should
never be necessary.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 18 Jun 1998 15:07:06 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Q: grep/map and regex recompilation
Message-Id: <6mbogq$bs6$1@monet.op.net>
Keywords: burnish Doug horizontal Paz
In article <6mafvi$etn$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>Looks like it was always there. Why do you ask?
Because the camel book doesn't mention it. It does mention /o,
however, but /o is not very useful if this optimization is being done,
since most f the problem that /o is supposed to solve has already been
solved better by the optimization.
------------------------------
Date: Thu, 18 Jun 1998 12:14:05 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: John Kane <jdkane@akanewmedia.com>
Subject: Re: RegExp Error Under UNIX PERL Runs Under Win32 PERL
Message-Id: <358966FD.F08E9B8@sirius.com>
John Kane wrote:
>
> I have created an attribute-parsing function (which I have included below
> for
> reference purposes). It is meant to parse HTML tag attributes. It compiles
> under my Win32 version of PERL, but not under the UNIX version. The
> following error message is produced on the UNIX machine...
>
> # perl cgi-bin/test/aka-parser.cgi
> /(\w+\s*=\s*"(?:.*?(?:"{2})*)*")/: regexp *+ operand could be empty at
> cgi-bin/test/aka-parser.cgi line 133.
I think that there may be other problems with your code, but this fixes the
error you were getting.
my @attribs = m/(\w+\s*=\s*"(?:[^"]|"")*")/g;
-- Jim Bowlin
------------------------------
Date: 18 Jun 1998 18:53:19 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <6mbnmv$6r8$1@coranto.ucs.mun.ca>
c.c.eiftj@54.usenet.us.com (Rahul Dhesi) writes:
>>Here it is, your definition, which was
>>already 100 percent inferrable from the above information:
In <pudge-1706980805290001@dynamic464.ply.adelphia.net>
Chris Nandor <pudge@pobox.com> writes:
>> an array is a variable. a list is not.
>I will buy that, if everybody else will agree with you.
>My next question is: If the only difference between the two is that one
>is in a single variable, and the other is explicitly enumerated, why are
>we making such a a big deal of this difference? We don't make a big
>deal of the fact that the interger held in $i is differnt from the
>integer explicitly denoted by 15. If the ONLY difference between two
>things is that one is in a variable and the other is not, that's hardly
>a difference worth arguing about.
I make a big deal of the fact the $i is different from 15, but that
difference is obvious. If you were to dispute the difference, I'm
sure you'd see people make a big deal about it.
Paul Fardy
--
Paul David Fardy | pdf@morgan.ucs.mun.ca
Computing and Communications | pdf@InfoNET.st-johns.nf.ca
Memorial University of Newfoundland |
St. John's, NF A1C 5S7 |
------------------------------
Date: Thu, 18 Jun 1998 15:57:44 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Search a file on a unix system.
Message-Id: <linberg-1806981557440001@projdirc.literacy.upenn.edu>
In article <358904B0.11B5@hotmail.com>, stijf@hotmail.com wrote:
> Hi Everyone!
>
> I'm sorry that this isn't the correct newsgroup to post this message.
> But on the other newsgroups I've had no response.
c.l.p.m people: if you answer questions like this in here, there will be
more and more people with this attitude who figure it's OK post irrelevant
questions as long as they begin with "I'm sorry." * Don't answer them. *
At best, politely redirect them to the proper source.
It's like someone knocking on our door and saying "I'm sorry, but I was
looking for a trash can and couldn't find one, so can I just leave my
garbage in your living room?" And we say "OK, I'll take it!" instead of
telling them where they might find a trash can.
It could be argued that our house is already known as the town dump.
Can't wait to move to c.l.p.moderated.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 18 Jun 1998 19:00:14 GMT
From: amutiso@hughes.cg.hac.com (Anthony Mutiso)
Subject: Some buggyness with P5004_66 build
Message-Id: <AMUTISO.98Jun18130014@hughes.hughes.cg.hac.com>
I was trying to build 5004_66 on an IRIX 5.3 SGI box using the native
C compile. All modules build with the exception of ext/Socket.
I get the following error:
-------
Making Socket (dynamic)
cc -c -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 4000 -I/usr/local/include -DLANGUAGE_C -O -DVERSION=\"1.6\" -DXS_VERSION=\"1.6\" -KPIC -I../.. Socket.c
cfe: Error: Socket.xs, line 799: Type int of this argument is incompatible with type SV * of function prototype description (3.3.16.1)
Perl_stack_base [ax + (0)] = Perl_sv_2mortal (Perl_newSVpvn (addr.sun_path, e - addr.sun_path));
-------------------------------------------------------------^
*** Error code 1 (bu21)
-------
It would appear that the prototype for the function newSVpvn is not
being defined. I briefly tried to decrypt the embed.h <-> proto.h
relationship and quickly got lost. To get past the error I added the
line "SV *newSVpvn _((char *s, STRLEN len));" explicitly in the
Socket.c file and got past this compile error.
I am yet to try compiling with gcc to see if the problem persists.
Comments are appreciated.
Thanks
Anthony
--
Anthony Mutiso internet: amutiso@hughes.cg.hac.com
Tel: 403-295-6664 Raytheon Systems Canada, Information Technology Center
Fax: 403-295-6676 6715 - 8 Street, N.E. Calgary, Alberta T2E 7H7
------------------------------
Date: Thu, 18 Jun 1998 14:21:48 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: SORTING HASHES (THE NEWBIE WAY!!)
Message-Id: <358968CC.731A3D4E@gpu.srv.ualberta.ca>
Stephan Carydakis wrote:
!
! Hello All,
!
! I know I say this on every post I make, but please excuse my
! ignorance as I am a newbie Perl hacker(who is a full time
! musician).
*Warning*
The following reply contains references to the perl FAQs.
Reading and Searching the FAQs can cause serious reductions
in current ignorance levels while leading to increases in
productivity --- continue at your own risk!
! My Question(s):
! Can one sort a HASH on the Values??
! Or is there a method to do this somehow??
[danger:ajohnson:~]$ faqgrep sort
perlfaq4.pod:=head2 How do I sort an array by (anything)?
perlfaq4.pod:=head2 How do I sort a hash (optionally by value instead of key)?
perlfaq4.pod:=head2 How can I always keep my hash sorted?
I think your answer lies in 'perldoc perlfaq4'.
regards
andrew
------------------------------
Date: Thu, 18 Jun 1998 14:58:20 -0400
From: "Michael S. Brito, Jr." <mike@newfangled.com>
To: Claudio Villa Santa <claudio@crpweb.com>
Subject: Re: subject and sender using open mail
Message-Id: <35896340.4C89F27D@newfangled.com>
Heheheh, I'm a litle more giving then your other respondents. I'll tell you
but you have to promise to look it up later!!!!! The best way to learn is with
the docs, your own wit AND a little help ;) Here is the code for sending a
whole message:
-------------------------- START -------------------------------
#!/usr/bin/perl
$mailprog = '/usr/sbin/sendmail';
$recipient = 'me@me.com';
open (MAIL, "|$mailprog $recipient") || die "Cant open $mailprog!\n";
print MAIL "From: mike\@newfangled.com\n";
print MAIL "Reply-to: mike\@newfangled.com\n";
print MAIL "Subject: Form Data\n\n";
print MAIL "Hello\n";
close(MAIL);
---------------------- END -------------------------------
Hope it helps.......
Claudio Villa Santa wrote:
> Somebody can tell me what I'll can specify subject and sender using the the
> command
>
> open (mail, "pippo@ppp.com")
>
> Thanks
>
> Claudio V.S.
-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.
mike@newfangled.com
"Why exclude the last 21 bytes you ask? 'Cause its my
favorite number and PRISON ain't no vacation!!!" -me
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------
------------------------------
Date: Thu, 18 Jun 1998 15:40:59 -0400
From: "Kenneth" <kenkim@gncom.com>
Subject: Re: Using PERL to do a remote TELNET
Message-Id: <6mbqn4$s6r$1@demon.uunet.ca>
Im not sure what you mean bye getting a module.. how would I add a module
and where do I get it from?
Tom Phoenix wrote in message ...
>On Thu, 18 Jun 1998, Kenneth wrote:
>
>> open (TEL,"|telnet somesite.com");
>
>You may want a module like Net::Telnet instead. Hope this helps!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Thu, 18 Jun 1998 15:40:59 -0400
From: "Kenneth" <kenkim@gncom.com>
Subject: Re: Using PERL to do a remote TELNET
Message-Id: <6mbr4d$s8t$1@demon.uunet.ca>
Im not sure what you mean bye getting a module.. how would I add a module
and where do I get it from?
Tom Phoenix wrote in message ...
>On Thu, 18 Jun 1998, Kenneth wrote:
>
>> open (TEL,"|telnet somesite.com");
>
>You may want a module like Net::Telnet instead. Hope this helps!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Thu, 18 Jun 1998 19:08:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Using STDIN as a symbolic reference?
Message-Id: <Pine.GSO.3.96.980618120452.13348Z-100000@user2.teleport.com>
On Thu, 18 Jun 1998, Cornelius Griffin wrote:
> Subject: Using STDIN as a symbolic reference?
Are you sure you want symbolic references? Perhaps you should be using
true references instead.
> I am trying to read in a string from STDIN, then use that string as
> a symbolic reference. For Example:
>
> $i = <STDIN>;
> $$i = "help";
Okay, so if you enter "fred" and a newline at the keyboard (or whatever),
you've just set a variable with that five-character name. Note that that
name is not syntactically valid for a normal variable name, of course.
Does that show you what's happening? Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 2902
**************************************