[8197] in Perl-Users-Digest
Perl-Users Digest, Issue: 1815 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 5 07:08:23 1998
Date: Thu, 5 Feb 98 04:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 5 Feb 1998 Volume: 8 Number: 1815
Today's topics:
Re: A problem - please help (Bart Lateur)
Re: converting href and src tag values to lowercase? (Tom Grydeland)
Re: Crazy Idea <ldanna@hotmail.com>
Re: Crazy Idea (Ilya Zakharevich)
Re: Date Comparison (Philip)
Re: Don't use signal handlers (was Re: Child processes) (Ilya Zakharevich)
Re: eval FAQ??? Hardest part of perl to figure out (Bart Lateur)
Re: eval FAQ??? Hardest part of perl to figure out <joseph@5sigma.com>
Re: hexadecimal to binary conversion? KlausRusch@atmedia.net
Re: Install ques: perl modules on RH Linux (Philip)
Re: Install ques: perl modules on RH Linux (Randy J. Ray)
interpolation bug in Perl5.003_07 (Perl for Win32 build (Joe Myers)
Re: interpolation bug in Perl5.003_07 (Perl for Win32 b <joseph@5sigma.com>
Re: interpolation bug in Perl5.003_07 (Perl for Win32 b <mike@ns.minivend.com>
Re: IO::Socket::INET newbie question <xxTony.Curtis@vcpc.univie.ac.at>
Re: Is file locking necessary? (Philip)
Re: Is Perl 5 year 2000 compliant? (Abigail)
Re: Is Perl 5 year 2000 compliant? (Tiberius)
Re: Is there a WILDCARD variable in PERL??? (Bart Lateur)
perl5.004_04: make depend infinite loop (Steve Rawlinson)
Re: posix::strftime (core dumped) (Tom Grydeland)
Re: push (). <joseph@5sigma.com>
Re: push (). (Abigail)
reengineering tool <mi@init.se>
Re: solution for multiline comments??? (Bart Lateur)
UDP server that would be multi-threaded <dcox@lexmark.com>
Re: Unpack float (Bart Lateur)
Re: Web based perl script with SCCS commands (Randy J. Ray)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 05 Feb 1998 08:45:48 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: A problem - please help
Message-Id: <34db7930.4241802@news.tornado.be>
"V. Chandrasekhar" <vchandra@mail.delcoelect.com> wrote:
>1. I work with arrays of integer numbers guaranteed to
>be in the 0 to ffff range; of these, 0 to 7fff are positive
>(i.e, 0 to 32767 decimal) and ffff to 8000 are negative
>(i.e., -1 to -32768). In other words, even though, the
>basic hp computer is (I think) a 32 bit machine, these arrays
>use only 16 bits. These arrays are read in from data files.
[....]
So you're having trouble converting unsigned numbers (16-bit) to signed?
Try one of these:
$num | -($num & 0x08000)
or
unpack('S', pack('s', $num))
HTH,
Bart.
------------------------------
Date: 5 Feb 1998 09:33:52 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: converting href and src tag values to lowercase?
Message-Id: <slrn6dj1s0.feh.Tom.Grydeland@mitra.phys.uit.no>
On 4 Feb 1998 23:45:46 GMT,
Rob W. Walls <wallsr@jcave.com> wrote:
> The horrors of filename case sensitivity have caused maximum
> irritation! [...]
> but I now need to look inside EVERY html file and change all path/file
> references to lowercase also. [...]
> Anyone care to share a tip on how to do this or where to find a script
> already written to do this?
You'll need (or save time using) the following modules:
1) File::Find to traverse your file system (sub wanted { /\.html$/ })
2) HTML::Parser (which you'll need to subclass) to parse your html
correctly. You'll want to override the start method.
3) Once you've gotten this far, the rest should be simple.
> thanks,
You're welcome.
(If you're confident there are no difficult cases in your files, you
could always shortcut steps 2 and 3 and proceed directly to a
search-n-replace. This is nowhere as safe, though.)
> wallsr@jcave.com
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Thu, 05 Feb 1998 04:19:23 -0500
From: Larry D'Anna <ldanna@hotmail.com>
Subject: Re: Crazy Idea
Message-Id: <34D9841B.E0389C3@hotmail.com>
Ilya Zakharevich wrote:
>
> [A complimentary Cc of this posting was sent to Chip Salzenberg
> <chip@pobox.com>],
> who wrote in article <6b813q$rto$1@cyprus.atlantic.net>:
> >
> > Actually, the plan is more like:
> >
> > $pat = qr{
> > \d+
> > | (?:
> > \(
> > (?d $pat)
> > \)
> > )
> > | (?:
> > (?d $pat)
> > [-+*/]
> > (?d $pat)
> > )
> > }x ;
> >
> > Not in 5.005, maybe in 5.006.
>
> I'm not sure how the parser will be able to do this (?d) stuff... Too
> many new states of the lexer - at least for the implementation I see.
>
> On the other hand, the same with qr{}xd looks *very* feasible.
>
> Ilya
what would the 'd' modifier mean?
---------------------------------------------------
|Democracy is the worst system of government. --
|Except for all the others
| -Winston Churchill
---------------------------------------------------
Larry D'Anna "eschew obfuscation"
------------------------------
Date: 5 Feb 1998 11:11:42 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Crazy Idea
Message-Id: <6bc6pe$1hr$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry D'Anna
<ldanna@hotmail.com>],
who wrote in article <34D9841B.E0389C3@hotmail.com>:
> Ilya Zakharevich wrote:
> >
> > [A complimentary Cc of this posting was sent to Chip Salzenberg
> > <chip@pobox.com>],
> > who wrote in article <6b813q$rto$1@cyprus.atlantic.net>:
> > >
> > > Actually, the plan is more like:
> > >
> > > $pat = qr{
> > > \d+
> > > | (?:
> > > \(
> > > (?d $pat)
> > > \)
> > > )
> > > | (?:
> > > (?d $pat)
> > > [-+*/]
> > > (?d $pat)
> > > )
> > > }x ;
> > >
> > > Not in 5.005, maybe in 5.006.
> >
> > I'm not sure how the parser will be able to do this (?d) stuff... Too
> > many new states of the lexer - at least for the implementation I see.
> >
> > On the other hand, the same with qr{}xd looks *very* feasible.
> what would the 'd' modifier mean?
`d'elayed or postpone`d'. I call this construct embe`d'ded patterns,
so choose what you like.
Ilya
------------------------------
Date: Thu, 05 Feb 1998 07:52:01 GMT
From: fil_nospam@login.net (Philip)
Subject: Re: Date Comparison
Message-Id: <34d96f83.40858509@nntphost.login.net>
On Wed, 4 Feb 1998 22:18:31 -0500, eweiss@winchendon.com (Eric Weiss)
wrote:
>Just use a regular expression to pull apart the DB date
>and the system date. For example, the statement:
>
>($day, $month, $year) = /(\d+)-(\w{3})-(\d{4})/;
>
>should pull apart 01-Jan-1998
>
>You can use a hash to convert month abbreviations to a number. By 'a
>year ago' do you mean this day and month last year, 365 days, or
>366 days?
And their is the ever popular Date::Manip package, which does all of
this, and MORE!
-Philip
------------------------------
Date: 5 Feb 1998 06:55:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6bbnp3$6qv$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Chip Salzenberg
<chip@pobox.com>],
who wrote in article <6bbh9q$1h$1@cyprus.atlantic.net>:
> According to ilya@math.ohio-state.edu (Ilya Zakharevich):
> >My experience shows that the simple loop is safe with gcc (satrting
> >from 5.004_02?), hard loop is safe with gcc+voodo-patch.
>
> You know, there's a reason that "it works for me" is not accepted as
> proof of correctness.
Sorry, I forgot that you *prove* your patches to Perl to be correct
;-).
Ilya
------------------------------
Date: Thu, 05 Feb 1998 10:13:57 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: eval FAQ??? Hardest part of perl to figure out
Message-Id: <34e08216.6520531@news.tornado.be>
"Joseph N. Hall" <joseph@5sigma.com> wrote:
>I can't see any reason why you can't do this with references.
I can. Soft references (= lookup by name) don't work with "my"
variables.
Bart.
------------------------------
Date: Thu, 05 Feb 1998 04:41:10 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: eval FAQ??? Hardest part of perl to figure out
Message-Id: <34D9A556.E76DD7A2@5sigma.com>
Huh? There is no need for string eval in any data structures
problem in perl 5, period.
-joseph
Bart Lateur wrote:
>
> "Joseph N. Hall" <joseph@5sigma.com> wrote:
>
> >I can't see any reason why you can't do this with references.
>
> I can. Soft references (= lookup by name) don't work with "my"
> variables.
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: Thu, 05 Feb 1998 03:36:19 -0600
From: KlausRusch@atmedia.net
To: eric_gutt@mentorg.com
Subject: Re: hexadecimal to binary conversion?
Message-Id: <6bc16l$1j6$1@nnrp2.dejanews.com>
In article <886636915.819396613@dejanews.com>,
eric_gutt@mentorg.com wrote:
>
> What's a clever way to convert a hexadecimal string of
> any (reasonable) length to binary? ...
> I've done it in about 50 lines of Perl, but that seems like way
> too much code.
sub hex2bin {
return unpack('B*', pack('H*', $_[0]));
}
or if you want to implement the functionality yourself,
sub hex2bin {
my %pattern = (
'0' => '0000', '1' => '0001', '2' => '0010', '3' => '0011',
'4' => '0100', '5' => '0101', '6' => '0110', '7' => '0111',
'8' => '1000', '9' => '1001', 'A' => '1010', 'B' => '1011',
'C' => '1100', 'D' => '1101', 'E' => '1110', 'F' => '1111',
'a' => '1010', 'b' => '1011', 'c' => '1100', 'd' => '1101',
'e' => '1110', 'f' => '1111'
);
my $hex = $_[0];
$hex =~ s/([0-9a-fA-F])/$pattern{$1}/ge;
return $hex;
}
Klaus Johannes Rusch
--
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 05 Feb 1998 07:27:59 GMT
From: fil_nospam@login.net (Philip)
Subject: Re: Install ques: perl modules on RH Linux
Message-Id: <34d969ed.39428527@nntphost.login.net>
On 03 Feb 1998 10:54:03 -0500, ldavis@iago.reston.ans.net wrote:
>I was trying to install some modules last night, and
>I found that the Makefile.PL created a makefile with
>install dirs of /var/tmp/perl-root...
>
>where is Makefile.PL getting this information? I
>really have my stuff installed in /usr/lib/perl5. I know
>I can edit my Makefile manually, but I want to know the
>cause.
>
Look in the Config.pm module.
------------------------------
Date: 04 Feb 1998 23:33:50 -0800
From: rjray@localhost.localdomain (Randy J. Ray)
Subject: Re: Install ques: perl modules on RH Linux
Message-Id: <m3hg6ejyjl.fsf@localhost.localdomain>
>>>>> "Lynch" == ldavis <ldavis@iago.reston.ans.net>
>>>>> wrote the following on 03 Feb 1998 10:54:03 -0500
Lynch> I was trying to install some modules last night, and I found
Lynch> that the Makefile.PL created a makefile with install dirs of
Lynch> /var/tmp/perl-root...
Lynch> where is Makefile.PL getting this information? I really have
Lynch> my stuff installed in /usr/lib/perl5. I know I can edit my
Lynch> Makefile manually, but I want to know the cause.
A co-worked of mine ran into this. As it would happen, I had re-installed
Perl right off the bat because of a desire for 5.004_04 versus the 5.004_01
that comes with RH 5.0. As such, I didn't have the problem. When he re-built
Perl, his problems went away. My guess is that this weirdness crept in during
the generation of RH's binaries. I've mentioned this on one of the Linux-
related newsgroups. There really isn't any other way of fixing it. Just make
a new perl, and pick up the new patches as a bonus.
Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray rjray@tsoft.com
Campbell, CA randy@byz.org
Web page coming soon
------------------------------
Date: Thu, 05 Feb 1998 07:07:47 GMT
From: joe31416@voicenet.com (Joe Myers)
Subject: interpolation bug in Perl5.003_07 (Perl for Win32 build 315) - send.zip (0/1)
Message-Id: <7zdC.24$1A3.414783@news3.voicenet.com>
Running Activeware's Perl5 (downloaded file Pw32i315.exe), I
encounterd strange results, after hacking at the script, I've isolated
the program to its simplist state:
Input file (File.In): ilogout% = True
Script file (test.pl): printf("$_");
invocation: perl -w -n test.pl File.In
Clearly the output ought to be identical with the input, but it's not;
here it is:
ilogout= True
In otherwords, the '% ' got eaten.
I tracked the bug done from a much larger script! What you see is the
simplest I could make it. After narrowing in to the bug, my original
line was something like
$ot = sprintf("%04d) $_", ++$nlines);
and $ot was messed up like the above example; the workaround is
$ot = sprintf("%04d) %s", $_);
If the newsreader messes up the text, the zipfile attachment gives all
these files.
Has a newer build somewhere swatted this bug already?
------------------------------
Date: Thu, 05 Feb 1998 01:53:54 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: interpolation bug in Perl5.003_07 (Perl for Win32 build 315) - send.zip (0/1)
Message-Id: <34D97DF9.D9B8C514@5sigma.com>
Read the docs for printf/sprintf.
-joseph
Joe Myers wrote:
>
> Input file (File.In): ilogout% = True
>
> Script file (test.pl): printf("$_");
>
> invocation: perl -w -n test.pl File.In
>
> Clearly the output ought to be identical with the input, but it's not;
> here it is:
> ilogout= True
>
> In otherwords, the '% ' got eaten.
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 5 Feb 1998 09:09:48 GMT
From: Mike Heins <mike@ns.minivend.com>
Subject: Re: interpolation bug in Perl5.003_07 (Perl for Win32 build 315) - send.zip (0/1)
Message-Id: <6bbvks$893$1@ocoee.iac.net>
Joe Myers <joe31416@voicenet.com> wrote:
> Running Activeware's Perl5 (downloaded file Pw32i315.exe), I
> encounterd strange results, after hacking at the script, I've isolated
> the program to its simplist state:
> Input file (File.In): ilogout% = True
> Script file (test.pl): printf("$_");
> invocation: perl -w -n test.pl File.In
> Clearly the output ought to be identical with the input, but it's not;
> here it is:
> ilogout= True
> In otherwords, the '% ' got eaten.
> I tracked the bug done from a much larger script! What you see is the
> simplest I could make it. After narrowing in to the bug, my original
> line was something like
> $ot = sprintf("%04d) $_", ++$nlines);
> and $ot was messed up like the above example; the workaround is
> $ot = sprintf("%04d) %s", $_);
> If the newsreader messes up the text, the zipfile attachment gives all
> these files.
> Has a newer build somewhere swatted this bug already?
This is the usual -- most bugs found by new Perl programmers are in
their scripts and not in Perl.
print $_;
is what you want. The quotes are superfluous, and you don't use
printf unless you need its formatting. It WILL swallow % signs --
try %% instead of %.
$ot = sprintf("%04d) %s", ++$nlines, $_);
That is what you ultimately (appear to) want.
--
Regards,
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
If you like what you're gettin', 131 Willow Lane, Floor 2 | || _ \
keep doin' what you're doin'. Oxford, OH 45056 | || |_) |
-- Hector <mikeh@minivend.com> |___| _ <
513.523.7621 FAX 7501 |_| \_\
------------------------------
Date: 05 Feb 1998 10:17:52 +0100
From: Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
To: kellysm@ix.netcom.com
Subject: Re: IO::Socket::INET newbie question
Message-Id: <7xu3aebebj.fsf@beavis.vcpc.univie.ac.at>
Re: IO::Socket::INET newbie question, Shawn
<kellysm@ix.netcom.com> said:
Shawn> print ($pop "USER username \n");
Shawn> server. My next line "print ($pop "USER username
Shawn> \n");" doesn't seem to run. I never get the next OK
The handle needs to be flushed. And lines should be
terminated with CR LF.
You should also really use the supplied Handle methods, viz.
autoflush $pop 1;
$pop->print("USER username\r\n");
$pop->getline ....
You might like to consider using the Net::POP3 module
instead...
$wheel->reinvent(0);
hth,
tony
------------------------------
Date: Thu, 05 Feb 1998 07:44:40 GMT
From: fil_nospam@login.net (Philip)
Subject: Re: Is file locking necessary?
Message-Id: <34d96c90.40103331@nntphost.login.net>
On Tue, 3 Feb 1998 17:04:44 -0600, "Bill Genzer" <bill@fathead.net>
wrote:
>I am very new at PERL and I have just started writing my own CGI scripts
>(really editing other scripts). I have to admit it seems very simple and
>easy to learn. My question is if it is necessary to lock files before
>reading or writing to files? If it is necessary, how do you do it? I've
>seen a few ways other people do it, but it seems very complicated, I've
>heard of using something called flock? But not knowing hardly anything
>about PERL I have no Idea how to use it.
Go look at File::Flock from CPAN.
ftp://enterprise.ic.gc.ca/pub/perl/CPAN/modules/by-module/File/File-Flock-96.111802.tar.gz
>I've done a few small tests myself to see what would happen if a user tried
>to update the same file at the same time and I can't seem to get it to mess
>up,
It is possible for two users to run a CGI at the same time. It is
possible for the two copies of the CGI to mess with a file at exactly
the same time, possibly messing up the contents. However, on some
systems, the "atomic-write" will prevent many these problems form
occuring. But it pays to be paranoid.
>Is there some kind of file locking/sharing feature built in to PERL? Or
>do you have to still do it manually?
You have to do it "manualy".
------------------------------
Date: 5 Feb 1998 08:09:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <6bbs4a$r1r$1@client3.news.psi.net>
RandallBart (Barticus@worldnet.att.spam.net) wrote on 1619 September 1993
in <URL: news:6bbk6m$9co@bgtnsc03.worldnet.att.net>:
++ Abigail wrote:
++ >
++ > David Lee Lambert (lamber45@EGR.msu.edu) wrote on 1618 September 1993 in
++
++ I just calculated this: The 1618th day of Sepetember 1993 is today,
++ 1998-02-04.
++
++ But Abigail, why does your program do that? The original post had
++ today's date in a normal format.
My newsreader is error correcting.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Thu, 05 Feb 1998 10:04:41 GMT
From: Abraxas@hell.com (Tiberius)
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <34d98baa.7120918@sd.znet.com>
>"the answer to that question is in the documentation - which you should
>have read before posting here"
Well, exactly what *isn't* in the documentation? Of course it's in the
documentation. Virtually everything is. If only questions that had no
answers in the docs were posted in the newsgroups, there'd be like,
what, 2 questions a day?
The poster should be given the benefit of the doubt, that is, assume
that maybe he or she tried to find it in the docs and couldn't quite.
I realize you see the same basic questions again and again. Does that
mean you should assume the current poster's an idiot too? "I've seen
this question 40 other times, so let's shaft this guy too."
>the second, while often posted in brusque or abrupt (or sometimes
>frustrated and rude) replies, is actually *MUCH* more useful than the first
>- if no-ones ever pointed you to the perl documentation, you could missing
>out on one of perls finest resources.
Incongruous argument. Here you say "here's a new guy who is just
starting out, let's tell him to RTFM!!"
You should save the rudeness for the arrogant guy who doesn't want to
spend 5 minutes searching and reading some docs, and instead asks a NG
question, not the new guy who doesn't quite have a handle on things.
------------------------------
Date: Thu, 05 Feb 1998 08:45:42 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Is there a WILDCARD variable in PERL???
Message-Id: <34da71e9.2378966@news.tornado.be>
David Cline <webmaster@pclightning.com> wrote:
>I have over a hundred variables within the same CGI file called
>$xxxxxxxx_r --- with the xxxxxxxxx being over a hundred different words,
>but the "_r" is constent with them all. I want to add the values
>contained within these variables together. As a DOS man, I could best
>explain this like so:
>
>$sum = $*_r;
Don't attempt to do something like that. You might end up
including/changing a variable that you use for a different purpose
altogether.
Perl has a VERY NICE feature built in, that is excellent for this kind
of stuff, and where your can only dream about in other computer
languages. It is the hash, formerly known as associative array. It is,
in short, an array where the indices are text.
I prefer the latter name, as it says what it's for (looking up a value
"associated" with some key text), while the word former name says more
about how it's implemented. But "hash" is a shorter word, and there you
have it.
What it allows you to do, is build your own private "variables". You
might consider this to be a private dictionary. You can read or change
values at will, just like ordinary variables, but you won't ever stomp
on any other variables.
For example, what you would call $name_r, make this $val{'name'}. 'val'
is the name of this particular hash (you can have many at a time), %val
is the hash itself, and 'name' is the key (ID) for one particular item.
To give you a VERY BASIC example (to get a feel for things), try this:
$record{'surname'} = 'Cline'; $record{'first name'} = 'David';
print "Hi, my name is $record{'first name'} $record{'surname'}.\n";
Now, take a look at the file PERLFUNC.POD, and look up "keys", "foreach"
and "each" (and maybe even "values"). These will allow you to do similar
things to every item in a hash.
Like:
foreach $key (keys %val) {
$val{$key} += 1;
}
will add 1 to every item, and
$total = 0;
foreach $key (keys %val) {
$total += $val{$key};
}
will add them all up. BTW you can rewrite this particular case to
$total = 0;
foreach $value (values %val) {
$total += $value;
}
as TIMTOWTDI. ("There's more than one way to do it")
HTH,
Bart.
------------------------------
Date: Thu, 05 Feb 1998 11:46:28 GMT
From: steve@clara.net (Steve Rawlinson)
Subject: perl5.004_04: make depend infinite loop
Message-Id: <34d9a532.158101820@eros.clara.net>
I'm sure this problem has been discussed before but cannot remember
the conclusion.
Installing perl 5.004_04 on freebsd 2.2.5. Configure -d works as
normal until the 'make depend' which hits a loop as follows:
thanatos:[/usr/local/src/perl/perl5.004_04]# make depend
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
[...]
Same version of perl on another freebsd machine works fine.
Any suggestions?
steve
--
Steve Rawlinson
ClaraNet Ltd
steve@clara.net
0171 903 3000
------------------------------
Date: 5 Feb 1998 10:03:17 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: posix::strftime (core dumped)
Message-Id: <slrn6dj3j4.feh.Tom.Grydeland@mitra.phys.uit.no>
On Thu, 05 Feb 1998 01:20:55 +0100,
Volker Klau <volker@microdata.de> wrote:
> Hi,
>
> my Problem:
>
> POSIX::strftime( "%H:%M, on %D", localtime());
> gives a nice Segmentation fault under
> - RedHat Linux/Intel 5.0 (glibc)
> - Perl 5.004
>
> Anybody seen/solved this problem ?
Use a temporary:
@a = localtime;
POSIX::strftime("%H:%M, on %D", @a);
> Volker
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Wed, 04 Feb 1998 23:52:34 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: push ().
Message-Id: <34D9618C.189A2C3A@5sigma.com>
It looks like in most cases the new size is computed as
new max = new key + (old max / 5)
The case where the array has become "offset" because of elements
shifted from it is handled differently. In fact, what I see in the
code there puzzles me. I feel a perlbug coming on.
-joseph
Abigail wrote:
>
> It's clear what happens if we do a push @array, $var; if "fill" < "max",
> but what if "fill" == "max" and new space needs to be allocated?
> How is that done? How much space will be allocated? Is that "just enough",
> or is there an extra margin? If the latter, is that a fixed amount, or
> depended on the number of elements in the array?
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 5 Feb 1998 08:14:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: push ().
Message-Id: <6bbsd1$r1r$2@client3.news.psi.net>
Joseph N. Hall (joseph@5sigma.com) wrote on 1619 September 1993 in
<URL: news:34D9618C.189A2C3A@5sigma.com>:
++ It looks like in most cases the new size is computed as
++
++ new max = new key + (old max / 5)
That would be nice, as that would make push () O (1) amortized.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Thu, 05 Feb 1998 10:53:52 +0100
From: Michelle Sihdu <mi@init.se>
Subject: reengineering tool
Message-Id: <34D98C30.30DC6556@init.se>
Hi there
I am looking for a reverengineering-tool that can take C- and Perl-code
and generate some kind of description of which programs calling wich
and
in which order this is done. The programs are running on UNIX.
I have some ideas about how to accomplish this with the C-programs,
'cflow'
for example but what to use with Perl I have no idea about.
Does anyone have an idea?
Please answer with email: mi@init.se
Best regars
/Michelle
------------------------------
Date: Thu, 05 Feb 1998 10:13:52 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: solution for multiline comments???
Message-Id: <34df80a4.6150391@news.tornado.be>
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
>BTW. Would you ask on comp.lang.c if it maybe was possible to have
>shell style comments in c source?
Weeellllll.... "//" style comments are a pretty common feature.
Bart.
------------------------------
Date: 5 Feb 98 09:35:37 GMT
From: "Dan Cox" <dcox@lexmark.com>
Subject: UDP server that would be multi-threaded
Message-Id: <01bd3219$519f2f80$9884b89d@dancox.lexmark.com>
I have been toying with sockets on perl. I looked at the FAQ and the
perlipc manpage. This tells you how to make a multi-threaded tcp server
and that is great but I need a multi-threaded udp server. I took the code
out of the perlipc manpage for the tcp server and tried to make a
multi-threaded udp server and did not have any luck. I could not use the
accept function call because I think it is for tcp which is connection
oriented ip protocol. I then looked at the C man pages on accept, bind,
connect, listen, recv, send, shutdown, and socket. Without any luck I
could not figure out which calls can be used for tcp or udp. I know
both(udp,tcp) can use bind, socket, shutdown but I do not know about the
rest. If someone could lead me in the right direction on how to write a
mutli-threaded udp server it would be greatly appreciated. I will take any
perl code that would help in this project. The purpose of this udp server
is going to handle snmpv1 traps. It needs to be able to handle a pretty
good load at certain times so I thought it would be safe to make it
multithreaded. Any input on how to build this udp server daemon in perl
would be greatly appreciated. Thank you.
Dan Cox
------------------------------
Date: Thu, 05 Feb 1998 08:45:36 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Unpack float
Message-Id: <34d96f6e.1744308@news.tornado.be>
Paul Banks <pbanks@ix.netcom.com> wrote:
>I need to unpack a struct which contains float data.
>
>I can unpack the int, long & short, but float gives me some really weird
>results. I have read the section that says it can't be done, but that
>was last week.
>
>Does anyone have a solution other than writing a small c program to
>convert the entire struct to character data via fprintf?
Weeeeelll... I think your problem is that your C program and your Perl
don't agree on the number of bits for mantissa and exponent.
You could try unpacking the float's bits, and recomposing the float's
value.
BTW Does anybody know what is the fastest way to calculate 2^n in Perl,
where n is quite big (so bitshifting won't work, as the result won't fit
into an integer)?
Bart.
------------------------------
Date: 04 Feb 1998 23:38:32 -0800
From: rjray@localhost.localdomain (Randy J. Ray)
Subject: Re: Web based perl script with SCCS commands
Message-Id: <m3g1lyjybr.fsf@localhost.localdomain>
>>>>> "Wick" == M Wick <mwick@toy.mem.ti.com>
>>>>> wrote the following on Wed, 28 Jan 1998 15:31:37 -0600
Wick> I was just wondering if anyone knew of any scripts that might
Wick> help. I'm looking for a script, preferably perl, that can
Wick> check files in and out using the Unix SCCS command, and is
Wick> used on the web (ie CGI program). Any possible suggestions or
Wick> any help would be appreciated.
None that I know of, but be aware that programs running in the CGI environment
run with a user ID that is set by the server, not (always) that of the person
invoking the application itself. This can be handled with access control and
setuid-wrappers, but if you *do* find tools and start to evaluate them, keep
this caveat in mind.
Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray rjray@tsoft.com
Campbell, CA randy@byz.org
Web page coming soon
------------------------------
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 1815
**************************************