[7036] in Perl-Users-Digest
Perl-Users Digest, Issue: 661 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 25 11:17:29 1997
Date: Wed, 25 Jun 97 08:00:29 -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 Wed, 25 Jun 1997 Volume: 8 Number: 661
Today's topics:
Calling Oracle Stored Procedure from Perl using DBD/DBI <mshannon@lds.com>
Re: char to hex conversion (Bob Wilkinson)
Re: Checking a string for "@' and "." <flg@vhojd.skovde.se>
Re: Checking a string for "@' and "." <rootbeer@teleport.com>
Re: closing files <rootbeer@teleport.com>
Re: Extract string from a string (Jean-Damien Durand)
Re: get end of string (easy question) <sheiness@no.pink.meat.austin.ibm.com>
Re: Grade my first Perl Project <sfairey@adc.metrica.co.uk>
Re: How do I read password when using basic authenticat <rootbeer@teleport.com>
more on remote objects <gcancio@mail.cern.ch>
Re: more on remote objects <rootbeer@teleport.com>
Re: more on remote objects (Nathan V. Patwardhan)
Re: Need a script that checks SUID = ROOT <sheiness@no.pink.meat.austin.ibm.com>
Re: passing sort subroutines? (Andrew M. Langmead)
Re: perl script on WinNT (Andrew M. Langmead)
Re: PERL/CGI Database <cliff@tricon.net>
Problem with defunct childs when forking. <qraoswa@255.255.255.147>
promote array with tie() <bri@mojo.calyx.net>
Re: Q: MacPerl, MacHTTP and CGI <rootbeer@teleport.com>
Re: question about sorting a hash inbetween two delimet <sheiness@no.pink.meat.austin.ibm.com>
Re: Remove duplicate values from array (Jean-Damien Durand)
Re: removing trailing whitespace (Tung-chiang Yang)
Re: removing trailing whitespace <jefpin@bergen.org>
Re: Retreive html document by PERL (Jean-Damien Durand)
Re: RFC: Xlib.pm (Tuomas J. Lukka)
Re: RFC: Xlib.pm (Brian Wheeler)
Re: Splitting large file (50MB+)? (Icarus Sparry)
Re: Unsupported socket function <shahkau@library1.cpmc.columbia.edu>
Re: Unwanted Output from script need help!! <rootbeer@teleport.com>
Re: What does "UNIX" stand for.. <krecik@lri.fr>
What does <<END do? (Wade Williams)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Jun 1997 10:11:42 -0400
From: Michael Shannon <mshannon@lds.com>
Subject: Calling Oracle Stored Procedure from Perl using DBD/DBI
Message-Id: <33B1271E.25A6@lds.com>
Hi,
Can anyone give an example of calling an Oracle stored procedure that
returns data, from Perl.
Thanks...mike
------------------------------
Date: Wed, 25 Jun 1997 14:12:47 +0100
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: char to hex conversion
Message-Id: <b.wilkinson-2506971412470001@ip57-york.pindar.co.uk>
In article <ECALC8.6Ku@falcon.daytonoh.ncr.com>,
Dennis.Kowalski@DaytonOH.NCR.com (kowald) wrote:
> Can anyone tell me how to convert a character to it's hex
> representation ??
>
> For example
>
> a = 61
> A = 41
>
> I have tried the following ways
>
> $x="a";
> $y = hex($x);
>
> $y gets decimal 10;
>
> I have also tried
>
> printf "%x", $x;
>
> and it prints 0
>
> Thank You
Hello,
printf "%lx", ord("A") prints 41
printf "%lx", ord("a") prints 61
Bob
--
Do what thou wilt shall be the whole of the law.
------------------------------
Date: 25 Jun 97 08:07:22 GMT
From: "Fredrik Lindberg" <flg@vhojd.skovde.se>
Subject: Re: Checking a string for "@' and "."
Message-Id: <01bc813e$cf72e460$e20f10c2@odens.di.vhojd.skovde.se>
Scott Blanksteen <sibsib@hotmail.com> wrote in article
> Dean Hollister wrote:
> Dean> Can anyone point me to the required code to check whether or not a
> Dean> string has BOTH the "@" and "." characters in it?
>
Scott> if ( index($string, '@') + index($string, '.') > -2 ) {
Scott> # you didn't set the '$[' variable, did you?
Scott> print "Got both!\n";
Scott> }
Scott>
Scott> Sure, you could use a regex, but why bother. ?
Well maybe not, but use of && instead of adding the
results together can actually be a bit faster.
I e: if (index($string,'@') > -1 && index($string, '.') > -1)
will be almost twice as fast _if_ @ isnt found, since the
right side wont be evaluated.
To fully take advantage of this you would have to look
for the missing character first ;-)
Anyway, I could only think of one way of finding both
character with one expression:
(($string =~ tr/.@/.@/) > 0)
Now in some tests I did (scanning a 500k string) I got
these results:
Testing with two regexp: 1s (no match)
Testing with two index: 1s (no match)
Testing with two tr: 2s (no match)
Testing with two regexp: 4s (match)
Testing with two index: 2s (match)
Testing with two tr: 2s (match)
To be fair, this wasnt a fair test though. The . and @ was
placed last in the string and I guess that its more likely
to found them anywhere but last most of the time, in which
case both regexp and index would be a lot faster. For example
when I placed them somewhere around the 10,000 pos it took
regex and index less then a second to find them in my test..
considering the speed its probably not an issue though. In this
case I would go for the most readable approach, whatever that
might be..
/Fredrik
------------------------------
Date: Wed, 25 Jun 1997 07:06:58 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Fredrik Lindberg <flg@vhojd.skovde.se>
Subject: Re: Checking a string for "@' and "."
Message-Id: <Pine.GSO.3.96.970625070526.15150I-100000@kelly.teleport.com>
On 25 Jun 1997, Fredrik Lindberg wrote:
> Anyway, I could only think of one way of finding both
> character with one expression:
>
> (($string =~ tr/.@/.@/) > 0)
That will produce a false positive on a string with more than one dot and
no @-sign, among other cases. Oops!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Jun 1997 06:51:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Steve Carroll <smc@mti.sgi.com>
Subject: Re: closing files
Message-Id: <Pine.GSO.3.96.970625064841.15150D-100000@kelly.teleport.com>
On Tue, 24 Jun 1997, Steve Carroll wrote:
Newsgroups: comp.lang.perl
If your news administrator still carries comp.lang.perl, please encourage
him or her to check out the frequent posting about bogus newsgroup names
in news.announce.newgroups. You'll be doing yourself and many others a
favor to use comp.lang.perl.misc (and other valid Perl newsgroups)
instead.
news:news.announce.newgroups
> I am writing a perl5 script that makes calls to a perl
> module that I did not write / cannot modify.
> My script makes repeated call to the module with a filename
> as an argument. Unfortunately, that module never closes the files
> so after about the 30th call to it, UNIX says that I have too many open
> files. I need a way to work around this and close the pesky files.
>
> Any ideas?
Make a copy of the module, and modify that. :-)
Or, contact its author and ask him or her to either close the files or to
return a filehandle, so you can conveniently close the files.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Jun 1997 11:25:05 GMT
From: ddurand@hpplus16.cern.ch (Jean-Damien Durand)
To: Aldoliu Chan <chiyung@b1.hkstar.com>
Subject: Re: Extract string from a string
Message-Id: <ECBx1t.LvE@news.cern.ch>
> Hi,
> How can i extract the string 'http://www.intel.com/' from string
> @STRING = "<HTML> <A HREF="http://www.intel.com/"> </HTML>"
Parsing href's can be a difficult task (in this case I would recommend the
HTML::Parser module). If you always believe your string will be like this, then
you can do:
$string =~ /HREF="?([^ >"]*)"?/i ;
print "\$match = $1\n" ;
Here I suppose you do not want the " characters, and I take all characters after the HREF= sentence.
This will be buggy in many case, so please have a look to HTML::Parser.
Cheers, Jean-Damien.
--
*******************************************************
* Jean-Damien Durand *
* e-mail: Jean-Damien.Durand@cern.ch *
* www : http://wwwcn1.cern.ch/~ddurand/ *
*******************************************************
--
*******************************************************
* Jean-Damien Durand *
* e-mail: Jean-Damien.Durand@cern.ch *
* www : http://wwwcn1.cern.ch/~ddurand/ *
------------------------------
Date: 23 Jun 1997 18:40:18 GMT
From: Frank Sheiness <sheiness@no.pink.meat.austin.ibm.com>
Subject: Re: get end of string (easy question)
Message-Id: <5omfui$1v6g$1@ausnews.austin.ibm.com>
Cathy Huang <cathyh@cs.berkeley.edu> wrote:
> Say
> $IMAGE = http://www.women.com/guide/guide/gifs/nav.7.gif
you should to put the url in quotes
> This is wrong:
> ---------------------
> if ($IMAGE =~ /\/(.*?)$/i)
> {
> $END = $+;
> }
> -----------------------
> $END = /www.women.com/guide/guide/gifs/nav.7.gif
> ------------------------
> How can I get $END = nav.7.gif? I just want to get the string between
> the last / and the end of the line.
$END = substr ($IMAGE, rindex($IMAGE, '/') + 1);
we don't need no steenkin regex!
--
i speak for myself therefore i am myself. or something.
this usenet article is powered by vim!
- archon@unix.bigots.org -
------------------------------
Date: Wed, 25 Jun 1997 11:25:08 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
Subject: Re: Grade my first Perl Project
Message-Id: <33B0F204.FF6@adc.metrica.co.uk>
Simon Fairey wrote (while suffering from delusions of grandeur):
>
> SNIP <
>
> Simon
> BTW: comp.lang.perl no longer exists.
Then like a womble I forget to check my return newsgroups and cross-post
to it.....*sigh*
Simon 'I still have alot to learn' Fairey
------------------------------
Date: Wed, 25 Jun 1997 07:02:52 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Gangadhar <gangadhar_vaddepalli@dbna.com>
Subject: Re: How do I read password when using basic authentication?
Message-Id: <Pine.GSO.3.96.970625070157.15150G-100000@kelly.teleport.com>
On Mon, 23 Jun 1997, Gangadhar wrote:
> Can any body out there know how to read the password entered in the
> dialog box when using HTACCESS basic authentication?
>
> I am using Apache web server.
You should see your server's docs; this is a server question, not a Perl
question. If you can't find the answer in the docs, find a server
newsgroup; their FAQ should have it. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 25 Jun 1997 13:36:47 GMT
From: German Cancio Melia <gcancio@mail.cern.ch>
Subject: more on remote objects
Message-Id: <Pine.GSO.3.95a.970625152748.27450A-100000@asis-w3>
Following with my question, you may expand it even more:
Has nobody ever tried to communicate with a object-oriented perl
5 script running on a remote machine?
Is there no way to access remote perl objects (from perl or from another
language), like you can do in eg. java?
thanx!
german
------------------------------------------------------
German Cancio Melia IT - DIS CERN - 1211 Geneve 23
Phone: +41 2276 79801 mail: German.Cancio@cern.ch
------------------------------------------------------
------------------------------
Date: Wed, 25 Jun 1997 07:33:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: German Cancio Melia <gcancio@mail.cern.ch>
Subject: Re: more on remote objects
Message-Id: <Pine.GSO.3.96.970625073048.15150L-100000@kelly.teleport.com>
On Wed, 25 Jun 1997, German Cancio Melia wrote:
> Has nobody ever tried to communicate with a object-oriented perl
> 5 script running on a remote machine?
Certainly people have done this. Virtually anybody who has used the web
for long has done this, whether they know it or not.
> Is there no way to access remote perl objects (from perl or from another
> language), like you can do in eg. java?
Ah, you're trying to directly manipulate the data in a remote program. I
don't usually let people do that, for security reasons. :-) But maybe
you're interested in the Penguin package. It's on CPAN. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 25 Jun 1997 14:03:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: more on remote objects
Message-Id: <5or8et$m46@fridge-nf0.shore.net>
German Cancio Melia (gcancio@mail.cern.ch) wrote:
: Is there no way to access remote perl objects (from perl or from another
: language), like you can do in eg. java?
Oh! If I understand your question correctly, then you must be looking
for Penguin which is available at CPAN!
http://www.perl.com/CPAN/modules/by-module/Penguin/
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 23 Jun 1997 19:01:34 GMT
From: Frank Sheiness <sheiness@no.pink.meat.austin.ibm.com>
Subject: Re: Need a script that checks SUID = ROOT
Message-Id: <5omh6e$1v6g$3@ausnews.austin.ibm.com>
Stephan D. Cote <sdcote@lci.net> wrote:
> I was wondering if anyone has a perl script that would scan a file
> system and check which files were suid = root.
> I want to perform a security scan to see if there are any over-empowered
> processes / users out there.
$ find2perl find / -perm 4755 -user root -ls > findsuid.pl
--
HTH. HAND. archon@tamu.edu
and now a word from our sponsors:
sasquatch.
we now return you to the regularly scheduled flame fest.
------------------------------
Date: Wed, 25 Jun 1997 13:34:07 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: passing sort subroutines?
Message-Id: <ECC30v.H22@world.std.com>
Tim Rueger <rueger@io.com> writes:
>But (well, I wouldn't be posting if it worked), it doesn't work. What's
>the right way to think about implementing this? If I need to use
>anonymous subs, how do I dereference them? Thanks...
It works for me. I just tested it. Ran it through the debugger. It
uses the feature shown in the perlfunc man page of giving sort a
scalar that contains the name of a subroutine.
What problems were you having with it?
--
Andrew Langmead
------------------------------
Date: Wed, 25 Jun 1997 13:13:50 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: perl script on WinNT
Message-Id: <ECC232.4Ds@world.std.com>
Keys <keys@babylon5fan.corn> writes:
>Miko3aj Morzy wrote:
>>
>> on Unix machines every script begins with #!/usr/bin/perl or whatever
>> the path to the interpreter is. How does this line look like on Windows
>> NT machine (assuming interpreter perl386.exe)? I still get 500 server
>> error and I would appreciate your help.
>> Please help me- I'm getting more and more desperate
>> Kola
>On Win32 machines that line is ignored. You put your interpreter in
>your path and/or find some setting in your webserver for the interpreter
>path...
Its ignored by the operating system, but it is not ignored by the
interpreter.
Switches added to the line "#!/usr/bin/perl -wT" are honored.
--
Andrew Langmead
------------------------------
Date: Wed, 25 Jun 1997 09:31:02 -0400
From: Cliff Hall <cliff@tricon.net>
Subject: Re: PERL/CGI Database
Message-Id: <33B11D96.167E@tricon.net>
Jay Flaherty wrote:
>
> Darren Shilson (darren.shilson@wago.de) wrote:
> : Hi,
> :
> : Does anyone know where I can get hold of examples of databases written
> : in PERL/CGI.
> :
> : I want to write an Employee database, but need examples to work with.
> :
> : I'd be grateful for any help
>
> for your database I would use MySQL at:
> http://www.tcx.se
Good call Jay, MySQL *ROCKS*!!!
-Cliff
--
------ Cliff Hall, webmaster@tricon.net ------
==== Editor & Publisher -=[ SYNAPSE ]=- ====
http://synapse.tricon.net
------------------------------
Date: 25 Jun 1997 12:02:43 GMT
From: Oscar Wahlberg <qraoswa@255.255.255.147>
Subject: Problem with defunct childs when forking.
Message-Id: <5or1d3$b2g@newstoo.ericsson.se>
Keywords: forking, perl, defunc
Hi,
I've written a perl script that forks off a couple of childs that
really never should exit or die, but if they are inactive they get
killed off.
When I kill one of these childs and fork another one to replace it
I get a <defunc> child becuase I didn't wait for the killed child properly.
My question to you, how should I wait for a child that never should
quit AND keep the parent going.
Both the parent and childs are runnning while (1) loops.
The parent is constantly checking that the childs are alive and well
and if not kill/restart.
The childs do it to preform certain tests and log the results.
Anyone got a clue ? My distinct feeling is that I need to wait for
them in some obscure way when I start the childs, but I don't know how...
Thanks in advance.
--
Oscar Wahlberg
------------------------------
Date: 25 Jun 1997 12:16:39 GMT
From: Sol Lightman <bri@mojo.calyx.net>
Subject: promote array with tie()
Message-Id: <5or277$s3q@cdc2.cdc.net>
Hi,
Is there a reference trick to help promote a standard perl
array into a tied class without recopying the data? Something
along the lines of:
package foo;
sub promote {
print "Promote called with @_\n";
my($class, $array) = @_;
delete $main::{array};
@main::array = ();
tie @$array, "foo", $array;
}
sub TIEARRAY {
print "Tiearray called with @_\n";
my($class, $array) = @_;
return bless {A=>$array}, "foo";
}
package main;
@foo = (1,2,43);
promote foo \@foo;
print tied(@foo), $foo[1];
Which doesn't work (calls TIEARRAY recursively). I've already tried
various ways of getting a reference to the data and ditching
the connection between the data and the original perl symbol
table entry. Any tips?
--
Brian S. Julin
------------------------------
Date: Wed, 25 Jun 1997 07:00:44 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mousheng Xu <mxu@eecs.ukans.edu>
Subject: Re: Q: MacPerl, MacHTTP and CGI
Message-Id: <Pine.GSO.3.96.970625065551.15150F-100000@kelly.teleport.com>
On Tue, 24 Jun 1997, Mousheng Xu wrote:
> On Tue, 24 Jun 1997, Tom Phoenix wrote:
> >This should be covered in the documentation which comes with MacPerl.
> If you read that and still have questions, please ask again. Thanks!
>
> MacPerl, 5.13.
> "should be" but actually not. It talks about how to write perl
> script -- no, unix perl script only!
Maybe somebody didn't give you the full release. My copy of MacPerl 5.13r2
includes the file macperl.pod, which "describes differences between
MacPerl and a typical Unix perl implementation."
> They even didn't include enough information on how to run this script
> for cgi.
Really? Mine came with a folder called "MacPerl CGI", and it contains a
document called "README.CGI". Could that be what you need?
If you don't have these files, you can get them (and the full MacPerl
distribution) from CPAN. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 23 Jun 1997 18:48:51 GMT
From: Frank Sheiness <sheiness@no.pink.meat.austin.ibm.com>
Subject: Re: question about sorting a hash inbetween two delimeters and not the whole file
Message-Id: <5omgej$1v6g$2@ausnews.austin.ibm.com>
Shane 'Fishman' Sherman <fishman@vvm.com> wrote:
> now what i want it to do is when another lake is added it will sort
> only the names of the state that the lake that was added is in. so if
> lake smith and sherman are already added for alabama and the new lake
> west is added it will only sort the lakes inbetween the <!--Alabama-->
> and <!--Alabama>. If it was one big file it would be easy for me but
> what is giving me problems is to make it stop sorting the hash when it
> reaches <!--Alabama>
perldoc -f next
perldoc -f last
perldoc -f semctl unless (!defined($relevant));
--
please do not attempt to associate this article with my employers. i fear
its controversial nature might adversely affect my future. oh yeah, and i'm
writing it on my lunch break.
this usenet article is black if you have a depressing color scheme.
------------------------------
Date: Wed, 25 Jun 1997 13:52:25 GMT
From: ddurand@hpplus17.cern.ch (Jean-Damien Durand)
To: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Remove duplicate values from array
Message-Id: <ECC3vE.EwH@news.cern.ch>
> george.pieri@mci.com (George Pieri) writes:
>
> > I would like to remove all the duplicate values from a one dimensional
> > array... Is there an easy way to do this....?
>
> sub uniq {
> my %tmp;
>
> foreach (@_) { $tmp{$_}++; }
> return keys %tmp;
> }
I use very often its two lines equivalent:
%tmp = () ;
@array = grep ++$temp{$_} < 2, @array ;
kept from the perl unix reviews if I remember well.
--
*******************************************************
* Jean-Damien Durand (Jean-Damien.Durand@cern.ch) *
* www : http://wwwcn1.cern.ch/~ddurand/ *
*******************************************************
--
*******************************************************
* Jean-Damien Durand (Jean-Damien.Durand@cern.ch) *
* www : http://wwwcn1.cern.ch/~ddurand/ *
*******************************************************
------------------------------
Date: Wed, 25 Jun 1997 06:14:41 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: removing trailing whitespace
Message-Id: <tcyangECBIoI.CIr@netcom.com>
Try
s/\s*$//;
(note that this bites off the "\n" in the end of the string $_, therefore
you might need to make sure you have \n with $_, or you are sure you never
have \n with $_.
=====================================
Eric Finley typed before Poison Ivy kissed him:
: Hi,
: I am trying to remove all trailing whitespace from a scalar and am having
: very little luck. What worked best so far is s/(.*)\s*?/$1/ but this only
: removes the last whitespace since the .* is greedy and matches everything
: up to the last whitespace. At least that is what I think is happening
: from what I know of regex. How can I do this? Part of the problem is
: that spaces and any other chars are allowed in the string so "!A + B "
: is allowed and I want to strip it down to "!A + B". Any suggestions?
: Thanks,
: Eric Finley
--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Wed, 25 Jun 1997 09:46:23 -0400
From: TechMaster Pinyan <jefpin@bergen.org>
Subject: Re: removing trailing whitespace
Message-Id: <Pine.SGI.3.96.970625094050.8216B-100000@davinci.bergen.org>
Er... I was thinking along the lines of...
s/[ \t]+(\n)$/\1/;
This will strip it of every white space after the last character, and
leave the newline character. You can leave it out, and make it just:
s/[ \t]+$//;
>Try
>s/\s*$//;
>: Hi,
>: I am trying to remove all trailing whitespace from a scalar and am having
>: very little luck. What worked best so far is s/(.*)\s*?/$1/ but this only
>: removes the last whitespace since the .* is greedy and matches everything
>: up to the last whitespace. At least that is what I think is happening
>: from what I know of regex. How can I do this? Part of the problem is
>: that spaces and any other chars are allowed in the string so "!A + B "
>: is allowed and I want to strip it down to "!A + B". Any suggestions?
>: Thanks,
>: Eric Finley
----------------
| "Here we are now, entertain us!"
| - Nirvana
----------------
Jeff "TechMaster" Pinyan | http://www.bergen.org/~jefpin
HTML/CGI Designer and Consultant and JavaScripter
jefpin@bergen.org | TechMasterJeff@juno.com
Got a JavaScript/CGI/Perl question or problem? Let me know!
webXS - the new eZine for WebProgrammers! webXS@juno.com
Visit us @ http://www.bergen.org/~jefpin/webXS
------------------------------
Date: Wed, 25 Jun 1997 10:34:01 GMT
From: ddurand@hpplus03.cern.ch (Jean-Damien Durand)
To: Aldoliu Chan <chiyung@b1.hkstar.com>
Subject: Re: Retreive html document by PERL
Message-Id: <ECBuop.E3t@news.cern.ch>
> Hi,
> Is there a http module for PERL? I think it help me simply the work
> b'cos now i get the html document by telnetting to the port 80 of the host
> and send "GET" method to it. Thanks for any help!
>
> Cheers,
> Aldoliu Chan
Look into the LWP module, or www.pl and network.pl in the std distribution.
"perldoc LWP" should satisfy your request.
Cheers, Jean-Damien.
--
*******************************************************
* Jean-Damien Durand *
* --------------------------------------------------- *
* e-mail: Jean-Damien.Durand@cern.ch *
------------------------------
Date: 25 Jun 1997 09:24:35 -0400
From: tjl@lukka.student.harvard.edu (Tuomas J. Lukka)
Subject: Re: RFC: Xlib.pm
Message-Id: <5or66j$il0@fkfuga.pc.helsinki.fi>
In article <uow205rfmto.fsf@tremere.ecte.uswc.uswest.com>,
Randy J. Ray <rjray@uswest.com> wrote:
>A few questions:
>
>* Why avoid using Xlib (or any of the X link libs)? Is there a reason to not
> write the XS code as wrappers over the known Xlib?
It would actually be nice: on *any* platform one can run Perl, one could
then write X applications without worrying about compiling Xlib.
I think it's a wonderful idea, especially once the Perl Compiler comes
about and makes it comparable to C Xlib in speed.
>* If you are aiming for an Xlib clone, why try to make it OO?
I think he is trying to make something that can work as xlib but
not be exactly so. OO is much nicer than the current C xlib.
>* Will you be planning to offer any of the "shortcuts" X programmers are
> familiar with, such as BlackPixel, WhitePixel, DefaultScreen, etc.?
It would be madness not to, I think.
Overall, I think it's a wonderful idea which may really result in something
interesting in the end.
Especially when it is made compatible with e.g. OpenGL or something.
Tuomas
------------------------------
Date: 25 Jun 1997 14:33:17 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Re: RFC: Xlib.pm
Message-Id: <5ora7d$me9$1@dismay.ucs.indiana.edu>
In article <uow205rfmto.fsf@tremere.ecte.uswc.uswest.com>,
rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray) writes:
>A few questions:
>
>* Why avoid using Xlib (or any of the X link libs)? Is there a reason to not
> write the XS code as wrappers over the known Xlib?
Two reasons:
1) Xlib is tied very much to C. Lots of **'s and typedefs.
2) The wrapper would be huge and very non-perlish.
>
>* If you are aiming for an Xlib clone, why try to make it OO?
It would only moderatly be OO. I've only abstracted out a 'display'
object. This means you can easily have more than one display open at a time.
>
>* Will you be planning to offer any of the "shortcuts" X programmers are
> familiar with, such as BlackPixel, WhitePixel, DefaultScreen, etc.?
They could be added easily. I'm still pretty early in development and
have come across someone else who's working on a similar project (he's got
a nicer interface to it...)
>
>Randy
--
Brian Wheeler
bdwheele@indiana.edu
------------------------------
Date: Wed, 25 Jun 1997 09:16:29 GMT
From: ccsis@bath.ac.uk (Icarus Sparry)
Subject: Re: Splitting large file (50MB+)?
Message-Id: <ECBr3G.x1.B.stealth@bath.ac.uk>
In article <33AA006C.EE2923AC@global.com.my>,
Ng Chin Kiong <ckng@global.com.my> wrote:
>-=-=-=-=-=-
>
>I'm currently using perl to write a program that will process a large
>TEXT file (50MB+) and to extract the data into a new file. However,
>because of the size of the file (50MB+), the system has ran out of
>memory. So, I'm thinking is there anyway I can split the text file into
>smaller pieces before processing? Or any other suggestion?
>Thanks in advance.
There is no need to send out two copies of your posting, one in 'text'
and one in 'html'. Please check the settings on your browser.
Since you say that you want to 'extract' data, it implies that you should be
able to process the file one record at a time, maybe even one line at a
time. PERL is good at doing that kind of thing, so I suspect that you
are slurping the whole file into memory, and need to re-write your program.
If you are in too much of a hurry to do this, then look up the 'split'
command which will break the file up into 1000 line chunks by default.
You should seriously look at rewriting your PERL program, that is the
correct solution for this problem.
Icarus
------------------------------
Date: Wed, 25 Jun 1997 09:32:34 -0400
From: "News" <shahkau@library1.cpmc.columbia.edu>
Subject: Re: Unsupported socket function
Message-Id: <5or6dc$pnh$1@newsmaster.cc.columbia.edu>
I am running code on Sun Solaris. As for the script its just a call to
gethostbyname and the name of the host as parameter. Then I am printing it
out. Just two lines.
-Kaushal.
Bryan Teague wrote in article <33AFD765.15FB@aol.net>...
>KaushalSha wrote:
>>
>> Can anyone tell me what the following error message means.
>> I get this error message when I execute command "perl tmp.pl" using
Perl
>> 5.003.
>>
>> Unsupported socket function "getprotobyname" called at tmp.pl line 12
>>
>> I get similar message when I use C language. Is there a library file
>> missing that was to be included? Does it come with Perl?
>>
>> Thanks for your help.
>> -Kaushal
>
>I believe I know what you are refering too. I have experienced
>something similar in some of my coding.
>
>However, you really need to provide more information in your message.
>
>What platform are you running on?
>
>Please provide the snippet of code that you are attempting to run.
>
>
>In my socket applictation, I ran into a problem with setting the
>SOCK_STREAM. On SGI, it needs to be set to 2. On HPs it needs to be
>set to 1.
>
>You can verify this information if you check the socket.h file located
>in /usr/include/sys.
>
>Hope this helps!
>Bryan
>--
>Bryan Teague bteague@aol.net Phone: 703-453-4397
>
------------------------------
Date: Wed, 25 Jun 1997 07:36:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: alastair brown <alastair@redboxad.demon.co.uk>
Subject: Re: Unwanted Output from script need help!!
Message-Id: <Pine.GSO.3.96.970625073423.15150M-100000@kelly.teleport.com>
On Wed, 25 Jun 1997, alastair brown wrote:
> The script that I'm having trouble with writes data to a file when
> called from a HTML page. The problem I have is that because it returns
> no output ie this process goes on behind the scenes. The PERL
> interpreter returns the message
>
> 'D:\wwwroot\b82\cgi-bin\add_to_basket.perl' script produced no output
No, I'm pretty sure that that message is coming from your webserver. You
should probably change the script to produce some output. :-) To find out
what output to produce, check your server's docs, a server newsgroup, or
that group's FAQ; it's beyond the scope of a Perl newsgroup. Hope this
helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 25 Jun 1997 10:27:00 +0200
From: Grzegorz Nowakowski <krecik@lri.fr>
Subject: Re: What does "UNIX" stand for..
Message-Id: <08soy7ozoq.fsf@lri.fr>
Larry D'Anna <ldanna@ix.netcom.com> writes:
> Ron McFarland wrote:
>
> > In article <33A562FC.3126@cs.odu.edu>, eddie@cs.odu.edu says...
> > >If operating systems were programming languages UNIX would be C
> > >and Win95 would be BASIC with line numbers. :)
> >
> > Naw. Win95 would be like C++. ;)
>
> Tell me, have you ever actually taken the time to really learn
> enough of the esoteric UNIX commands, tools, etc. to
> actually do something useful and then still found it less powerful
> than win95? I agree that win95 is easier to learn, but flying a
> ultralight is easier than flying a F-16 ;)
I think it's bad comparision. A few Polish pilots were able to fly
F-16s and they all said that when flying they felt like playing arcade
game in computer - everything was simple. Seems that F-16 is like Mac
among airfighters.
Excuse me for off-topic. :)
--
Grzegorz "Krecik" Nowakowski
<krecik@tcs.uni.wroc.pl>
`...this is the rock solid principle on which the whole of the
Corporation's Galaxy-wide success is founded - their fundamental
design flaws are completely hidden by their superficial design flaws.'
-- So Long, and Thanks for all the Fish -- Douglas Adams.
------------------------------
Date: Wed, 25 Jun 1997 09:11:24 -0500
From: wwilliam@cisco.com (Wade Williams)
Subject: What does <<END do?
Message-Id: <wwilliam-ya02408000R2506970911240001@news.cisco.com>
sub print_tail {
print <<END;
<HR>
<ADDRESS>Lincoln D. Stein</ADDRESS><BR>
<A HREF="/">Home Page</A>
END
}
In the above code, I can surmise that the "print <<END" line says "Print
until you reach an END." Is that correct?
If so, why do I get:
Can't find string terminator "END" anywhere before EOF at ./test.cgi line 77.
Sorry for the newbieness of the question, but I wasn't able to find any
documentation on the use of END.
Wade
--
---------------------------------------------------------------------------
Wade Williams "Any escape might help to smooth the
Systems Engineer unattractive truth, but the suburbs
Cisco Systems, Inc. have no charms to soothe the restless
Brentwood, TN dreams of youth."
615-221-2918 - N. Peart
wwilliam@cisco.com
---------------------------------------------------------------------------
------------------------------
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 661
*************************************