[18253] in Perl-Users-Digest
Perl-Users Digest, Issue: 421 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 5 18:06:27 2001
Date: Mon, 5 Mar 2001 15:05:19 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983833518-v10-i421@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 5 Mar 2001 Volume: 10 Number: 421
Today's topics:
Re: Fast BSD checksum in perl? <mischief@velma.motion.net>
Re: Fast BSD checksum in perl? <Jonathan.L.Ericson@jpl.nasa.gov>
Re: flock and close with empty read strangeness <gellyfish@gellyfish.com>
Re: Help Matt with small programs (Abigail)
Re: Help Matt with small programs <ren@tivoli.com>
How Do I UUEncode <cheesy@upb.de>
Re: How Do I UUEncode <Jonathan.L.Ericson@jpl.nasa.gov>
Re: How Do I UUEncode <mischief@velma.motion.net>
Re: How to list installed modules (MD5) <jleffler@informix.com>
Re: IE5 Instances - DBI Connect <Jonathan.L.Ericson@jpl.nasa.gov>
Re: inconsistent behavior in CGI->param()? <fchanny@lbl.gov>
Re: Is Perl right for me? <gellyfish@gellyfish.com>
Re: libnet and Net::SMTP config.pm is wrong <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Millisecond Time Help (Yes I've consulted the FAQ) (Abigail)
Re: Millisecond Time Help (Yes I've consulted the FAQ) <mischief@velma.motion.net>
Re: Newbie - Question about shift <mjcarman@home.com>
Re: Objects in Perl <mischief@velma.motion.net>
Re: Perl Internals <mischief@velma.motion.net>
Re: Perl, Cookies, and Apache. <parrot0123@yahoo.ca>
Re: Perl, Cookies, and Apache. <mischief@velma.motion.net>
Re: Perl, Perl, Perl, don't give your love to URL <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 05 Mar 2001 22:40:53 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Fast BSD checksum in perl?
Message-Id: <ta85flmd2luk62@corp.supernews.com>
Modemch <modemch@eventsdigital.com> wrote:
> Hi All.
> I'm trying to write a fast BSD checksum algorithm in perl, and, so far, the
> results are real bad. I'm using sysread, then unpack to an array, and then
> checksum the array. It's extremely slow compared to the 'sum' command.
> With C++, I'm doing this - works great:
Perl is slower than C on almost every task, and is slower than C++ on many.
That's one of the prices you pay for using Perl.
[snipped working implementation in C++]
Doing almost the same thing in Perl will be slower. You may not want to do
it in Perl if it's so small and quick in C++.
> Is there a real easy way to do this in perl that I'm just missing? the
> unpack function can do checksums, but I need the BSD one, and not the one
> it does. Thanks in advance.
If it has to be the exact same checksum, then you need to implement pretty
much the same algorithm. You can change your specs, accept the lower speed,
or use a language in which the speed is acceptable for the given algorithm.
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: 05 Mar 2001 22:39:48 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Fast BSD checksum in perl?
Message-Id: <86itlnu9fv.fsf@jon_ericson.jpl.nasa.gov>
Modemch <modemch@eventsdigital.com> writes:
> I'm trying to write a fast BSD checksum algorithm in perl, and, so far, the
> results are real bad. I'm using sysread, then unpack to an array, and then
> checksum the array. It's extremely slow compared to the 'sum' command.
> With C++, I'm doing this - works great:
[snip C++ code]
If speed is your #1 concern, Perl will disappoint. Fortunately the
Inline module (and XS for the old-fashioned :) allows C code to be
accessed from within perl scripts. There is also a C++ extension to
Inline which might meet your needs.
Jon
------------------------------
Date: 5 Mar 2001 20:56:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: flock and close with empty read strangeness
Message-Id: <980uh3$820$1@orpheus.gellyfish.com>
On Mon, 05 Mar 2001 02:34:40 -0500 ZepHead wrote:
> In article <6r94at02303mce70v55o8jcc5608ef95bp@4ax.com>,
> Bart Lateur <bart.lateur@skynet.be> wrote:
>
>
>> least, there should be at least one file mode that DOES create a file if
>> it didn't exist, DOES NOT truncate the file, and leaves the seek pointer
>> at the start of the file. Like "+<", but with built-in
>> create-if-missing. And which is garanteed to work across platforms.
>> You'd still have to truncate by hand, or maybe, just maybe, the file
>> could be automatically be truncated as soon as you write to the file.
>>
>
> yep
>
> IMHO any function that messes with a file (in any sway)
> should never mess with that file unless there is a lock.
> (I guess NT has this part right)
Get a grip. If I am creating a private temporary file for the use of
my process then if locking was to become an issue then someone would
really be in need of treatment - either me or the OS designer :)
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 5 Mar 2001 19:36:41 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Help Matt with small programs
Message-Id: <slrn9a7qm9.c20.abigail@tsathoggua.rlyeh.net>
Ren Maddox (ren@tivoli.com) wrote on MMDCCXLIII September MCMXCIII in
<URL:news:m34rx8dxaf.fsf@dhcp9-175.support.tivoli.com>:
!! On 3 Mar 2001, abigail@foad.org wrote:
!!
!! > {local $, = " ";
!! > print grep {$_ % 5 == 0} 0 .. 99
!! > }
!!
!! For that much verbiage, you might as well just use join:
!!
!! print join " ", grep { $_ % 5 == 0 } 0 .. 99;
!!
!! or, golf style:
!!
!! print join" ",grep!($_%5),0..99
!!
!! of course, skipping the local for golf gives:
!!
!! $,=" ";print grep!($_%5),0..99
!!
!! which can be improved to:
!!
!! $,=$";print grep!($_%5),0..99
If you want to play golf, this wins 4 strokes, and doesn't
sacrifise the non-local change to $,:
print"@{[map$_*5,0..19]}"
Or, if you don't want to do the arithmetic yourself:
print"@{[map$_*5,0..99/5]}"
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: 05 Mar 2001 13:50:25 -0600
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Help Matt with small programs
Message-Id: <m3snksc7we.fsf@dhcp9-175.support.tivoli.com>
On 5 Mar 2001, abigail@foad.org wrote:
> Ren Maddox (ren@tivoli.com) wrote on MMDCCXLIII September MCMXCIII in
> <URL:news:m34rx8dxaf.fsf@dhcp9-175.support.tivoli.com>:
> !!
> !! $,=$";print grep!($_%5),0..99
>
> If you want to play golf, this wins 4 strokes, and doesn't
> sacrifise the non-local change to $,:
>
> print"@{[map$_*5,0..19]}"
>
> Or, if you don't want to do the arithmetic yourself:
>
> print"@{[map$_*5,0..99/5]}"
Yeah, I had almost included:
print"@{[grep!($_%5),0..99]}"
but it wasn't any shorter, so I didn't bother. I was restricting
myself to testing the given range rather than using a generative
solution, but I guess that was pretty silly once golf came into the
picture. ;)
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 5 Mar 2001 21:00:17 +0100
From: "Bjoern Kaiser" <cheesy@upb.de>
Subject: How Do I UUEncode
Message-Id: <980r9g$no0$05$1@news.t-online.com>
Hi
how do I uuencode a binary file to send it as an Email-Attachment with
sendmail.
thx bjoern
------------------------------
Date: 05 Mar 2001 22:22:27 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: How Do I UUEncode
Message-Id: <86r90bua8s.fsf@jon_ericson.jpl.nasa.gov>
"Bjoern Kaiser" <cheesy@upb.de> writes:
> how do I uuencode a binary file to send it as an Email-Attachment with
> sendmail.
Why not write a perl script to help you do this? :) Perlhaps you can
find a useful module at http://search.cpan.org/. Also search the Perl
FAQ, which addresses at least part of this question.
Jon
------------------------------
Date: Mon, 05 Mar 2001 23:04:34 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: How Do I UUEncode
Message-Id: <ta86s2g9cdl114@corp.supernews.com>
Bjoern Kaiser <cheesy@upb.de> wrote:
> Hi
> how do I uuencode a binary file to send it as an Email-Attachment with
> sendmail.
MIME::Lite handles attachments. Perhaps this would be a good way to
implement your solution.
Chris
--
Christopher E. Stith
You can never entirely stop being what you once were. That's
why it's important to be the right person today, and not put
it off till tomorrow. -- Larry Wall, 3rd State of the Onion
------------------------------
Date: Mon, 05 Mar 2001 19:28:38 GMT
From: Jonathan Leffler <jleffler@informix.com>
Subject: Re: How to list installed modules (MD5)
Message-Id: <3AA3E8CC.AE1CE4D6@informix.com>
Bart Lateur wrote:
>
> Børge Haga wrote:
>
> >1) This is probably a stupid question, but is there an easy way to detect
> >which modeules have been installed for a Perl installation? I need to
> >have MD5 installed, but I'm not sure if it's part of the standard
> >distribution and I don't even know which distribution have been
> >installed on the machine in question.
>
> use MD5;
>
> If it's not installed, the script won't run. You can try this at the
> command line, if you can telnet in:
>
> perl -MMD5 -e ''
>
> If it doesn't complain, the file is installed.
>
> >2) If it's not installed, where is the correct place to go and get it?
>
> CPAN (<search.cpan.org>), or Activestate's website if it's for Win32
> (under /PPMpackages/5.6/). Also check out the FAQ in perlfaq8:
>
> * How do I install a module from CPAN?
> * How do I keep my own module/library directory?
There's a module Inside by PHOENIX available from CPAN which tells you
what you've got installed. You access it from a web-server, typically:
http://some.webserver.com/cgi-bin/inside
Apparently, I've currently got 932 modules installed, and the list
starts:
Algorithm::Diff (version unknown) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0
Algorithm::DiffOld (version 1.1) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0
Algorithm::Numerical::Shuffle (version unknown) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0
AnyDBM_File (version unknown) found in /usr/perl/v5.6.0/lib/5.6.0
Apache (version 1.27) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0/sun4-solaris-64int
Apache::AuthDBI (version 0.88) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0
Apache::Connection (version 1.00) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0/sun4-solaris-64int
Apache::Constants (version 1.09) found in
/usr/perl/v5.6.0/lib/site_perl/5.6.0/sun4-solaris-64int
Sorry about the wrapping -- wonderful stuff, Netscape!
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"
------------------------------
Date: 05 Mar 2001 21:59:32 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: IE5 Instances - DBI Connect
Message-Id: <86vgpnubaz.fsf@jon_ericson.jpl.nasa.gov>
"Trevor Ward" <tward10@jaguar.com> writes:
> I know this is really a browser issue but I was hoping somebody may have hit
> this problem before. and be able to enlighten us to a solution. Or
> alternatively HELP please so far our production Database Password has been
> displayed. whoops but fixed the error display problem.
Please don't do this. You know this is the *wrong* place to ask the
question and yet you ask it anyway. Each time you ask an off-topic
question, you get more people putting you in their kill-files, you
encourage others to do the same, you get bad advice, you hurt the
credibility of both yourself and your organization, you waste other
people's time and resources, and you deny people who are interested in
discussing your question an opportunity to do so.
Just to be clear, with this sort of problem you need to check the
relevant documentation, search archives, FAQs, web pages, etc., and
ask in the correct newsgroup or mailing list as a last resort. You
will be expected to provide a minimal test case with input, and
expected and actual output.
Jon
------------------------------
Date: Mon, 05 Mar 2001 13:18:01 -0800
From: Frank Hanny <fchanny@lbl.gov>
Subject: Re: inconsistent behavior in CGI->param()?
Message-Id: <3AA40289.A82D8277@lbl.gov>
Martin,
The issue arose because of an attempt to use CGI.pm with DBI.pm to
initialize a form. First, imagine the following SQL (this is Oracle
syntax but the point is that the first column does not allow nulls and
the second does):
drop table fch_temp;
create table fch_temp ( emplid varchar2(6) not null, effdt date );
create unique index fch_temp_ix on fch_temp ( emplid );
insert into fch_temp values ( '123', null );
insert into fch_temp values ( '456', '01-jan-01' );
commit;
Now, the following somewhat lengthy test program will behave well if
'Listref' is pushed, and badly if 'List' is pushed (the non-null date
ends up in the wrong row), all because of the difference originally
cited.
Is this the best way to achieve the desired result? Quite possibly not.
Should it work, given the advertised interface? Yes, in my opinion.
As for GIGO, my point is that two alternate syntaxes, claimed to be
equivalent, should behave equivalently.
Thanks also to Charles K. Clarkson for delving into the innards of
CGI.pm to explain the difference in behavior.
Frank Hanny
#!/usr/local/bin/perl
use strict;
use CGI();
use DBI;
#this one retains null values
sub Fetch_Params_Listref
{
my ( $q, $sth ) = @_;
my
(
$first,
$column_name,
$value,
$value_list,
$results,
%data_hash,
);
$first = 1;
while( $results = $sth->fetchrow_hashref() )
{
while( ( $column_name, $value ) = each %$results )
{
$data_hash{ lc $column_name } = [] if $first;
push @{ $data_hash{ lc $column_name } }, $value;
}
$first = 0;
}
while( ( $column_name, $value_list ) = each %data_hash )
{
$q->param(-name=>$column_name, -value=>$value_list); #good
}
$sth->finish;
return 1;
}
#this one discards null values
sub Fetch_Params_List
{
my ( $q, $sth ) = @_;
my
(
$first,
$column_name,
$value,
$value_list,
$results,
%data_hash,
);
$first = 1;
while( $results = $sth->fetchrow_hashref() )
{
while( ( $column_name, $value ) = each %$results )
{
$data_hash{ lc $column_name } = [] if $first;
push @{ $data_hash{ lc $column_name } }, $value;
}
$first = 0;
}
while( ( $column_name, $value_list ) = each %data_hash )
{
$q->param( $column_name, @$value_list ); #bad
}
$sth->finish;
return 1;
}
sub Form_Array
{
my ( $q ) = @_;
my
(
$row,
@html,
);
foreach ( $q->param('emplid') ) #the non-null key field
{
push @html,
$q->textfield(-name=>'emplid',
-value=>( $q->param('emplid') )[ $row ],
-override=>1 ),
$q->textfield(-name=>'effdt',
-value=>( $q->param('effdt') )[ $row ],
-override=>1 ),
'<br>',
;
++$row;
}
return @html;
}
#----------------------------------------------------------------------
# main
#----------------------------------------------------------------------
my $q;
my $dbh;
my $sth;
my @html;
$q = CGI->new();
$dbh = DBI->connect( "dbi:Oracle:HRDEV","USER/PASSWD", '' ) || die
$DBI::errstr;
$sth = $dbh->prepare( 'select * from fch_temp' );
$sth->execute();
if ( $q->param('Listref') )
{
Fetch_Params_Listref( $q, $sth ); #works as desired
}
elsif ( $q->param('List') )
{
Fetch_Params_List( $q, $sth ); #drops null values
}
$dbh->disconnect;
push @html,
$q->header(),
$q->start_html(),
$q->start_form(),
;
if ( $q->param() )
{
push @html, Form_Array( $q );
}
push @html,
$q->submit('List'),
$q->submit('Listref'),
$q->end_form(),
$q->dump(),
$q->end_html();
print @html;
Martin Vorlaender wrote:
>
> Frank Hanny (fchanny@lbl.gov) wrote:
> > In the following program, I would expect the contents of parameters 'a'
> > and 'b' to be the same. Instead, 'a' contains only 3 elements, while 'b'
> > contains 6. Is this a bug or a feature?
> >
> > #!/usr/local/bin/perl
> > use strict;
> > use CGI();
> >
> > my $q;
> >
> > $q = CGI->new();
> >
> > $q->param( 'a', 0, undef, 1, undef, 2 );
> > $q->param( -name=>'b', -value=>[ 0, undef, 1, undef, 2 ] );
> >
> > print
> > $q->header(),
> > $q->start_html(),
> > $q->dump(),
> > $q->end_html();
>
> Care to tell how you would produce undefined values by "normal" means?
>
> IMHO, param() doesn't have to deal with undefined values properly.
> This is neither a bug nor a feature - it's outside of the values'
> domain. Garbage in, garbage out.
>
> cu,
> Martin
> --
> One OS to rule them all | Martin Vorlaender | VMS & WNT programmer
> One OS to find them | work: mv@pdv-systeme.de
> One OS to bring them all | http://www.pdv-systeme.de/users/martinv/
> And in the Darkness bind them.| home: martin@radiogaga.harz.de
------------------------------
Date: 5 Mar 2001 18:53:00 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is Perl right for me?
Message-Id: <980nac$757$1@orpheus.gellyfish.com>
On 4 Mar 2001 19:13:00 -0000 Jonathan Stowe wrote:
> On Sun, 04 Mar 2001 13:19:21 GMT Bart Lateur wrote:
>> Holly Bortfeld wrote:
>>
>>>I can write HTML
>>>from scratch without an editor.
>>
>> Wow, that is strong. So how do you write HTML? Using a speech
>> recognition system?
>>
>
> copy CON: somefile.html
>
> or
>
> cp /dev/tty somefile.html
>
or of course the editor of champions :
dd if=/dev/tty of=somefile.html
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 05 Mar 2001 21:25:20 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: libnet and Net::SMTP config.pm is wrong
Message-Id: <864rx7vrgf.fsf@jon_ericson.jpl.nasa.gov>
Alan Pettigrew <alan1.pettigrew1@fox1-europe1.com> writes:
> I have just installed libnet (1.06) with PPM on 2 NT machines.
CPAN has libnet-1.0703.tar.gz that seems to fix the problem you
mentioned. It seems reasonable to expect whoever provided the PPM to
upgrade the package. Alternativly, you could get and install the
package directly from CPAN. (You may need make (or nmake from
Microsoft), but I don't think you need a C compiler.
http://cygwin.com offers a very useful development environment for
Win32.)
Jon
------------------------------
Date: 5 Mar 2001 19:43:55 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Millisecond Time Help (Yes I've consulted the FAQ)
Message-Id: <slrn9a7r3r.c20.abigail@tsathoggua.rlyeh.net>
Steven Morrow (donotreply@interbulletin.bogus) wrote on MMDCCXLIII
September MCMXCIII in <URL:news:3AA3C4A2.19D49B47@interbulletin.com>:
== I'm trying to time stamp data entries, but second time is not of high enough
==
== I have consulted perlfaq8 which suggests using Time::HiRes to get time of day
==
== I am using Windows NT 4.0 with Active Perl v5.6.0 bulit for MSWin32-x86-multi
==
== I downloaded the Time::HiRes module from CPAN and extracted it to my c:\perl\
==
== Then I tried to manually run the test perl script.
So, you build it, tested it, didn't install it, and now you are
surprised Perl could find it?
Next, please the file called README.
And don't use lines of 72 characters. Not everyone has a six foot wide
monitor, and those who do generally don't maximize their windows.
Abigail
------------------------------
Date: Mon, 05 Mar 2001 22:33:59 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Millisecond Time Help (Yes I've consulted the FAQ)
Message-Id: <ta852ncoe41794@corp.supernews.com>
Steven Morrow <donotreply@interbulletin.bogus> wrote:
> I'm trying to time stamp data entries, but second time is not of
> high enough resolution to be unique.
This isn't so much a language or timing issue as it is an approach
issue.
If you want unique fields, serialize the field. This is what you'd
find in the first chapter of a database management or information
storage textbook.
One of the better ways to serialize a field from Perl is to use
the DBI or perhaps DBIx::Recordset to connect to a database backend,
and use the database's serialization methods.
There are other ways, of course, to serialize a data set entry (row),
but if you're getting so many updates and additions to the data that
each process ID has more than one update per second, then a database
is probably a good idea anyway.
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: Mon, 05 Mar 2001 13:16:13 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Newbie - Question about shift
Message-Id: <3AA3E5FD.3EEFCCBF@home.com>
Rick M wrote:
>
> I have seen this in a number of scripts and can't quite figure it out.
> my $var = shift;
> Would someone be kind enough to elaborate on the books explanation,
> pp 189 of Programming Perl 2nd ed.
Did you try consulting the documentation? Type 'perldoc -f shift' at a
command line and see what happens!
> I am guessing that this is totally different that
> shift(@array);
Not at all, it's just using a default argument. Inside a subroutine it's
shorthand for writing
my $var = shift(@_);
outside one, it's shorthand for
my $var = shift(@ARGV);
But the shift manpage could have told you that. Learn to use the
documentation that comes with Perl, and always check there before
posting here. (It's faster, often better, keeps this newsgroup for
getting overloaded, and gives you a warm fuzzy feeling from having
helped yourself.)
-mjc
------------------------------
Date: Mon, 05 Mar 2001 21:34:22 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Objects in Perl
Message-Id: <ta81iufa9r2150@corp.supernews.com>
Jonathan Rew <jon_rew@learn-it.demon.co.uk> wrote:
> Hi
> I've been using Perl just as a procedural language for all my programs
> to date. I'm certain that it is much more efficient to use objects in Perl,
> but can't make head or tail of them. Can anyone suggest a good place to
> look, book to read, etc?
Don't assume the object orientation is more efficient. It can be more
promgrammer efficient, but isn't always. It can be more running time
efficient, but isn't always. It can be more memory efficient, but
often is not (usually is not, in my experience).
The methodology and theory under which you choose to program should be
mostly decided by with what ideaology you are most comfortable. Second
to that, code reuse and maintenance time should be the improtant factors.
Beyond those, running time and memory efficiency can be important to
particular projects.
Chris
--
Christopher E. Stith
The purpose of a language is not to help you learn the
language, but to help you learn other things by using the
language. --Larry Wall, The Culture of Perl, August 1997
------------------------------
Date: Mon, 05 Mar 2001 20:40:59 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Perl Internals
Message-Id: <ta7uerkdbabv79@corp.supernews.com>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Sat, 3 Mar 2001 16:17:45 -0500 Eduard Grinvald wrote:
>> Hello All!!
>> Is there any place where i can determine how perl internally represents data
>> types and objects. Mostly, i need to know the level of number precision and
>> how many bytes do references, ints, hashes, etc take up.
>>
> This kind of stuff is not documented, you will have to consult the
> Perl source code.
Since Perl is implemented in C, and C's primitive data types are allowed to be
different sizes as the platform allows, it would be good not only to know how
Perl maps its data types to C types, but also to know how those types are
respresented on the platform in question.
For all I know, every type in Perl maps to a certain defined type in C which
is defined conditionally based on the platform. Somehow, though, I doubt this.
I'm sure some values in Perl are a different size on different platforms due
to mapping against C types which are different on those platforms. I do know
that there are options to make Perl numbers 64 bits instead of 32 at Perl build
time. There is a pragma to use ints instead of doubles within a block of a Perl
program. Refs, in my mind, are likely whatever size the C compiler on the
platform uses for pointers (although I have not read the source closely enough
to know for sure).
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: Mon, 05 Mar 2001 20:38:22 GMT
From: "Parrot" <parrot0123@yahoo.ca>
Subject: Re: Perl, Cookies, and Apache.
Message-Id: <2PSo6.374099$JT5.11955876@news20.bellglobal.com>
Mark W. Schumann <catfood@apk.net> wrote in message
news:980kms$511@junior.apk.net...
> In article <MC4o6.302324$Pm2.4386543@news20.bellglobal.com>,
>
> This is where the right thing to do is to write, "Ooops, sorry, I'm new
> here and didn't understand the culture well enough. I'll go back to
> lurking for a while to get a better idea of what the group's like."
>
No, that would be a silly thing to do. The right thing to do would have
been for nobody to get upset over this in the first place. If I have
something I'd like to say, or a question to ask, I'm going to do it.
My question was at least somewhat related to Perl - at first I'd thought it
was more related to Perl than it was. Did you expect me to know that it
could be considered 'off topic' when I didn't even know what the answer to
my problem was? Do you expect that 'lurking' for a few days would have
given me the answer?
> No, but the doctor gets paid for the office visit anyway. The people
> answering questions here do it for free, because they like Perl and
> want to help people. Goodwill for goodwill, eh?
That's my point - these people are answering questions out of goodwill, why
don't they show it better?
> Because sometimes helping people is made more difficult than it should be.
I'm sorry, but NO, absolutely not! Helping people is not made more
difficult by people asking questions that to the experts seem silly and
maybe a little off topic. People may ask questions that seem silly to the
experts - but what may be real basic to the experts won't be to somebody
else. I've tutored people on many occasions in computer topics, and I've
noticed coleagues of mine getting rather more frustrated than they should
with people asking for help just because the students aren't as knowledgable
about the subject.
Some people pretend like they're there to help, but have such a snotty
attitude about it that you feel like an idiot if you ask a simple question.
They really just want to prove that they know more than you do. I can't
stand people like that, and I'm not about to take crap from people like that
online.
The way I see it, if you're going to help somebody, don't go putting them
down because they asked a question. That's not helping.
------------------------------
Date: Mon, 05 Mar 2001 22:10:51 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Perl, Cookies, and Apache.
Message-Id: <ta83nb89me0553@corp.supernews.com>
Mark W. Schumann <catfood@apk.net> wrote:
> In article <MC4o6.302324$Pm2.4386543@news20.bellglobal.com>,
> Parrot <parrot0123@yahoo.ca> wrote:
>>Oh yes, they read a message and find it irrelevant - high cost indeed - boy,
>>that's something you could just go on a killing spree about! Gee... so it's
>>wasting the time of helpers, who, in turn go back and waste even more time
>>on pointless flames against the offender.
Telling someone that a question is off-topic is not a flame. If you think
that's a flame, then you've never been flamed.
> This is where the right thing to do is to write, "Ooops, sorry, I'm new
> here and didn't understand the culture well enough. I'll go back to
> lurking for a while to get a better idea of what the group's like."
Maybe this is too far the other way. I'd say it'd be good for someone
who just posted off-topic to post "Sorry for being off-topic. I'll try
to make sure my next post s on-topic."
>>Don't get me wrong, I appreciate that people are willing to put so much of
>>their time into helping others in the newsgroup, but if they're here to help
>>they could at least have a better attitude about it. Doctors see patients
>>all day long, and sometimies a hypochondriac will come in thinking he has
>>some serious disease but really doesn't. Does the doctor say "Get out of
>>here you idiot, you're wasting my valuable time!"
A hypochondriac at a general practitioner's office is one thing. Someone
with a head trauma going to a cardiologist is another. Referrals to other
places is common practice.
> No, but the doctor gets paid for the office visit anyway. The people
> answering questions here do it for free, because they like Perl and
> want to help people. Goodwill for goodwill, eh?
Not everyone here shows goodwill on either side of the aisle, but that
falls on the people, not the group as a whole.
>>Of course not, and why? Because the doctor is there to help people, and
>>sometimes the help a person needs isn't so much medical. The people here
>>are giving Perl help for free - you'd assume that the reason they're doing
>>it is because they like to help people. So why aren't they happier about
>>it? Why do they find the act of giving help so stressful that the smallest
>>inconsistency can unleash their wrath?
Ever watch the TV show "Becker"? :-/ Really, using the hypochondriac
analogy, if I was a doctor I'd refer a hypochondriac to a pathologist
the first time to make sure it's not a rare thing I had missed. Once
I was sure it wasn't a real illness, I'd refer them to
psychiatric/psychological help if it really seemd to be hypochondria or
perhaps a drug treatment program if they were just seeking meds.
> Because sometimes helping people is made more difficult than it should be.
True, and saying a post is off-topic is not cruel or unhelpful. If a person
is posting off-topic posts, it is often a sign that they do not understand
the problem or the nature of the tools being used. Pointing out someone's
mistake holds a great potential to help.
>>That's pretty much the way I feel. And I've got to tell you, if I was
>>looking through messages and found one that was a little off topic but that
>>I could help with anyway, I'd give my help and feel darn good about it. :)
A little off topic is one thing. Some people consider this to be the place
for CGI questions, database questions, web server configuration questions,
FTP questions, sendmail questions, shell questions, and many others. If
you gladly help with off-topic posts, you get more of them. The more of them
you get in the group, the less helpful the group is as a source of information
on its givven topic. This principle is exactly why there's not one big group
called usenet.the -- and is also why comp.lang.perl was split into
comp.lang.perl.misc, comp.lang.perl.moderated, comp.lang.perl.modules, and
comp.lang.perl.tk (and no longer exists as its own group). If we wanted all
of the computer related questions in one group, the comp heirarchy would
be one huge unmanageable mess under the name `comp.misc'.
Chris
--
Christopher E. Stith
Even in the worst of times, there is always someone who's
never had it better. Even in the best of times, there is
always someone who's never had it worse.
------------------------------
Date: 5 Mar 2001 21:15:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl, Perl, Perl, don't give your love to URL
Message-Id: <980vlu$89d$1@orpheus.gellyfish.com>
On Sun, 04 Mar 2001 20:37:21 GMT Parrot wrote:
> David Wall <darkon@one.net> wrote in message
> news:90519AAC3darkononenet@206.112.192.118...
>>
>> The subject line is really all I had to say. But I suppose it could be
>> taken as a plea to not equate Perl with CGI programming.
>>
> It's true enough that Perl is used for more than just CGI programming -
> however - Perl is a very popular language when it comes to CGI programming
> and I think that must be acknowledged.
>
[gellyfish@orpheus work]$ find PerlModules -name '*.pm' -print | xargs wc -l
<snip>
11148 total
(Hmm less than I thought ... :)
This code might be used in support of CGI programming but that is certainly
not its first purpose - and the project is only 1/3 finished. And of course
in 2001 'Web Programming in Perl' != CGI ....
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V10 Issue 421
**************************************