[10612] in Perl-Users-Digest
Perl-Users Digest, Issue: 4204 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 12 10:07:35 1998
Date: Thu, 12 Nov 98 07:00:28 -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, 12 Nov 1998 Volume: 8 Number: 4204
Today's topics:
Re: 64-bit Perl? (Steffen Beyer)
Re: Attempting to make my own message board (Bradley K. Farrell)
Re: Can't get DBD:DBI working... <fty@utk.edu>
Re: Comparing Arrays -- infinite loop? (Joergen W. Lang)
Re: Compiling XS's using GCC 2.8.2 (MingWin32) for Acti <msergeant@ndirect.co.uk_NOSPAM>
first meeting of Raleigh "perl mongers" group (John Klassa)
Hiding source code from priving eyes <j.bessels@wolverine.demon.nl>
Re: Hiding source code from priving eyes (Tad McClellan)
Re: Hiding source code from priving eyes <r28629@email.sps.mot.com>
Re: Installing a Perl module to Active Perl <perlguy@technologist.com>
Re: Is there a compiler for Perl? <j.bessels@wolverine.demon.nl>
Re: Is there a compiler for Perl? (Clinton Pierce)
ISA <prauz@sprynet.com>
Re: ISA <jdf@pobox.com>
losing global variable value?? (Richard Smol)
Net::FTP in CGI <mvdbijl@inedita.comx>
Re: Perl and Btrieve Support (Jeffrey R. Drumm)
Re: Perl IDE <perlguy@technologist.com>
Perl question: Arrays in Hash??? <julius@clara.net>
perl/cgi script problem in html <markns@nsclub.net>
Re: Please!Urgent!!Help me! <perlguy@technologist.com>
Q: counting packets on an Ethernet device <bnies@hsr.ch>
Setuid works as "perl suid.pl" but not "suid.pl" lee.gammell@ctaylor.co.uk
THANX Re: help explain a regx example?! dtbaker_dejanews@my-dejanews.com
Year 2000 issues with localtime & gmtime <achowe@snert.com>
Re: Year 2000 issues with localtime & gmtime (Tad McClellan)
Re: Year 2000 issues with localtime & gmtime <bill@fccj.org>
Re: Year 2000 issues with localtime & gmtime (Jeffrey R. Drumm)
Re: Year 2000 issues with localtime & gmtime <flavell@mail.cern.ch>
Re: Year 2000 issues with localtime & gmtime dave@mag-sol.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Nov 1998 12:42:52 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: 64-bit Perl?
Message-Id: <72el4c$cb2$2@en1.engelschall.com>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> <zenin@bawdycaste.org> wrote in article <910827804.653662@thrush.omix.com>:
>> : More probably Math::Pari from CPAN. Math::BigInt is almost completely
>> : broken (in design and in implementation, if not in behaviour).
>> :
>> : The only reason I wrote Math::BigInt was to test overloading :-(.
>> : Well, it improved a tiny bit since then, but only a really *tiny* bit.
>>
>> Hmm, then why is Math::BigInt core and Math::Pari not? Maybe
>> Math::BigInt/BigFloat should just be layers over Math::Pari?
> One of the reasons is that PARI distribution (required for Math::Pari
> build - but downloaded automatically, so Math::Pari is not that big)
> is of comparable size to the proper perl distribution.
> Well, probably there are no other *deep* reasons: though it is
> important that a significant part of Pari kernel is in assembler,
> there is also a portable-C flavor of the kernel, thus Pari should not
> be less portable than Perl itself.
If you use "Bit::Vector" instead you don't have any of these problems
(this module also provides "Big Integer" arithmetic).
It's written in plain (ANSI) C (so it's portable), and it's not
that big. It can even be used as a plain C library, without Perl.
Maybe it should be part of the standard distribution instead of
Math::BigInt?
Best regards,
--
Steffen Beyer <sb@engelschall.com>
Free Perl and C Software for Download:
http://www.engelschall.com/u/sb/download/
New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
------------------------------
Date: Thu, 12 Nov 1998 12:42:30 GMT
From: bradley@iinet.net.au (Bradley K. Farrell)
Subject: Re: Attempting to make my own message board
Message-Id: <364bd70d.5470786@news.m.iinet.net.au>
>Are there any other database driven forums that i can look at to see how i
>could do this?
Goodness knows, but comp.lang.perl.misc is probably not the place.
Anyway, why not check out Discus:
http://www.chem.hope.edu/discus
--
Bradley K. Farrell
bradley@iinet.net.au
------------------------------
Date: Thu, 12 Nov 1998 08:29:54 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: Can't get DBD:DBI working...
Message-Id: <364AE2D2.5CCD3548@utk.edu>
Gregory Juster wrote:
>
> Hi,
>
> Is there any good documentation and exemples of DBI out there??
> I can't find any "good".
>
> Can someone give me an exemple ??
> Let's say I have a database called MyDB and a table called employees with 3
> fields: empl_id, empl_name, empl_age
>
> I can I query those field???
>
> I'm using DBI for mSQL.
use DBI;
$driver = "mSQL";
$database = "MyDB";
$hostname = "localhost";
$port = "3306" # whatever your port is
$user = "greg";
$password = "undef";
$dsn = "DBI:$driver:$database:$hostname:$port";
$dbh = DBI->connect($dsn, $user, $password);
@databases = DBD::mysql::dr->func($host, $port, '_ListDBs');
@tables = $dbh->func( '_ListTables' );
$sth = $dbh->prepare("SELECT * FROM employees");
$sth->execute;
print "ID\tNAME\tAGE\n";
while (@row = $sth->fetchrow) {
print "$row[0]\t$row[1]\t$row[2]\n";
}
$sth->finish;
$dbh->disconnect;
exit(0);
__END__
Have you tried perldoc DBD::mSQL? Gives you a lot of info. Also try
perldoc DBI. In fact run perldoc DBI first. You really should take the
time to read the "VERY GOOD" documentation that comes with these
modules. These docs are available in pod format. Read up on pod
documentation and how to extract it out of the module.
------------------------------
Date: Thu, 12 Nov 1998 12:54:12 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Comparing Arrays -- infinite loop?
Message-Id: <1dids8o.dw6hw51p0i7ggN@host034-210.seicom.net>
Oliver Moffat <xcom2@popserver.panix.com> wrote:
> I'm trying to write a Perl script to automate the updating of a flat text
> file database. I'm trying to compare the new database of titles to the old
> databse of titles and get a list of "Brand New Titles."
>
> Everything goes fine up untill the following chunk of code where the
> actual comparison is supposed to happen. When the script gets to this
> point it gets stuck and just spins its wheels. Is there an infinite loop
> here? Is there a more efficient way to do this?
There is a fine example on how to compare two arrays against each other
which might help you simplify your task.
You can find it in perlfa4:
"How do I compute the difference of two arrays? How do I compute the
intersection of two arrays ?"
On the command line, say:
perldoc perlfaq4
hth, HANF,
Joergen
--
To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
"Everything is possible - even sometimes the impossible"
HOELDERLIN EXPRESS - "Touch the void"
------------------------------
Date: Thu, 12 Nov 1998 12:53:02 +0000
From: Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
Subject: Re: Compiling XS's using GCC 2.8.2 (MingWin32) for ActivePerl 506 - possible?
Message-Id: <364ADA2E.EE4ECDF3@ndirect.co.uk_NOSPAM>
Innovative Air Systems wrote:
>
> This is a Win32 specific question so apologies to +ACo-NIX gurus for taking up
> bandwidth.
>
> ActivePerl 506 seems to be made using MSVC, but I'd like to use GCC 2.8.2
> (Mingwin32 release) to make XS's into DLLs.
http://www.qub.com
--
<Matt/>
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: 12 Nov 1998 14:04:54 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: first meeting of Raleigh "perl mongers" group
Message-Id: <72epu6$gpe$1@aurwww.aur.alcatel.com>
The first meeting of Raleigh.pm, the Raleigh "perl mongers" group[1], will
be held next Thursday, the 19th of November, at 7:30pm. If you'd like to
attend, or have questions, drop me a line at klassa@raleigh.pm.org to find
out where the meeting will be held. :-)
Thanks,
John
[1] See http://www.pm.org for more information about perl mongers in
general. In a nutshell, we're a user's group for the perl programming
language (see http://www.perl.com for info on perl; I mention this for
those reading this message via the crosspost to triangle.general).
--
John Klassa / Alcatel / Raleigh, NC, USA / $perl_monger{Raleigh}[0] / <><
------------------------------
Date: Thu, 12 Nov 1998 12:27:34 +0100
From: Jan Bessels <j.bessels@wolverine.demon.nl>
Subject: Hiding source code from priving eyes
Message-Id: <364AC626.79250A15@wolverine.demon.nl>
Have RTFM-ed but can't find what looking for. A real advantage of
interpreted languages like Perl is that the program being executed is
available in source code and one and can change it if one wants. When
releasing a commercial product however this is a nightmare, the
cron-jewels (algoririthms etc) are there for the taking. Are there
methods to prevent this from happening, examples or urls are very much
appreciated. Things I can come up with are:
1) Possible feasible solution: Using 5.0005 one can use the experimental
but working (haven't tried it yet) Perl-to-c-compiler. It may not speed
up may progs but at least now I've got a binary executable which ppl
can't touch.
2) Just a brainstorm. Would self-decrypting encrypted programs do the
trick. But come to think of it. They have to be decrypted before feeding
them to the Perl interpreter ==> the source is furnerable. Unless I'm
missing something this isn't gonna work or is it......
3) Something from the Basic past when memory was tide. A prog which
strips of all comments, renames long sensible names fetch_next_key to x
or X$1. While not execactly hiding the crown-jewels from the priving eys
of the pirates, one can make life a bit more difficult.
Any ideas/suggestions/working examples/module etc etc are welcome. I
prefer an Email at j.bessels@wolverine.demon.nl.
Jan Bessels
============
------------------------------
Date: Thu, 12 Nov 1998 06:46:43 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Hiding source code from priving eyes
Message-Id: <jble27.jho.ln@flash.net>
Jan Bessels (j.bessels@wolverine.demon.nl) wrote:
: Have RTFM-ed but can't find what looking for.
Perl FAQ, part 3:
"How can I hide the source for my Perl program?"
: A real advantage of
: interpreted languages like Perl is that the program being executed is
: available in source code and one and can change it if one wants. When
: releasing a commercial product however this is a nightmare, the
: cron-jewels (algoririthms etc) are there for the taking. Are there
: methods to prevent this from happening, examples or urls are very much
: appreciated. Things I can come up with are:
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 12 Nov 1998 08:25:31 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Jan Bessels <j.bessels@wolverine.demon.nl>
Subject: Re: Hiding source code from priving eyes
Message-Id: <364AEFDB.B20D87B3@email.sps.mot.com>
[posted to comp.lang.perl.misc and copy emailed]
Jan Bessels wrote:
>
> Have RTFM-ed but can't find what looking for. A real advantage of
> interpreted languages like Perl is that the program being executed is
> available in source code and one and can change it if one wants. When
> releasing a commercial product however this is a nightmare, the
> cron-jewels (algoririthms etc) are there for the taking. Are there
> methods to prevent this from happening, examples or urls are very much
> appreciated. Things I can come up with are:
>
> 1) Possible feasible solution: Using 5.0005 one can use the experimental
> but working (haven't tried it yet) Perl-to-c-compiler. It may not speed
> up may progs but at least now I've got a binary executable which ppl
> can't touch.
you might want to code these 'cron-jewels' in C and make the calls from
Perl. See perldoc -q XS for more.
-tk
------------------------------
Date: Thu, 12 Nov 1998 12:06:45 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Installing a Perl module to Active Perl
Message-Id: <364ACF55.CA8B5CFB@technologist.com>
Damon Register wrote:
> There is a major problem with this. It has to go to their site to
> get files which means going through a firewall. The doc file
> containing firewall instructions is missing from the ActivePerl
> distribution so I am stuck.
>
> Damon Register
Damon,
Go to:
http://www.activestate.com/activeperl/docs/ppm.html
I found what you were looking for within a minute on thier site! I too
am going through a firewall and this is how I did it. You need to set 2
environment variables, which are listed on the web page, to get through
your firewall.
They have LOADS of documentation on thier site. I'd recommend using
thier documentation whenever possible because it should be kept more
current than what's on your hard drive...
HTH,
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 12 Nov 1998 12:19:53 +0100
From: Jan Bessels <j.bessels@wolverine.demon.nl>
Subject: Re: Is there a compiler for Perl?
Message-Id: <364AC459.D50EB760@wolverine.demon.nl>
> Yes. In the Perl 5.005 announcement, listed with other new things that are
> considered experimental:
> "A suite of compiler modules with various backends, for producing C or
> bytecode from Perl, and for various useful diagnostics."
> -> http://language.perl.com/doc/manual/html/READMEs/Announce.html
>
> See also the FAQ:
> -> http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_can_I_compile_my_Perl_progra
>
> There isn't much use for it though. From what I hear, the performance
> difference isn't all that much. I'd rather keep my Perl the way it was
> supposed to be. ;-)
When writing commercial programs distributing executables instead of the
original Perl source code is very attractive. The main advantage here
isn't speed but unreadability...
------------------------------
Date: Thu, 12 Nov 1998 14:30:04 GMT
From: cpierce1@mail.ford.com (Clinton Pierce)
Subject: Re: Is there a compiler for Perl?
Message-Id: <3664efce.513421873@news.ford.com>
On Thu, 12 Nov 1998 12:19:53 +0100, Jan Bessels
<j.bessels@wolverine.demon.nl> wrote:
>> Yes. In the Perl 5.005 announcement, listed with other new things that are
>> considered experimental:
>> "A suite of compiler modules with various backends, for producing C or
>> bytecode from Perl, and for various useful diagnostics."
>> -> http://language.perl.com/doc/manual/html/READMEs/Announce.html
>>
>> See also the FAQ:
>> -> http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_can_I_compile_my_Perl_progra
>>
>> There isn't much use for it though. From what I hear, the performance
>> difference isn't all that much. I'd rather keep my Perl the way it was
>> supposed to be. ;-)
>
>When writing commercial programs distributing executables instead of the
>original Perl source code is very attractive. The main advantage here
>isn't speed but unreadability...
Some people would consider the ability to just distribute a single
executable and a library or two the biggest win in a perl compiler.
(And utilities along the lines of "perl2exe".)
Personally, I do this all the time. It's MUCH easier to install 1 EXE
file and 2 DLL files (even if they are 3MB) than to unroll the entire
GSAR perl distribution onto a system. Especially if your customer
couldn't give a whit about development. I usually include the source
code in the distribution but for installation and distribution purposes,
nothing beats compiling/perl2exe'ing...
------------------------------
Date: Thu, 12 Nov 1998 12:09:13 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
Subject: ISA
Message-Id: <364ACFE9.78FBD597@sprynet.com>
Hello,
Let me begin with that I am a big fan of 'use strict' and the -w flag.
In many examples of object-oriented perl I see the lines:
package Car;
@ISA = qw(Vehicle);
This is not ok under use strict, only
@Car::ISA = qw (Vehicle)
My question is whether the two ISA lines mean the same. I would guess
that they are, but then all(or most) examples in the O'Reilly books are
just @ISA = ....
Thanks,
Balazs
------------------------------
Date: 12 Nov 1998 14:53:14 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Balazs Rauznitz <prauz@sprynet.com>
Subject: Re: ISA
Message-Id: <m3af1xow51.fsf@joshua.panix.com>
Balazs Rauznitz <prauz@sprynet.com> writes:
> @ISA = qw(Vehicle);
>
> This is not ok under use strict, only
> @Car::ISA = qw (Vehicle)
>
> My question is whether the two ISA lines mean the same.
They "mean the same" as long as the first line, above, happens after a
"package Car;" and before any other package pragma.
Since your own code never refers to ISA again, strict will complain
about the first usage; it's making sure you didn't make a typo. The
second usage tells the compiler: "yes, I really mean the @ISA that
appears in package Car, so bug off".
A common (and self-documenting) thing to do is
use vars qw( @ISA );
@ISA = qw( Vehicle );
perldoc vars
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 12 Nov 1998 11:33:49 GMT
From: bl227@cleveland.Freenet.Edu (Richard Smol)
Subject: losing global variable value??
Message-Id: <72eh2t$am0$1@pale-rider.INS.CWRU.Edu>
Hi there,
There is this problem I have with a perl-program that is driving me nuts.
It's Selena Sol's web-store script, that I am using with an Apache-server.
I put this script in a directory secured with an .htaccess file. For
tracking-purposes, I want to get a hold of the $ENV{'REMOTE_USER'}
variable, simply by declaring a global variable $remote_user in the
web_store.cgi script.
Whenever the program enters that long if-then list though, I lose the value
in that variable! I wondered if it had anything to to with frames or with
weird re-declarations or even with the taint-mode set on, but i can't find
anything of the kind. It happens on various machines, running Apache and
FreeBSD or Linux.
The weirdest part is though, that I originally only fetched
$ENV{'REMOTE_USER'} when displaying the order form, but then that
environment-variable turns out to be empty as well.
Could anyone give me some pointers on what I could be doing wrong?
TIA...
RS
------------------------------
Date: Thu, 12 Nov 1998 12:04:28 +0100
From: Meindert van der Bijl <mvdbijl@inedita.comx>
Subject: Net::FTP in CGI
Message-Id: <364AC0BC.64F3@inedita.comx>
I have written a CGI perl script that uses Net::FTP to
connect to a remote ftp server. When invoked from the
shell the script works fine. But from a browser the
line:
my $ftp = Net::FTP->new("some.host.name") or die print "error: $@";
gives an error: Cannot determine protocol
As far as I can see the function getprotobyname('tcp') returns
undef when the script is invoked from the browser (it returns
'6' when invoked from the shell).
Why? What can I do about it?
I use Linux, Perl 5.004_04 (i686-linux), Apache (virtual host)
Meindert
mvdbijl@inedita.com
------------------------------
Date: Thu, 12 Nov 1998 12:45:38 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Perl and Btrieve Support
Message-Id: <364bd3a0.238259569@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Wed, 11 Nov 1998 08:26:28 -0800, Lee Rouman <lrouman@definity.com> wrote:
[ rewrapped *AGAIN* - Although Communicator doesn't come close to being a
'good' news reader, it DOES let you configure line length. PLEASE fix at 72
columns. ]
>Jeffery, thanx for your response. I am aware and have used the ODBC
>functionality with Btrieve and other ODBC-compliant data structures.
>
>I was hoping for a more direct solution ala Db::Ctree or DBD::XBase.
>Anyone out there working on this type of module?
>
>Lee.
Not that I know of. Pervasive discussed the creation of such a module amongst
their development team members, but round-filed the idea when the ODBC support
for Perl appeared.
PS. If you're going to reply both via Email and Usenet, indicate so in your
message. Stealth CCs suck.
(snip)
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Thu, 12 Nov 1998 12:16:34 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Perl IDE
Message-Id: <364AD1A2.9D6B9685@technologist.com>
The nicest, only?, IDE I have found for Perl is Perl Builder
Try:
http://www.solutionsoft.com
Good luck!
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 12 Nov 1998 13:43:17 -0000
From: "Jules" <julius@clara.net>
Subject: Perl question: Arrays in Hash???
Message-Id: <72eop7$sqc$1@eros.clara.net>
Dear all Perl experts out there, is it not possible at all to have array in
a hash? I'm trying to do some backtracking using arrays as hash elements in
$self:
sub new {
# get File object to grab its filehandle
my ($class,$other) = @_;
return bless { "fh" => $other->fh(), "fill" => $fill, "pfill" => [] },
$class;
}
and then when I try to unshift and shift elements onto and from the array
"pfill" like this:
unshift($self->{pfill},$self->{fill});
$self->{fill} = shift($self->{pfill});
I get compilation error:
Type of arg 1 to unshift must be array (not hash elem)
Type of arg 1 to shift must be array (not hash elem)
Is there a way round it? I really need to use arrays for backtracking.
Thanx,
Jules
***There is not enough darkness in the whole world to extinguish the light
of a small candle***
------------------------------
Date: Thu, 12 Nov 1998 20:21:59 +0800
From: "Mark N. Salvador" <markns@nsclub.net>
Subject: perl/cgi script problem in html
Message-Id: <72ejqn$be$1@tempo.news.iphil.net>
im creating a counter for my website and when i attach the
<!--#exec cgi="http://www....../cgi-bin/counter.cgi"--> to the html file, it
cannot execute.... why?
the script file is located in cgi-bin directory
can anyone help me regarding this....
Mark
------------------------------
Date: Thu, 12 Nov 1998 12:08:37 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Please!Urgent!!Help me!
Message-Id: <364ACFC5.39034A53@technologist.com>
Try:
use CGI;
__AND__
Use your &*$%#$^ <ENTER> key so people can read your message!
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 12 Nov 1998 12:30:28 +0100
From: Bernd Nies <bnies@hsr.ch>
Subject: Q: counting packets on an Ethernet device
Message-Id: <364AC6D4.4CB0E813@hsr.ch>
Hi,
Is there a way in Perl to count the packets which go
through an Ethernet device (say eth0) on Linux? The
packets are sent from other processes.
My idea is to periodically do a grep on the output
of `ifconfig eth0` which looks like this:
eth0 Link encap:Ethernet HWaddr 00:00:C0:D4:84:0D
inet addr:152.96.131.198 Bcast:152.96.131.255
Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:452571 errors:0 dropped:0 overruns:0
TX packets:2316 errors:0 dropped:0 overruns:0
Interrupt:10 Base address:0x6400
Any better suggestions?
Thanks in advance,
Bernd
_
_____ | | ___________________________________________
\__ \| | Bernd Nies bernd.nies@astroinfo.org
/ __ \\| Chindismuelistr.6 http://www.astroinfo.org
(____ /_ CH-8626 Ottikon
\/\/
------------------------------
Date: Thu, 12 Nov 1998 11:58:26 GMT
From: lee.gammell@ctaylor.co.uk
Subject: Setuid works as "perl suid.pl" but not "suid.pl"
Message-Id: <72eih2$ltn$1@nnrp1.dejanews.com>
My setuid script switches id , then switches back again fine when run as
"perl suid.pl", but when run as "suid.pl" it will switch id, but then will
not switch back again. Is it perl (5.00404) or is it the os (Solaris 2.5) ?
script and example output shown below:
#!/usr/bin/perl
#(@) Test setuid/setgid switching
#(@) Lee Gammell (Nov-98)
# This works ok when run as "perl suid.pl" but not "suid.pl"
$ENV{PATH}="/usr/bin";
$ENV{SHELL}="/usr/bin/sh" if $ENV{SHELL} ne '';
delete @ENV{'IFS','CDPATH'};
printf("my uid = %d, gid = %d\n",$<,$() ;
system("/usr/bin/id");
# hold a copy of my uid and gid...
($old_uid,$old_gid) = ( $<,$( );
# Get the uid and gid of user informix...
($new_uid,$new_gid) = (getpwnam("informix"))[2,3];
printf("informix uid = %d, gid = %d\n",$new_uid,$new_gid) ;
# switch to informix...
($<,$( ) = ($new_uid,$new_gid);
printf("we should now be informix\n") ;
system("/usr/bin/id");
printf("Now (try to) switch back to me again\n") ;
($<,$( ) = ($old_uid,$old_gid); # but this is not working ?
printf("now my uid = %d, gid = %d\n",$<,$() ;
system("/usr/bin/id");
# The End.
$ ls -l suid.pl
-r-sr-sr-x 1 informix informix 843 Nov 11 19:10 suid.pl
[ Example output ]
$ suid.pl
my uid = 131, gid = 100
uid=131(lee) gid=100(it) euid=200(informix) egid=200(informix)
informix uid = 200, gid = 200
we should now be informix
uid=200(informix) gid=200(informix)
Now (try to) switch back to me again <== not working
now my uid = 200, gid = 200
uid=200(informix) gid=200(informix)
$ perl suid.pl
my uid = 131, gid = 100
uid=131(lee) gid=100(it)
informix uid = 200, gid = 200
we should now be informix
uid=200(informix) gid=200(informix)
Now (try to) switch back to me again <== works fine.
now my uid = 131, gid = 100
uid=131(lee) gid=100(it)
Many thanks for your time,
Lee Gammell.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 12 Nov 1998 13:50:08 GMT
From: dtbaker_dejanews@my-dejanews.com
Subject: THANX Re: help explain a regx example?!
Message-Id: <72ep2h$r53$1@nnrp1.dejanews.com>
In article <3649DB95.A7B3B71A@busprod.com>,
Dan Baker <dtbaker-@busprod.com> wrote:
> If you would care to add some annotations on what the
> regx is doing line by line I sure would find it educational...
-------------
thank you all for your responses... each person illuminated a slightly
different aspect, and thanx to you all, I got the section working! When it
was broken down into pieces I finally got it. ;)
If you all would like to collaborate and come up with good examples
illustrating references to hashes, cookies, and creating utility .pm objects
to add to the lib I'll be watching....
thanx again,
D
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 12 Nov 1998 11:58:51 +0100
From: Anthony Howe <achowe@snert.com>
Subject: Year 2000 issues with localtime & gmtime
Message-Id: <364ABF6B.84A7277D@snert.com>
localtime() returns a list where the year has had 1900 subtracted from
it.
Will this be an issue come year 2000?
--
Anthony C Howe 1489 Ch. des Collines, 06110 Le Cannet, France
+33 (0)6 1189 7378 (p) +33 (0)4 9346 8901 (f) ICQ# 7116561
mailto:achowe@snert.com http://www.snert.com/
"Little !?" - Worf
------------------------------
Date: Thu, 12 Nov 1998 06:43:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <o5le27.jho.ln@flash.net>
Anthony Howe (achowe@snert.com) wrote:
: localtime() returns a list where the year has had 1900 subtracted from
: it.
: Will this be an issue come year 2000?
Perl FAQ, part 4:
"Does Perl have a year 2000 problem?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 12 Nov 1998 12:19:23 +0000
From: Bill Jones <bill@fccj.org>
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <364AD24B.1CCE700A@fccj.org>
Anthony Howe wrote:
>
> localtime() returns a list where the year has had 1900 subtracted from
> it.
>
> Will this be an issue come year 2000?
>
> --
> Anthony C Howe 1489 Ch. des Collines, 06110 Le Cannet, France
> +33 (0)6 1189 7378 (p) +33 (0)4 9346 8901 (f) ICQ# 7116561
> mailto:achowe@snert.com http://www.snert.com/
> "Little !?" - Worf
NO, not unless your perl programmers forget to add 1900 back in
if they want 4 digit years. Research this via DejaNews, theres
been a TON of crap about this these past 8 months alone.
HTH,
-Sneex-
________________________________________________________________________
Bill Jones | FCCJ Webmaster | x3089 | http://webmaster.fccj.org:81
------------------------------------------------------------------------
__ _ RedHat 5.1 Manhatten
/ /(_)_ __ _ ___ __ http://www.apache.org
/ / | | '_ \| | | \ \/ / http://www.redhat.com
/ /__| | | | | |_| |> < http://www.perl.com
\____/_|_| |_|\__,_/_/\_\ http://www.gimp.org
------------------------------
Date: Thu, 12 Nov 1998 13:42:04 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <364ce2dd.242159667@news.mmc.org>
On Thu, 12 Nov 1998 11:58:51 +0100, Anthony Howe <achowe@snert.com> wrote:
>localtime() returns a list where the year has had 1900 subtracted from
>it.
>
>Will this be an issue come year 2000?
Sadly, yes. Many people out there just don't do their homework.
People that read the documentation, check the FAQs, and query DejaNews instead
of posting questions that have undoubtedly been asked *hundreds* of times
before will NOT see this as a Y2K issue. The Perl community _earnestly_ wants
you to become one of these people.
It will help keep the number of snotty replies to a minimum. :-)
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Thu, 12 Nov 1998 14:18:03 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <Pine.HPP.3.95a.981112141715.18252C-100000@hpplus01.cern.ch>
On Thu, 12 Nov 1998, Anthony Howe wrote:
> localtime() returns a list where the year has had 1900 subtracted from
> it.
>
> Will this be an issue come year 2000?
It will still have 1900 subtracted from it. This is only a problem for
people who have neither RTFM nor RTFFAQ.
------------------------------
Date: Thu, 12 Nov 1998 14:15:41 GMT
From: dave@mag-sol.com
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <72eqid$sb6$1@nnrp1.dejanews.com>
In article <364ABF6B.84A7277D@snert.com>,
Anthony Howe <achowe@snert.com> wrote:
>
> localtime() returns a list where the year has had 1900 subtracted from
> it.
>
> Will this be an issue come year 2000?
In the year 2000 localtime will return the year less 1900 as it has always
done.
This is covered in the docs, in the FAQ and in numerous discussions in this
newsgroup. Please try to do some research before posting.
Dave...
--
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4204
**************************************