[10073] in Perl-Users-Digest
Perl-Users Digest, Issue: 3666 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 9 04:07:20 1998
Date: Wed, 9 Sep 98 01:00:22 -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, 9 Sep 1998 Volume: 8 Number: 3666
Today's topics:
Re: <> Question (Craig Berry)
Re: <> Question <dgris@rand.dimensional.com>
Any example parallel fetching code for LWPng? hup@my-dejanews.com
Hash table sjagadish@my-dejanews.com
HELP: Malformed header error <jprince@rockisl.com>
Re: HELP: Malformed header error <vincent@compclass.com>
Re: How do I extract last line from multiline string? <NOSPAM.stephane.barizien@ocegr.fr>
Re: How do I extract last line from multiline string? <NOSPAM.stephane.barizien@ocegr.fr>
Re: How do I extract last line from multiline string? <NOSPAM.stephane.barizien@ocegr.fr>
Re: How do I extract last line from multiline string? <NOSPAM.stephane.barizien@ocegr.fr>
how to quote ; (Jimmy Zhengyu Zhang)
Re: how to quote ; <nguyend7@msu.edu>
Re: how to quote ; (Bob Trieger)
how to quote semicolon (Jimmy Zhengyu Zhang)
Re: how to quote semicolon (Bob Trieger)
Re: IO::File Permissions - Enlightened! (Ronald J Kimball)
Re: localtime and Y2K (Craig Berry)
Re: newbie while/regex question <vincent@compclass.com>
Re: Perl Programmer Needed (Ronald J Kimball)
Re: Problems building threaded perl 5.005 on OSF 4.0d <butenhof@zko.dec.com>
reducing the size of database files (john a barbuto)
String to Binary <dchen@aludra.usc.edu>
Re: String to Binary (Larry Rosler)
Re: String to Binary <uri@sysarch.com>
Re: String to Binary <dchen@aludra.usc.edu>
Re: String to Binary (Larry Rosler)
Trouble running `make test' for mod_perl-1.-15 (Alan E. Derhaag)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Sep 1998 05:55:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: <> Question
Message-Id: <6t5585$lcu$2@marina.cinenet.net>
Steve Debenport (steve.debenport@us.coopers.com) wrote:
: SG93IGRvIEkgd2l0aGluIGEgJ1doaWxlICg8PiknIGFuZCAnaWYnIHN0YXRlbWVudCwgc2tpcCBh
: IGNvdXBsZSBvZiBsaW5lcyBhdCBhIGNlcnRhaW4gcG9pbnQgd2hpbGUgc3RlcHBpbmcgdGhyb3Vn
: aCBhIHRleHQgZmlsZS4gIEkgdGhvdWdodCB0d28gc2ltcGxlICc8Picgd291bGQgd29yaywgYnV0
: IGl0IGRvZXNuJ3Qgc2VlbSB0by4gIEFueSBpZGVhcz8gIFRoYW5rcy4NClN0ZXZlIERlYmVucG9y
: dCANClN0ZXZlLkRlYmVucG9ydEB1cy5wd2NnbG9iYWwuY29tDQo=
I think we have a new all-time Perl Poet Laureate. I'm still trying to
figure out how that part that does Runge-Kutta integration also solves the
halting problem while printing out the cute JAPH signature.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 09 Sep 1998 06:26:41 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: <> Question
Message-Id: <6t56bh$33h$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <6t5585$lcu$2@marina.cinenet.net>
cberry@cinenet.net (Craig Berry) wrote:
>I think we have a new all-time Perl Poet Laureate. I'm still trying to
>figure out how that part that does Runge-Kutta integration also solves the
>halting problem while printing out the cute JAPH signature.
$ perldoc perldwim
:-)
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`C++ gives me the willies. Physical willies. I take
medication for it.'
Kurt Starsinic on p6p
------------------------------
Date: Wed, 09 Sep 1998 06:06:18 GMT
From: hup@my-dejanews.com
Subject: Any example parallel fetching code for LWPng?
Message-Id: <6t55sq$2j1$1@nnrp1.dejanews.com>
Hi,
I would like to do something like:
########### Begin #################
# Ouch, how to pretend as a cookie enable browser?
# Some web page do cookie test for your accessing
@url=("http://www.url1.com","http://www.url2.com",..."http://www.urlX.com");
sub parseUrl1 {
# do something;
}
sub parseUrl2 {
# do something;
}
sub parseUrl3 {
# do something;
}
%myreturn = parallel_fetch_all @url;
# assume/expect each url is the hash index
foreach $i (keys %myreturn) {
if($i eq "http://www.url1.com") {
parseUrl1($myreturn{$i});
}
elsif($i eq "http://www.url2.com") {
parseUrl2($myreturn{$i});
}
elsif($i eq "http://www.url3.com") {
parseUrl3($myreturn{$i});
}
# any possible to parallel parse those code?
# Thread? May be not now, I was told that perl multithread is not stable
}
########### End #################
I know the code above are dirty, but, hopefully it still clean enough to
make you understand. I know it could be done easily by using LWPng,
unfortunately, I don't be able to find any example after read the man pages,
Yahoo! and AltaVista searching.
>From http://www.linpro.no/lwp/lwpng-paper/, I think may be I could code the
fetching part like:
$ua->spool($url1); # returns immediately
$ua->spool($url2); # can send multiple request in parallel
#...
mainloop->run; # return when all connections are gone
But, I don't know how to get those results? (and how to pretend as a cookie
enable browser)
Sorry if the problem is too silly/simple for you.
Thanks for you help.
----------------------------------------------------------------------
AddALL is a book searching and price comparison meta search engine.
The free service find books and compare prices among major bookstores.
Please visit http://www.addall.com to save your Time and Money.
-- Chai-Hup Chen hup@addall.com --------------------------------------
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 09 Sep 1998 06:41:07 GMT
From: sjagadish@my-dejanews.com
Subject: Hash table
Message-Id: <6t57u3$54r$1@nnrp1.dejanews.com>
I need to compare string data in two huge text files (both > 150KB) and return
number of matches found etc. A linear search is obviously going to be very
slow. Any ideas for implementing it ?
Thanks, pls email your reply. I might not notice it in the flood of posts
here.
jagadish
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 08 Sep 1998 22:40:17 PDT
From: "Jeff Prince" <jprince@rockisl.com>
Subject: HELP: Malformed header error
Message-Id: <6t54c1$m92@journal.concentric.net>
I'm new to CGI scripting, but I'm trying hard to learn to do some relatively
simple database operations form my web site. I've taken an example tutorial
script from an on-line source, placed it in directories on my domain, and
attempted to execute it to study how it works. When I call the script, I
get the following error:
Error: HTTPd: malformed header from script /cgi/add.cgi
My cgierr_log gives this information:
09/08/98 20:22 "/cgi/data_search.cgi", proc "/usr/local/bin/perl":
Illegal character \015 (carriage return) at /cgi/data_search.cgi line 2.
(Maybe you didn't strip carriage returns after a network transfer?)
Here is a header snippet from the offending CGI code:
#!/usr/local/bin/perl
use CGI qw /:standard :html3/;
I'm stumped on this one. What am I doing wrong that won't allow this to run
on my server? It runs just fine on it's home server.
Can anyone shed some light you can on what's happening here?
Thanks in advance,
Jeff Prince
jprince@rockisl.com
------------------------------
Date: Tue, 08 Sep 1998 23:10:27 -0700
From: Vincent Lowe <vincent@compclass.com>
Subject: Re: HELP: Malformed header error
Message-Id: <35F61BD3.19F1FC79@compclass.com>
Jeff Prince wrote:
>
> I'm new to CGI scripting, but I'm trying hard to learn to do some relatively
> simple database operations form my web site. I've taken an example tutorial
> script from an on-line source, placed it in directories on my domain, and
> attempted to execute it to study how it works. When I call the script, I
> get the following error:
>
> Error: HTTPd: malformed header from script /cgi/add.cgi
>
...one thing that sometimes helps is to run the script by hand from the
shell prompt.
The good thing about CGI.pm is that it will help you when you are
running the script by hand if you supply appropriate parameters on the
command line.
If you don't have an environment where you can test your scripts by
hand, you're missing an important part of the CGI code/test/debug
development cycle. Trying to guess what's wrong by putting something
underneath the web server and hoping for the best is a frustrating
pursuit.
I suggest:
1) run the script in person, and by hand from a shell prompt
2) if that works the way you expect, deploy to the web site and test
with a browser
3) if that doesn't work, check the server logs (as you have) and
inspect the source of the returned page.
...good luck, have fun.
---v
--
| vincent@compclass.com | "Birds rising in flight is a sign
| | that the enemy is lying in ambush..."
| 248.557.2754 | Sun Tzu
+--------------------------+-----------------------------------------
| Aqueduct Information Services http://www.aquecorp.com/vincent
------------------------------
Date: Wed, 9 Sep 1998 09:27:08 +0200
From: "Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr>
Subject: Re: How do I extract last line from multiline string?
Message-Id: <6t5ag4$qgb3@janus.ocegr.fr>
Larry Rosler wrote in message ...
>[Posted to comp.lang.perl.misc and copy mailed.]
>
>In article <6t0ut5$kv23@janus.ocegr.fr> on Mon, 7 Sep 1998 17:44:50
>+0200, Stephane Barizien <NOSPAM.stephane.barizien@ocegr.fr> says...
>> a\nb\nc\nd\n
>...
>> I want to extract the last "line" ("d" in my example) to a var
>> and keep the rest in the original variable.
>>
>> I've tried:
>>
>> chop ($x);
>> $x =~ s/\n([^\n]+)\\z//m;
>> $y = $1;
>>
>> and it doesn't work (don't ask me why \\z and not \z: w/ only one \
>> I get a match somewhere in my string...)
>
>$x = "a\nb\nc\nd\n";
>$x =~ s/\n([^\n]*)\n$//; # $x becomes "a\nb\nc"
>$y = $1; # $y becomes "d"
>
>All you had wrong was that "\\z". Probably you were thinking of "\Z",
>but even that is unnecessary -- "\n$" works fine.
>
That's exactly what I ended up doing. Thx anyway.
I found the \z stuff at
ftp://ftp.lip6.fr/pub/perl/CPAN/doc/manual/html/pod/perlre.html
but it's probably wrong (?) -- it's not in the perlre manpage on my Solaris
2 box...
--
---
Stephane Barizien
Please remove the 'NOSPAM.' prefix when replying by e-mail.
Don't forget to cc: the newsgroup(s) in that case: others might
be interested in your answer!
------------------------------
Date: Wed, 9 Sep 1998 09:29:03 +0200
From: "Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr>
Subject: Re: How do I extract last line from multiline string?
Message-Id: <6t5ajm$qgb5@janus.ocegr.fr>
Bob Trieger wrote in message <6t46h3$tml$1@ligarius.ultra.net>...
>[ posted to usenet and courtesy e-mail sent ]
>
>lr@hpl.hp.com (Larry Rosler) wrote:
>-> Bob Trieger <sowmaster@juicepigs.com> says...
>-> > ced@bcstec.ca.boeing.com (Charles DeRykus) wrote:
>-> > -> This is easier to type and in many cases faster:
>-> > ->
>-> > -> $x =~ s/\n(.*)\n$//;
>-> >
>-> > It might be easier to type but it doesn't come close to doing what the
>-> > poster asked. He wanted the last line like the topic says.
>-> >
>-> > $x =~ s/^.*\n([^\n]+)\n$/$1/sm;
>-> >
>-> > is how I'd do it if using a substitution regex.
>->
>-> He wanted the last line, and also to remove it from the input (as shown
>-> above). Yours removes everything but the last line from the input. I'm
>-> not sure I understand the purpose of the leading anchor or the /m
>-> modifier, in any case.
>
>Oops. I guess I should have backed up and read the original post. But
>from the subject line I figured he just `wanted' the last line.
>
>
I wanted both. Here's my final code:
$x =~ s/\n([^\n]+)$//;
$y = $1;
--
---
Stephane Barizien
Please remove the 'NOSPAM.' prefix when replying by e-mail.
Don't forget to cc: the newsgroup(s) in that case: others might
be interested in your answer!
------------------------------
Date: Wed, 9 Sep 1998 09:30:05 +0200
From: "Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr>
Subject: Re: How do I extract last line from multiline string?
Message-Id: <6t5alk$qgb7@janus.ocegr.fr>
Ronald J Kimball wrote in message
<1dezx1i.ch7zf41i3sgv8N@bay1-382.quincy.ziplink.net>...
>Stephane Barizien <NOSPAM.stephane.barizien@ocegr.fr> wrote:
>
>> $x =~ s/\n([^\n]+)\\z//m;
>> $y = $1;
>>
>> and it doesn't work (don't ask me why \\z and not \z: w/ only one \
>> I get a match somewhere in my string...)
>
>That's because \z doesn't mean anything special, so it's interpolated as
>simply z. Try \Z instead.
>
>By the way, you should assign $1 to $y only if the match actually
>succeeds.
I found the \z stuff at
ftp://ftp.lip6.fr/pub/perl/CPAN/doc/manual/html/pod/perlre.html
but it's probably wrong (?) -- it's not in the perlre manpage on my Solaris
2 box..
--
---
Stephane Barizien
Please remove the 'NOSPAM.' prefix when replying by e-mail.
Don't forget to cc: the newsgroup(s) in that case: others might
be interested in your answer!
------------------------------
Date: Wed, 9 Sep 1998 09:31:43 +0200
From: "Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr>
Subject: Re: How do I extract last line from multiline string?
Message-Id: <6t5aom$qgb9@janus.ocegr.fr>
Tim Gim Yee wrote in message <35f49122.291145716@news.oz.net>...
>On Mon, 7 Sep 1998 17:44:50 +0200, "Stephane Barizien"
><NOSPAM.stephane.barizien@ocegr.fr> wrote:
>
>>I have a string that contains something like
>>
>>a\nb\nc\nd\n
>>
>>(output from Net::Telnet::waitfor, FWIW)
>>
>>I want to extract the last "line" ("d" in my example) to a var
>>and keep the rest in the original variable.
>>
>>I've tried:
>>
>>chop ($x);
>>$x =~ s/\n([^\n]+)\\z//m;
>>$y = $1;
>
>You don't need to substitute, [^\n] is wordy, you probably were
>thinking \Z, and the /m modifier wouldn't have helped.
I can't seem to be able to burn that '.' doesn't match '\n' into my
brains...
>
>$last_line = $1 if "a\nb\nc\nd\n" =~ /(.*)$/;
>
>>P.S. One nice thing about Perl re's is that you can do ANYthing.
>>One bad thing is that it can take you an unknown amount of time to find
out
>>HOW.
>
>$last_line = (split "\n", "a\nb\nc\nd\n")[-1]; # Look, mom! No RE!
>
>Don't be surprised if your mom corrects you :)
>
No problem, mom!
See my final code in one of my replies.
Thx anyway for the help of all of you.
--
---
Stephane Barizien
Please remove the 'NOSPAM.' prefix when replying by e-mail.
Don't forget to cc: the newsgroup(s) in that case: others might
be interested in your answer!
------------------------------
Date: 9 Sep 1998 04:54:56 GMT
From: zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang)
Subject: how to quote ;
Message-Id: <6t51n0$5bt$2@agate.berkeley.edu>
hi,
Just wonder how to quote ; in the string?
thnx
zhengyu
------------------------------
Date: 9 Sep 1998 05:43:25 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: how to quote ;
Message-Id: <6t54ht$13v$1@msunews.cl.msu.edu>
Jimmy Zhengyu Zhang <zhengyu@lacerta.Berkeley.EDU> wrote:
:Just wonder how to quote ; in the string?
Thank you so very much for posting the question three times.
Try actually trying to use ; (semicolon) in a string and see what you
get, rather than posting three times to this ng.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Wed, 09 Sep 1998 06:23:11 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: how to quote ;
Message-Id: <6t5735$nim$1@ligarius.ultra.net>
[ posted to usenet and courtesy e-mail sent ]
zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang) wrote:
-> Could someone tell me how to quote ; in the string?
you can either escape the quotes inside the string or use the quote
operators q, qq, qw & qx.
For more info on the quote operators check out the `perlop' manpage.
HTH
Bob Trieger | `Sparks International' is spamming and
sowmaster@juicepigs.com | trying to help us lose weight. Let's do
them a favor. Call to let the know that
spamming is evil and do it on their dime.
Call 1-888-689-3097
------------------------------
Date: 9 Sep 1998 04:56:12 GMT
From: zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang)
Subject: how to quote semicolon
Message-Id: <6t51pc$5bt$3@agate.berkeley.edu>
Just wondering how to quote ; in a string?
thnx
Zhengyu
------------------------------
Date: Wed, 09 Sep 1998 06:32:56 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: how to quote semicolon
Message-Id: <6t57lf$nim$2@ligarius.ultra.net>
[ posted to usenet and courtesy e-mail sent ]
zhengyu@lacerta.Berkeley.EDU (Jimmy Zhengyu Zhang) wrote:
->
-> Just wondering how to quote ; in a string?
How many times are you going to post this?
If you are new to usenet please go read the news:news.announce.newusers
& news:news.newusers.questions newsgroups before posting any further.
HTH
Bob Trieger | `Sparks International' is spamming and
sowmaster@juicepigs.com | trying to help us lose weight. Let's do
them a favor. Call to let the know that
spamming is evil and do it on their dime.
Call 1-888-689-3097
------------------------------
Date: Wed, 9 Sep 1998 01:02:21 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: IO::File Permissions - Enlightened!
Message-Id: <1df2c9e.1w2vigcd5srukN@bay1-377.quincy.ziplink.net>
[posted and mailed]
Bill 'Sneex' Jones <sneaker@sneex.fccj.org> wrote:
> # This next line only works when my umask is 077;
> umask 077; # Temporarily change it...
> my $fh = new IO::File $file, "a", 0600;
^^^^
Ignored, because your file mode is not numeric.
When you get a chance, you really should read the docs for IO::File.
Would it help if I posted the relevant section again?
Perhaps if I posted the actual code instead...
sub open {
@_ >= 2 && @_ <= 4 or
croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])';
my ($fh, $file) = @_;
if (@_ > 2) {
my ($mode, $perms) = @_[2, 3];
if ($mode =~ /^\d+$/) {
defined $perms or $perms = 0666;
return sysopen($fh, $file, $mode, $perms);
}
$file = _protect($file) if $file =~ m{\A[^\\/\w]};
$file = IO::Handle::_open_mode_string($mode) . " $file\0";
}
open($fh, $file);
}
As you can plainly see, the $perms argument is used *if and only if* the
$mode argument matches /^\d+$/. Your mode of "a" does not match, so
your perms of 0600 is ignored.
> Seriously, I do understand now, and I appreciate
> everyone's patience while I was rambling :]
No, you still haven't gotten it, but you're welcome anyway.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 9 Sep 1998 05:50:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: localtime and Y2K
Message-Id: <6t54v2$lcu$1@marina.cinenet.net>
james_della_porta@ansett.com.au wrote:
: I'm just going through some scripts of mine, and others written
: by collegues. I understand that localtime does not give a proper
: representation of the year,
'Proper' is an ambiguous attribute. It gives the civil year minus 1900,
which is certainly a well-defined, well-behaved value for the year.
: and that you need to add 1900 to it.
...in order to produce the full civil year, for presentation to users.
Other options include displaying localtime's year modulo 100, or (for
internal purposes) just using it 'as is'.
: My question is, will this always be the case, or will things change
: at some later stage?
It seems very doubtful that localtime's behavior will ever change. Such a
change would break too much existing code.
: eg. at the year 2001, will the year from
: localtime() return 101,
Yes.
: or could it possibly come back with 01?
Not unless your underlying C library is outrageously broken.
: Are the standards for Perl set in concrete?
Perl's standards are not, but Perl gets its localtime() behavior from the
C standard, which is (as much as any language standard is).
: If things stay as they are, is the following theory OK?
:
: @date = localtime(time);
The use of the explicit 'time' argument is (harmlessly) redundant.
: $year = (1900 + $date[5]);
Yes, that's the idea.
: Also, are there any other problems associated with Perl and Y2K?
Only in the sense that numerous programmers have used Perl to create Y2K
bugs.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Tue, 08 Sep 1998 23:02:58 -0700
From: Vincent Lowe <vincent@compclass.com>
To: Standard User <grant.ozolins@anu.edu.au>
Subject: Re: newbie while/regex question
Message-Id: <35F61A12.2FA2004B@compclass.com>
Standard User wrote:
>
> I assumed that anything that
> wasn't matched by the regex substitution would just be left alone, but
> I'm obviously wrong.
>
...no, your code looks fine to me (and runs fine on my system...)
Here's another look at it:
#-- shorter version of your program
$logdate = 19980908;
open (RC, "test") || die "couldn't open test file. $!";
while (<RC>) {
s/[0-9]{8}/$logdate/g; # assumes $_ unless you say differently
print; # same note as above
}
close (RC);
...or for another approach, let's embed our test data directly in the
script:
#-- uses data embedded with the DATA filehandle
$logdate = 00000000;
# we'll read our data from the special DATA filehandle
while (<DATA>) { # we can use \d instead of [0-9] if we like
s/\d{8}/$logdate/g; # assumes $_ unless you say differently
print; # same note as above
}
__END__
This is a line of sample
data that we can use
to simulate input without having
to submit our 19980908 script
to the stresses of real file I/O
until we've 19700101 fully debugged it.
...hope something in this will help make things clearer.
---v
--
| vincent@compclass.com | "Birds rising in flight is a sign
| | that the enemy is lying in ambush..."
| 248.557.2754 | Sun Tzu
+--------------------------+-----------------------------------------
| Aqueduct Information Services http://www.aquecorp.com/vincent
------------------------------
Date: Wed, 9 Sep 1998 01:02:24 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl Programmer Needed
Message-Id: <1df2d3f.rjc9k51ou42nfN@bay1-377.quincy.ziplink.net>
Russ Allbery <rra@stanford.edu> wrote:
> I see scattered jobs postings to
> various appropriate newsgroups from time to time and don't really see the
> problem provided that they (a) aren't too frequent, (b) don't overwhelm
> normal traffic, and (c) are well labeled.
The rather obvious problem with this is that if you allow a handful of
people to send job postings, then everyone will feel justified in
sending job postings. If you allow any, you have to allow all.
So, the solution is not to allow any.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 02 Sep 1998 06:42:32 -0400
From: Dave Butenhof <butenhof@zko.dec.com>
Subject: Re: Problems building threaded perl 5.005 on OSF 4.0d
Message-Id: <35ED2117.912CF8B5@zko.dec.com>
Jure Simsic wrote:
> Has anybody gotten this to work. I tried perl 5.005 and 5.005_51 but
> failed. I tried with just ./Configure --Dusethreads -des and with
> adittional -pthread to ccflags, -pthread to ldflags, -lpthread -lc_r to
> lddlflags and native malloc as described in README.threads but make
> always breaks at utf8.c. Transcript:
I've never tried to build perl with or without threads, and I doubt that
the switch errors documented in this paragraph are directly related to
your problems (though one never knows)... but I might as well set the
record straight on the switches for threaded code on Digital UNIX.
First, the ld command does not support the "-pthread" switch. If you link
using ld rather than cc, you'll need to supply the individual "-l"
switches into which the cc driver translates -pthread. To get the
absolutely correct list for any particular release of Digital UNIX, try
"cc -pthread -v foo.c". For example, for Digital UNIX 4.0D, you'll see
that this results in passing "-lpthread -lmach -lexc -lc" as the final
"-l" switches to ld. (Actually, 4.0D doesn't require -lmach, though
earlier versions of 4.0 did, and it won't hurt anything.)
Furthermore, if you use "cc -pthread" to link, there's no point to
specifying any of the equivalent "-l" switches. (Redundancy is redundant.)
If you're using "cc -c" to merely compile, without linking, (which is
implied by the fact that you're also worried about ld switches!), then the
"-l" switches don't do anything, anyway. At the compiler level (again, use
"cc -pthread -v" for the real scoop on any particular release), Digital
UNIX 4.0D "cc -pthread" results in "cc -D_REENTRANT". If, for example, you
wanted to compile using gcc, which doesn't support -pthread, you'd use
-D_REENTRANT for compilation and the "-l" list for linking.
Since Digital UNIX 4.0, libc_r is nothing but a hard link to libc. The
libc library is fully thread-safe, and has all the thread-safe functions
(e.g., the _r POSIX functions). There's no need to reference libc_r. The
libc_r name exists only so that programs linked on 3.2x systems will
continue to load.
Also, note that, as of Digital UNIX 4.0, all threaded programs require
libexc, the standard native exception support library. It is CRITICAL that
you include libexc explicitly, in the proper place on the link line. "cc
-pthread" does this for you, but if you don't use it to link, you MUST
include -lexc BEFORE -lc. Unfortunately, the exception support is split
between libexc and libc, and if libexc is pulled in indirectly (due to
libpthread's dependency), it'll be mapped AFTER libc. There's one symbol
defined by both libraries, with libc containing a non-functional STUB for
applications that don't use exceptions. If libexc gets mapped after libc,
you lose the ability to raise exceptions, and that will break any threaded
code that tries to use pthread_exit, pthread_cancel, or that relies on
signal-to-exception mapping. (It'll also break any C++ code that uses
"throw".)
/---------------------------[ Dave Butenhof ]--------------------------\
| Compaq Computer Corporation butenhof@zko.dec.com |
| 110 Spit Brook Rd ZKO2-3/Q18 http://members.aol.com/drbutenhof |
| Nashua NH 03062-2698 http://www.awl.com/cseng/titles/0-201-63392-2/ |
\-----------------[ Better Living Through Concurrency ]----------------/
------------------------------
Date: 2 Sep 1998 16:55:36 GMT
From: barbuto@zk3.dec.com (john a barbuto)
Subject: reducing the size of database files
Message-Id: <slrn6uqu48.1i9.barbuto@nethescurial.zk3.dec.com>
Greetings,
I'm wondering if anyone knows how to reduce the size of the database
files created by DB_File. By default, the files are 32K in size, but
i'd prefer them to be 8K in size. The documentation for DB_File does not
clearly indicate how to do this.
Thanks,
-jab
------------------------------
Date: Tue, 8 Sep 1998 22:53:59 -0700
From: dchen <dchen@aludra.usc.edu>
Subject: String to Binary
Message-Id: <Pine.GSO.4.02.9809082248560.24308-100000@aludra.usc.edu>
Hello,
I am trying to write a program that includes a converstion routine to
convert a string such as "10110011" into hex code "b3". I have tried to
use pack() and it didn't work. Unlike hex and oct codes to decimals with
built in perl functions hex() and oct(), I didn't find any functions that
can handle binary conversion. Are there any possibilities?
Thanks in advance!
Daniel Chen
mmmmmmmmmmmmxxxxxxxxxxxxxxxxxxxxxx
------------------------------
Date: Tue, 8 Sep 1998 23:12:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: String to Binary
Message-Id: <MPG.105fbc384bca117498983e@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <Pine.GSO.4.02.9809082248560.24308-100000@aludra.usc.edu> on
Tue, 8 Sep 1998 22:53:59 -0700, dchen <dchen@aludra.usc.edu> says...
> I am trying to write a program that includes a converstion routine to
> convert a string such as "10110011" into hex code "b3". I have tried to
> use pack() and it didn't work. ...
print unpack 'H*', pack 'B*', '10110011';
print "\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 09 Sep 1998 02:24:11 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: String to Binary
Message-Id: <x7zpc9ztv8.fsf@sysarch.com>
>>>>> "d" == dchen <dchen@aludra.usc.edu> writes:
d> Hello, I am trying to write a program that includes a converstion
d> routine to convert a string such as "10110011" into hex code
d> "b3". I have tried to use pack() and it didn't work. Unlike hex and
d> oct codes to decimals with built in perl functions hex() and oct(),
d> I didn't find any functions that can handle binary conversion. Are
d> there any possibilities?
pack works just fine. perhaps you didn't use it correctly. post your
broken code and we can see what is going on and try to fix it.
and you can use sprintf with %x or %o arguments to get hex or octal output.
hth,
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 8 Sep 1998 23:32:33 -0700
From: dchen <dchen@aludra.usc.edu>
Subject: Re: String to Binary
Message-Id: <Pine.GSO.4.02.9809082330170.12861-100000@aludra.usc.edu>
I have tried Mr. Larry Rosler's perl line and it works (except parentheses
needed around pack and unpack).
print unpack( 'H*', pack( 'B*', '10110011'));
print "\n";
Thanks again!
Regards,
Daniel Chen
mmmmmmmmmmmmxxxxxxxxxxxxxxxxxxxxxx
On Tue, 8 Sep 1998, dchen wrote:
> Hello,
>
> I am trying to write a program that includes a converstion routine to
> convert a string such as "10110011" into hex code "b3". I have tried to
> use pack() and it didn't work. Unlike hex and oct codes to decimals with
> built in perl functions hex() and oct(), I didn't find any functions that
> can handle binary conversion. Are there any possibilities?
>
> Thanks in advance!
>
>
> Daniel Chen
>
> mmmmmmmmmmmmxxxxxxxxxxxxxxxxxxxxxx
>
>
>
------------------------------
Date: Tue, 8 Sep 1998 23:49:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: String to Binary
Message-Id: <MPG.105fc4bc19fd789c98983f@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <Pine.GSO.4.02.9809082330170.12861-100000@aludra.usc.edu> on
Tue, 8 Sep 1998 23:32:33 -0700, dchen <dchen@aludra.usc.edu> says...
> I have tried Mr. Larry Rosler's perl line and it works (except parentheses
> needed around pack and unpack).
>
> print unpack( 'H*', pack( 'B*', '10110011'));
> print "\n";
If the superfluous parentheses make you feel more comfortable, by all
means use them. But they are *not* needed. Otherwise I wouldn't have
posted it that way. I assure you the code was tested before being
posted, without the parentheses.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 09 Sep 1998 05:51:17 +0000
From: aderhaag@wolfenet.com (Alan E. Derhaag)
Subject: Trouble running `make test' for mod_perl-1.-15
Message-Id: <m3soi1esve.fsf@AlanNet.wolfenet.com>
--Multipart_Wed_Sep__9_05:51:16_1998-1
Content-Type: text/plain; charset=US-ASCII
I got the source distrbution for apache-1.3.1 and apache-1.3.1+ssl
along with mod_perl-1.15. The whole thing compiled cleanly under the
apaci `The flexible way' method.. well, aside from warning that the
perl include having a slightly different definition for TRUE and
FALSE.
When running the `make test' for mod_perl, however, I get a message at
the end of the t/logs/mod_perl_error_log that says:
pre-load of `/perl/ri.pl' failed, status=404
I took the code from the t/docs/startup.pl (required by the setup for
testing) and stripped out the Apache stuff and simply printed the
files that are being pre-loaded like so:
use DirHandle ();
use strict;
my $d = DirHandle->new("t/net/perl");
for my $file ($d->read) {
next if $file eq "hooks.pl";
next unless $file =~ /\.pl$/;
print "$file \n";
}
and get the list:
uri.pl
rwrite.pl
constants.pl
log.pl
throw_error.pl
server_error.pl
qredirect.pl
ssi.pl
api.pl
taint.pl
util.pl
sym.pl
action.pl
tie_table.pl
raw.pl
cgi.pl
Sure enough the `u' gets chopped of the `uri.pl' filename. If I mv
the uri.pl to uuri.pl (changes the inode, I suppose) the make test
changes to indicate `/perl/write.pl' (supposed to be rwrite.pl the
next in the list).
The offending code:
#test Apache::RegistryLoader
{
use Apache::RegistryLoader ();
use DirHandle ();
use strict;
my $rl = Apache::RegistryLoader->new(trans => sub {
my $uri = shift;
$Apache::Server::CWD."/t/net${uri}";
});
my $d = DirHandle->new("t/net/perl");
for my $file ($d->read) {
next if $file eq "hooks.pl";
next unless $file =~ /\.pl$/;
Apache->untaint($file);
my $status = $rl->handler("/perl/$file");
unless($status == 200) {
die "pre-load of `/perl/$file' failed, status=$status\n";
}
}
}
What could cause the truncation of the filename under Apache use
(mod_perl) and not directly under perl?
--Multipart_Wed_Sep__9_05:51:16_1998-1
Content-Type: text/plain; charset=US-ASCII
Alan E. Derhaag Omnifax/Danka Industries
phone: +1 425 643 7126 1800 136th Place NE Unit #3
http://www.wolfenet.com/~aderhaag/ Bellevue, WA 98053
email: --aderhaag@wolfenet.com
--Multipart_Wed_Sep__9_05:51:16_1998-1--
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3666
**************************************