[19972] in Perl-Users-Digest
Perl-Users Digest, Issue: 2167 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 20 21:05:48 2001
Date: Tue, 20 Nov 2001 18:05:09 -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: <1006308308-v10-i2167@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 20 Nov 2001 Volume: 10 Number: 2167
Today's topics:
Re: Absolute newbie question: Which book? <dha@panix.com>
Re: Can I avoid 2 passes? <uri@stemsystems.com>
Re: Can I avoid 2 passes? <godzilla@stomp.stomp.tokyo>
Re: Can I avoid 2 passes? <godzilla@stomp.stomp.tokyo>
Re: Can I avoid 2 passes? <mgjv@tradingpost.com.au>
Re: Can I avoid 2 passes? <ahamm@programmer.net>
Re: Can I avoid 2 passes? <godzilla@stomp.stomp.tokyo>
Re: Can I avoid 2 passes? <mgjv@tradingpost.com.au>
Re: Can I avoid 2 passes? <godzilla@stomp.stomp.tokyo>
Re: elsif problems (Matt)
Re: EOF testing (Jon Bell)
Re: EOF testing <jeff@vpservices.com>
Re: EOF testing <ahamm@programmer.net>
Re: EOF testing <ahamm@programmer.net>
Re: EOF testing <joe+usenet@sunstarsys.com>
Re: Frames and Headers <dha@panix.com>
Re: Generating graphs using Perl for Windows <justin.devanandan.allegakoen@intel.com>
has anyone tried activestate perl under solaris? <nobody@nowhere.com>
Re: help w/ error: 'package does not return true' <mbudash@sonic.net>
Re: help w/ error: 'package does not return true' <brice@webprojkt.com>
Re: How do I make several modules reference variables f <jazz450@hotmail.com>
Re: How do I make several modules reference variables f <mgjv@tradingpost.com.au>
Re: how to calculate the CRC of a string... <adam@scan.mc.xerox.com>
Re: multiple arrays as arguments <mgjv@tradingpost.com.au>
Re: multiple arrays as arguments <uri@stemsystems.com>
Perl Make Fails -- DB_File.xs <jarp@pdq.net>
Re: result pages (10 by 10) <ahamm@programmer.net>
Re: using sendmail from perl (Wiliam Stephens)
Re: using sendmail from perl <zkent@adelphia.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Nov 2001 23:12:52 GMT
From: "David H. Adler" <dha@panix.com>
Subject: Re: Absolute newbie question: Which book?
Message-Id: <slrn9vlork.1d8.dha@panix2.panix.com>
In article <3BFA8336.A122DB41@mail.uca.edu>, Cameron Dorey wrote:
>
> I beg to differ. If you're just starting out, and particularly if you
> just have experience on Windows, get LPW32S (the Gecko book), because
> there is a good bit of stuff in the LLama (not the Camel) that is
> confusing to a Window$ user, and it is NOT pointed out that is it
> specific to *x. The newer stuff in 5.6 can be discovered after you have
> mastered the basics.
The one possible caveat here is the question of whether the gecko has
been updated to reflect the recent revision of the llama.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
So get it on paper, with a signature, so you can wave it at them. If
that doesn't work, use weapons.
- David Cantrell
------------------------------
Date: Tue, 20 Nov 2001 23:46:41 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Can I avoid 2 passes?
Message-Id: <x7wv0lc8dd.fsf@home.sysarch.com>
>>>>> "DH" == Dale Henderson <nilram@boisdarc.tamu-commerce.edu> writes:
>>>>> "DM" == Drew Myers <bh_ent@hotmail.com> writes:
DM> Effectively, I'd like to combine the split and join statements
DM> above, but I'm not sure exactly how to do that, or if it's
DM> even a viable solution.
DH> You can always use the regex approach
DH> if(/^([^:]+);(.*)/){
^
tr/;/:/
and make sure you read bart's reply to moronzilla. you will learn why
she should be ignored here. first she says use associative arrays over
hashes which is plain stupid. then she says use arrays over hashes which
for this problem (indexing by user names from /etc/passwd) is plain
wrong. so which is she, stupid or wrong?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 20 Nov 2001 15:54:11 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Can I avoid 2 passes?
Message-Id: <3BFAED23.7D7FEDDD@stomp.stomp.tokyo>
Bart Lateur wrote:
> Godzilla! wrote:
> >> So what's the difference between a hash and and associative array?
> >Format, creation and access methodologies along with efficiency.
> You stupid person. A "hash" is simply another shorter name for an
> "associative array". Technically, they're the same thing.
> So what's the difference between a car and an automobile?
You state, with clarity, an associative array and a hash
are the same, identical, no difference between the two.
This you have stated, without any doubt.
Based on your high logic, my script beneath my signature will
perform with perfection by printing my data, flawlessly.
Godzilla!
--
#!perl
while (<DATA>)
{
$Users{substr ($_, 0, index ($_, ":"))} = substr ($_, index ($_, ":") + 1);
push (@Array, $_);
}
print "Hash:\n %Users\n\n";
print "Array:\n @Array";
__DATA__
user1:pass1:uid1:gid1:gecos1:home1:shell1
user2:pass2:uid2:gid2:gecos2:home2:shell2
------------------------------
Date: Tue, 20 Nov 2001 16:12:25 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Can I avoid 2 passes?
Message-Id: <3BFAF169.1C6A2CF5@stomp.stomp.tokyo>
Uri Guttman wrote:
> Dale Henderson wrote:
> > Drew Myers wrote:
(snipped)
> and make sure you read bart's reply to moronzilla. you will learn why
> she should be ignored here. first she says use associative arrays over
> hashes which is plain stupid. then she says use arrays over hashes which
> for this problem (indexing by user names from /etc/passwd) is plain
> wrong. so which is she, stupid or wrong?
pfffttt... you are pissed off because you cannot
create a methodolgy which is quicker and more
efficient than mine.
Such a delicate easily frightened little boy.
Will you forgive me for being a more talented
Perl programmer than you? I just cannot help it.
Truly, it is not my fault nor intentional.
Godzilla!
------------------------------
Date: Wed, 21 Nov 2001 00:18:01 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Can I avoid 2 passes?
Message-Id: <slrn9vlslp.hmq.mgjv@verbruggen.comdyn.com.au>
On Tue, 20 Nov 2001 15:54:11 -0800,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Bart Lateur wrote:
>
>> Godzilla! wrote:
>
>> >> So what's the difference between a hash and and associative array?
>
>> >Format, creation and access methodologies along with efficiency.
>
>> You stupid person. A "hash" is simply another shorter name for an
>> "associative array". Technically, they're the same thing.
>
>> So what's the difference between a car and an automobile?
>
> You state, with clarity, an associative array and a hash
> are the same, identical, no difference between the two.
> This you have stated, without any doubt.
You fail to see the difference between the technical terms "array" and
"associative array". Associative array is the old name for a hash.
This terminology was in use in the Perl 4 documentation, but is no
longer used.
Repeat: An associative array is not an array. It was a misnomer. The
name was changed to hash, precisely because the thing was never an
array in the first place.
No one claimed an array was the same thing as a hash.
Martien
--
|
Martien Verbruggen | Unix is user friendly. It's just
Trading Post Australia Pty Ltd | selective about its friends.
|
------------------------------
Date: Wed, 21 Nov 2001 11:28:47 +1100
From: "Andrew Hamm" <ahamm@programmer.net>
Subject: Re: Can I avoid 2 passes?
Message-Id: <3bfaf5a0_2@news.iprimus.com.au>
Bart Lateur wrote in message ...
>Godzilla! wrote:
>
>>> So what's the difference between a hash and and associative array?
>>
>>Format, creation and access methodologies along with efficiency.
>
>You stupid person. A "hash" is simply another shorter name for an
>"associative array". Technically, they're the same thing.
>
>So what's the difference between a car and an automobile?
>
I'm starting to agree with people who complain about G. comp.lang.perl was a
very pleasant place, but now we must all come here...
That first reply from G was bizarre, and for all the proclaimed programming
brilliance, failed to mention the 3rd arg of split. Who has a bit of Perl
learning yet to accomplish?
Anyway, no flamebait, just saying hello to the group and declaring intention
to ignore G. Unfortunately, cleaning up after the monster has stomped thru
the town is a different problem.
--
Space Corps Directive #723
Terraformers are expressly forbidden from recreating Swindon.
-- Red Dwarf
.. ... .--. .. - --- -. --- .-. .- -.-. .-.. .
------------------------------
Date: Tue, 20 Nov 2001 16:45:18 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Can I avoid 2 passes?
Message-Id: <3BFAF91E.EB6838E2@stomp.stomp.tokyo>
Martien Verbruggen wrote:
> Godzilla! wrote:
> > Bart Lateur wrote:
> > > Godzilla! wrote:
> No one claimed an array was the same thing as a hash.
Bart did.
You have forgotten you have me killfiled.
Do try to remember this. Looks bad when
you and others whom have killfiled me,
respond to my posts. Lately, a lot of
you boys are forgetting you have me
killfiled. Very odd indeed!
Beneath my signature, you will find an associative array
and a hash. Based on your statements and high logic, which
is no different than Bart's nor Uri's, hmm.. are you boys
lovers are just the same person? Anyhow, based on your
flawless logic, my script will exhibit identical prints,
with typical Godzilla perfection.
Godzilla!
--
#!perl
@Associative_Array = qw (user1:pass1:uid1:gid1:gecos1:home1:shell1
user2:pass2:uid2:gid2:gecos2:home2:shell2);
$Hash{user1} = "pass1:uid1:gid1:gecos1:home1:shell1";
$Hash{user2} = "pass2:uid2:gid2:gecos2:home2:shell2";
for (@Associative_Array)
{ print "Array: $_\n"; }
print "\n\n";
for (%Hash)
{ print "Hash: $_\n"; }
exit;
------------------------------
Date: Wed, 21 Nov 2001 01:32:09 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Can I avoid 2 passes?
Message-Id: <slrn9vm10p.hmq.mgjv@verbruggen.comdyn.com.au>
On Tue, 20 Nov 2001 16:45:18 -0800,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Martien Verbruggen wrote:
>
>
>> Godzilla! wrote:
>> > Bart Lateur wrote:
>> > > Godzilla! wrote:
>
>> No one claimed an array was the same thing as a hash.
>
>
> Bart did.
No. He did not. He said an _associative_ array was a hash. That is not
the same thing.
> You have forgotten you have me killfiled.
I haven't. I changed the scoring in my score file. You can rest
assured that I am regretting that mistake, and will rectify that.
> Beneath my signature, you will find an associative array
You still don't get it do you?
> @Associative_Array = qw (user1:pass1:uid1:gid1:gecos1:home1:shell1
> user2:pass2:uid2:gid2:gecos2:home2:shell2);
This is NOT an associative array. It is an array. Learn the
difference.
And now you go back in your hole, you troll.
Martien
--
|
Martien Verbruggen | 42.6% of statistics is made up on the
Trading Post Australia Pty Ltd | spot.
|
------------------------------
Date: Tue, 20 Nov 2001 17:50:06 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Can I avoid 2 passes?
Message-Id: <3BFB084E.DADC0A98@stomp.stomp.tokyo>
Martien Verbruggen wrote:
> Godzilla! wrote:
> > Martien Verbruggen wrote:
> >> Godzilla! wrote:
> >> > Bart Lateur wrote:
> >> > > Godzilla! wrote:
(Don't forget Uri! He is in on this one!)
> > You have forgotten you have me killfiled.
> I haven't. I changed the scoring in my score file. You can rest
> assured that I am regretting that mistake, and will rectify that.
Must be a contagion. Like I said, a lot of you boys have
forgotten you have me killfiled. I still think this is
quite odd; so many forgetting all at the same time. Kinda
like you are all affected by the same forgetfulness. This
is surely more than mere coincidence.
> > Beneath my signature, you will find an associative array
> You still don't get it do you?
Oh, rest assured I get it. However you don't but you
are about to understand.
You really have a thing for this word "get" just like,
actually identically like, a few others here.
> > @Associative_Array = qw (user1:pass1:uid1:gid1:gecos1:home1:shell1
> > user2:pass2:uid2:gid2:gecos2:home2:shell2);
> This is NOT an associative array. It is an array. Learn the
> difference.
> And now you go back in your hole, you troll.
You give up? Appears so. Frustrating, ain't I?
An associative array today is called a hash. For a decade
or more, it is said, "Call it a hash!" So, this expression
"associative array" is free for use. Virtually none, actually
none in this group use the expression associative array
except for me. I view an array containing elements with
associated values to be, of all things, an associative
array. Clever huh? However, playing a game of semantic
slipperies does not interest me. As a well recognized
Semantic Guerrilla, you boys present no challenge.
What does interest me is this. All three of you elected
to respond to the same article of mine all within the
same temporal period. All three of you reacted with
identical thinking, identical logic along with identical
intensity, identical vehemence and many other identical
personality quirks; personal idioms, such as psychotically
defending each other. It is as if, it is a certainty,
all three of you share the same brain, the same thinking,
the same logic and, the same personality.
Clever, ain't I? Want to continue playing mind games?
Around here, I am certainly the best at mind games,
wouldn't you agree, Frank?
Godzilla! Queen Of Semantic Guerrillas.
------------------------------
Date: 20 Nov 2001 16:08:07 -0800
From: linuxnb@yahoo.com (Matt)
Subject: Re: elsif problems
Message-Id: <429a5a3b.0111201608.30ecf94b@posting.google.com>
linuxnb@yahoo.com (Matt) wrote in message news:<429a5a3b.0111201051.2aaf3df@posting.google.com>...
Of course! I can't believe I didn't catch that. Thanks -- Matt
------------------------------
Date: Tue, 20 Nov 2001 23:26:40 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: EOF testing
Message-Id: <Gn4H4G.1ro@presby.edu>
In article <W6vK7.8921$i61.1796753@news20.bellglobal.com>,
Eric D. <ericd_@hotmail.com> wrote:
>
>Note I don't want to use
>
>while ($line = <FILE>)
>
>to do the testing. (There is a reason).
Why in the world not?
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
------------------------------
Date: Tue, 20 Nov 2001 15:42:49 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: EOF testing
Message-Id: <3BFAEA79.A48E1970@vpservices.com>
"Eric D." wrote:
>
> Thanks a lot guys!
>
> Reason I use $line = <FILE> instead of while ($line = <FILE>) is I need to
> do something before I read the line.
That reason doesn't justify avoiding the while loop:
&do_something_before_reading_firtst_line();
while (my $line=<FILE>) {
&do_something_after_reading_current_line($line);
&do_something_before_reading_next_line();
}
--
Jeff
------------------------------
Date: Wed, 21 Nov 2001 12:04:38 +1100
From: "Andrew Hamm" <ahamm@programmer.net>
Subject: Re: EOF testing
Message-Id: <3bfafe09_1@news.iprimus.com.au>
Eric D. wrote in message ...
>Thanks a lot guys!
>
>Reason I use $line = <FILE> instead of while ($line = <FILE>) is I need
>to do something before I read the line.
>
Like this?
while(
(print "Enter line: "),
$line = <>
) {
print $line;
}
I'm wrapping the print in ( ) so that it's isolated from the comma operator
that follows - otherwise the print would swallow up the comma and the
$line=<> expression that follows. If you were calling a function you could
skip the parens:
while( workBeforeLine($a, $b, $c), $line = <FILE>) {
# process $line
}
If workBeforeLine() could return a status that you might want to terminate
the while loop:
while( workBeforeLine($a, $b, $c) and $line = <FILE>) {
# process $line
}
I'm using the "and" operator instead of && because it's got very low
precedence (nice)
Note also that while() has an optional continue block at the end:
while($line = <FILE>) {
# process $line
} continue {
workAfterLine($a, $b, $c);
}
If you use the next statement, it goes to the continue block, which is very
nice 'cos all paths will lead to the continue block. The redo statement
skips the continue block, should you choose to use it.
Depending on the nature of the "other work" you are doing, it might
logically have to come before or after the line is processed. What is it?
The two different shapes i've given you cover both possibilities, and very
cleanly too I think.
You probably would want to lookup the comma operator in your reference
manuals to get a feel for it. Since it looks like the comma used for
separating arguments, values in lists etc etc it is something of a forgotten
operator. Poor thing.
--
Space Corps Directive #723
Terraformers are expressly forbidden from recreating Swindon.
-- Red Dwarf
------------------------------
Date: Wed, 21 Nov 2001 12:25:23 +1100
From: "Andrew Hamm" <ahamm@programmer.net>
Subject: Re: EOF testing
Message-Id: <3bfb02e4_2@news.iprimus.com.au>
Curtis Poe wrote in message <9te02r$idi@dispatch.concentric.net>...
>
>This should work:
>
>if ( ! eof FILE )
>
>See 'perldoc -f eof'.
>
>Incidentally, you wrote that there was a reason you wanted to use this
>method, but you didn't mention the reason. May I ask what it is? Only
once
>have I ever seen anyone use eof() as the best solution.
>
Eric should be told that eof needs applying before the <> operation. If he
says:
$line = <FILE>;
if(! eof FILE) { WORK }
he'll lose the last line of his file. It needs to be:
if(! eof FILE) {
$line = <FILE>;
WORK;
}
Anyway, eof is silly here 'cos $line will be totally empty at end of file.
So a plain old test
if($line) { WORK }
will do the trick.
eof is good in combination with the -n or -p flags, or in hand-crafted
loops:
#!/usr/bin/perl -n
if(?^SCREEN\b? .. /something/) {
WORK on the first SCREEN section
}
....
if(eof) {
reset; # resets ?? searches
$somevar = $refresh_value;
....
}
This is cool 'cos you can use eof to reset state between files.
--
Space Corps Directive #723
Terraformers are expressly forbidden from recreating Swindon.
-- Red Dwarf
.. ... .--. .. - --- -. --- .-. .- -.-. .-.. .
------------------------------
Date: 20 Nov 2001 20:53:36 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: EOF testing
Message-Id: <m3snb899en.fsf@mumonkan.sunstarsys.com>
"Andrew Hamm" <ahamm@programmer.net> writes:
> if($line) { WORK }
>
> will do the trick.
Careful-
% echo -ne "\000" | perl -wle '$_ = <>; print ord if $_'
0
% echo -ne "\060" | perl -wle '$_ = <>; print ord if $_'
%
I haven't followed this thread very closely, but it might be
possible that the last "line" of a file is a "0". In that case,
you need to use something like "if( defined $line )" or
"if( length $line )" instead.
HTH
--
%ENV=(); $A="\rr jpeurls ht\ba \rcankotehe"x666;END{ system
"$^X -wT $0 $^S";print"r\n"}sub foo{$_=pop||exit;/$_/;print
eval 'BEGIN{$^H='. ($^H+=666) .'}$_[-(()=$A=~//g)+$[]';}@_=
reverse$A=~/./g;&foo while$ARGV[0]=~//g;#evil mess for *nix
------------------------------
Date: 20 Nov 2001 23:53:35 GMT
From: "David H. Adler" <dha@panix.com>
Subject: Re: Frames and Headers
Message-Id: <slrn9vlr7v.1d8.dha@panix2.panix.com>
In article <9tdep7$f5a$1@suaar1aa.prod.compuserve.com>, Robin Charisse wrote:
> I am trying to write a script that displays a login form and calls itself
> when submit is pressed. When the login information has been entered
> correctly I would like a static html file to be displayed in a different
> frame in the frameset. I have tried various variations of the following code
> with no joy(the page always appears in the same frame as the form). Is this
> even possible?
>
> print "Window-target: MenuBar\nLocation: game_nav.html\n\n";
This is really an HTML/Browser issue. All perl does is print what you
tell it to. It doesn't know from such things as "frames".
Try a forum devoted to one of those issues.
good luck.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
TINC, fnord, tinc.
------------------------------
Date: Wed, 21 Nov 2001 08:37:46 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: Re: Generating graphs using Perl for Windows
Message-Id: <9tet10$cpm@news.or.intel.com>
> One problem with that is that it requires the GD libraries, which in turn
> require png libraries, zlib libraries, and jpeg libraries (and so on, it
> seems). I was hoping to steer clear of all of that, since
> 1) I have no real experience of installing and linking libraries
> and
> 2) I was hoping for something that could be easily sent out to others
> without requiring them to do anything more than put one or two files in
the
> appropriate places - the simpler the better.
Since we're talking Windoze here, a common assumption we could make
is that all the 'others' have Excel.
If thats the case refer to 'Using OLE with Perl' that comes in the
ActivePerl Help. Pay attention to the following:-
a.. How do I extract a series of cells from Microsoft Excel?
a.. How do I make a chart in Microsoft Excel?
a.. How do I save a chart from Microsoft Excel as GIF/JPEG/PNG?
a.. How do I run a macro in Microsoft Excel?
a.. How do I convert a VBA macro to Perl?
This works a treat - especially the last one.
You wont have to install anything, and in my humble opinion
OLE with Perl is damned bloody good . . .
------------------------------
Date: Tue, 20 Nov 2001 20:33:31 -0500
From: aaa <nobody@nowhere.com>
Subject: has anyone tried activestate perl under solaris?
Message-Id: <3BFB046B.889982DB@nowhere.com>
Hi just wondering about people's opinion of activestate's perl
distribution for solaris?
If you've tried it, let me know what you like and dont like about
it.....
thanks
------------------------------
Date: Tue, 20 Nov 2001 23:19:38 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: help w/ error: 'package does not return true'
Message-Id: <mbudash-BAA09D.15194020112001@news.sonic.net>
In article <B820357E.627D%brice@webprojkt.com>, Brice Ruth
<brice@webprojkt.com> wrote:
> I'm trying to create a simple package (class) that will hold some
> variables
> for me. Unfortunately, when I try to 'use' this package, Perl keeps
> giving
> me an error about the package not returning true. I have the line '1;'
> at
> the end of the package file ... I've read through the applicable section
> in
> the camel book and followed its directions - no go.
>
> Here's my package code:
>
> package PDFglobals;
> use Text::PDF::API;
> use strict;
> use Class::Struct;
>
> struct (
> font_encoding => '$',
> font_name => '$',
> xres => '$',
> yres => '$',
> pageX => '$',
> pageY => '$',
> font_size => '$',
> data_cols => '$',
> data_col_sizes => '@',
> bounding_rect => '@',
> pdf => 'Text::PDF::API',
> );
>
> 1;
>
> The file is called 'PDFglobals.pm' and to use it, I have the line:
>
> use PDFglobals;
>
> in my calling script. Both files reside in the same directory. The error
> I get is:
>
> File "PDFout-row.pl"; Line 13: PDFglobals.pm did not return a true value
>
> I'm running perl 5.6.0 on darwin 1.4.1 (Mac OS X v10.1.1).
>
> Any help would be sincerely appreciated. Feel free to respond offline to
> brice@webprojkt.com
>
> TIA,
> Brice Ruth
>
>
looks like there's an error in the .pm file that keeps it from even
getting to the '1;'. have you done the cursory 'perl -c' on it, and are
you sure the package can find 'Text::PDF::API' and 'C lass::Struct'?
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Wed, 21 Nov 2001 02:04:31 GMT
From: Brice Ruth <brice@webprojkt.com>
Subject: Re: help w/ error: 'package does not return true'
Message-Id: <B82067CD.63BC%brice@webprojkt.com>
On 11/20/01 5:19 PM, in article
mbudash-BAA09D.15194020112001@news.sonic.net, "Michael Budash"
<mbudash@sonic.net> wrote:
> looks like there's an error in the .pm file that keeps it from even
> getting to the '1;'. have you done the cursory 'perl -c' on it, and are
> you sure the package can find 'Text::PDF::API' and 'C lass::Struct'?
Yep - it seems to check out. 'perl -c' returns:
PDFglobals.pm syntax OK
Any other advice?
Brice
------------------------------
Date: Tue, 20 Nov 2001 15:58:18 -0800
From: john <jazz450@hotmail.com>
Subject: Re: How do I make several modules reference variables from one file?
Message-Id: <99CB451DC872FDED.B64C34114294EC16.D2B8E458022B2BD1@lp.airnews.net>
Hi All, thanks for the help.
I found
http://search.cpan.org/doc/JHI/perl-5.7.2/lib/Exporter.pm
and it had a lot of good stuff.
I found that $temp = $Site::Config::config{'key'}; works only when there
only one package by that name.
I inherited two files, "config.pm" and "site_config.pm.". Both were titled
"package Site::Config;". Once I realized that and commented out the
site_config.pm's package name, I was able to call variables.
>
------------------------------
Date: Wed, 21 Nov 2001 00:34:12 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: How do I make several modules reference variables from one file?
Message-Id: <slrn9vltk4.hmq.mgjv@verbruggen.comdyn.com.au>
On Tue, 20 Nov 2001 15:58:18 -0800,
john <jazz450@hotmail.com> wrote:
> Hi All, thanks for the help.
> I found
> http://search.cpan.org/doc/JHI/perl-5.7.2/lib/Exporter.pm
Don't use that. Perl 5.7.2 is a development version, and not very
stable. Use the Exporter module that came with your current version of
Perl, and read its documentation. I don't know how many differences
there are, but they could very well be significant.
> and it had a lot of good stuff.
> I found that $temp = $Site::Config::config{'key'}; works only when there
> only one package by that name.
> I inherited two files, "config.pm" and "site_config.pm.". Both were titled
> "package Site::Config;". Once I realized that and commented out the
> site_config.pm's package name, I was able to call variables.
That's bad. Generally a file name of a module should reflect the
package contained in it[1]. The module that provides the package
Site::Config should live in the file Site/Config.pm.
Note that this doesn't stop name space clashes (same package could
live in two places in @INC), but it makes it less likely. It would be
better to resolve this name clash, and either rename one of the
packages, or merge the two modules.
Martien
[1] Perl does not enforce this, and there are reasons for keeping
multiple packages in one file, but generally they're related in some
way (see for example the GD module).
--
|
Martien Verbruggen | +++ Out of Cheese Error +++ Reinstall
Trading Post Australia Pty Ltd | Universe and Reboot +++
|
------------------------------
Date: Tue, 20 Nov 2001 13:19:52 -0500
From: "Adam Stein" <adam@scan.mc.xerox.com>
Subject: Re: how to calculate the CRC of a string...
Message-Id: <pan.2001.11.20.13.19.52.438.10484@scan.mc.xerox.com>
In article <9te65e$2jn4$1@news.kabelfoon.nl>, "MAGiC MANiAC^mTo"
<no_mto@hotmail.com> wrote:
> Hi there,
>
> How can I calculate the CRC of a string?... (it doesn't matter if it is
> a crc16 or crc32)
I use a Perl module called 'String::CRC'. You can find it on CPAN.
--
Adam Stein @ Xerox Corporation Email: adam@scan.mc.xerox.com
Disclaimer: Any/All views expressed
here have been proved to be my own. [http://www.csh.rit.edu/~adam/]
------------------------------
Date: Tue, 20 Nov 2001 23:22:55 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: multiple arrays as arguments
Message-Id: <slrn9vlpef.hmq.mgjv@verbruggen.comdyn.com.au>
On Tue, 20 Nov 2001 16:24:42 -0600,
Mark Sidarous <sidarous@isr6132.urh.uiuc.edu> wrote:
> Hi. I have a problem. Right now I'm passing in 2 arrays to a function as
> arguments. Now Perl just lumps them into @_. So what I'm currently doing
> is passing (@1, @2, $#1) in to the function. It pops the last value
> ($#1), then takes the first $#1 values and puts them in an array. All the
> rest go into @2. The function then fiddles around with @1 and @2, then
> passes them back (@1, @2, $#1).
Others have already told you to pass the arrays by reference, but I'd
like to point out that you can get Perl to do this for you by using
function prototypes, which in some cases can be more elegant:
#!/usr/local/bin/perl -w
use strict;
sub foo1
{
my ($aref1, $aref2) = @_;
print "foo1: ", scalar @$aref1, "-", scalar @$aref2, "\n";
}
sub foo2(\@\@)
{
my ($aref1, $aref2) = @_;
print "foo2: ", scalar @$aref1, "-", scalar @$aref2, "\n";
}
my @a = (1, 2, 3, 4);
my @b = (5, 6, 7);
foo1(\@a, \@b);
foo2(@a, @b);
__END__
Read more about it in the perlsub documentation, which also talks
about the other technique. Keep in mind that the prototype has to be
defined before you call the function.
Martien
--
|
Martien Verbruggen | That's funny, that plane's dustin'
Trading Post Australia Pty Ltd | crops where there ain't no crops.
|
------------------------------
Date: Tue, 20 Nov 2001 23:51:09 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: multiple arrays as arguments
Message-Id: <x7u1vpc85z.fsf@home.sysarch.com>
>>>>> "SS" == Steve Spencer <steven.nospam.spencer@team.ozemail.com.au> writes:
please learn to not top post. read these pages:
http://www.btinternet.com/~chiba/sbox/topposters.html
http://www.uwasa.fi/~ts/http/quote.html
http://www.geocities.com/nnqweb/nquote.html
SS> I've found the best way to get arround this problem is to pass in array
SS> references..
that's about the only way, not just best. the others are passing in
typeglobs (eww!) or passing in the lengths of the arrays (more ewww!).
SS> &subroutine(\@array1, \@array2)
SS> when you access the arguements within the sub routine you use this format.
SS> ($arrayref1, $arrayref2) = @_;
SS> @routinearray1 = @{$arrayref1};
SS> @routinearray2 = @{$arrayref2};
SS> hope this helps..
why copy the entire array to other vars? you can just use the references
as needed. the only major reason to copy the arrays is if you want to
modiy the copies and not touch the originals. and if you show code that
would be in a sub, show the my's too as that is proper sub arg
handling. you DO use strict, don't you?
<snip of entire quoted post>
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 20 Nov 2001 19:21:02 -0600
From: "Jo-an Arp" <jarp@pdq.net>
Subject: Perl Make Fails -- DB_File.xs
Message-Id: <47DF6EBCD8FCC894.554E862E61A89E86.9BD103131D77D733@lp.airnews.net>
I'm trying to install perl 5.005_03 on SCO, 5.0.5 OpenServer. Berkeley DB is
skunkware's 1.85.4.
The only arg given to Configure is -Dcc=gcc. Gcc is 2.95.3 which I installed
from
source.
Make fails ..
Is it my include paths, is Perl confused about the version of DB, or WHAT!!
Cheers.
Making DB_File (static)
gcc -c -U M_XENIX -D PERL_SCO -D
PERL_SCO5 -melf -I/usr/local/include -
O2 -DVERSION=\"1.65\" -DXS_VERSION=\"1.65\" -I../.. DB_File.c
In file included from DB_File.xs:103:
/usr/local/include/db.h:58: conflicting types for `int8_t'
/usr/include/sys/bitypes.h:88: previous declaration of `int8_t'
/usr/local/include/db.h:59: warning: redefinition of `u_int8_t'
/usr/include/sys/bitypes.h:96: warning: `u_int8_t' previously declared here
/usr/local/include/db.h:60: warning: redefinition of `int16_t'
/usr/include/sys/bitypes.h:87: warning: `int16_t' previously declared here
/usr/local/include/db.h:61: warning: redefinition of `u_int16_t'
/usr/include/sys/bitypes.h:95: warning: `u_int16_t' previously declared here
/usr/local/include/db.h:62: warning: redefinition of `int32_t'
/usr/include/sys/bitypes.h:82: warning: `int32_t' previously declared here
/usr/local/include/db.h:63: warning: redefinition of `u_int32_t'
/usr/include/sys/bitypes.h:91: warning: `u_int32_t' previously declared here
*** Error code 1 (bu21)
*** Error code 1 (bu21)
------------------------------
Date: Wed, 21 Nov 2001 12:31:35 +1100
From: "Andrew Hamm" <ahamm@programmer.net>
Subject: Re: result pages (10 by 10)
Message-Id: <3bfb0457_1@news.iprimus.com.au>
Laocoon wrote in message ...
>Why's everyone posting their stuff two times
>
Are you using Micro*swear* Outlook Express? It sometimes get's knotted and
appears to show double-postings. All you have to do is quit and restart. Let
it compact and purge as it quits.
--
Space Corps Directive #723
Terraformers are expressly forbidden from recreating Swindon.
-- Red Dwarf
------------------------------
Date: 20 Nov 2001 15:40:23 -0800
From: wil@fbagroup.co.uk (Wiliam Stephens)
Subject: Re: using sendmail from perl
Message-Id: <39e3e00a.0111201540.3c5e4e6@posting.google.com>
"Brian Wakem" <no@email.com> wrote in message news:<RWxK7.1195$6W6.399766@news2-win.server.ntlworld.com>...
> if ($regEmail !~ /^[\w-.]+\@[\w-.]+$/) {
> print "You have not entered a valid email address";
> ...
Surely you'll need a little more complex regex than that to determine
a valid email address?
Wil
------------------------------
Date: Wed, 21 Nov 2001 01:40:57 GMT
From: "Zachary Kent" <zkent@adelphia.net>
Subject: Re: using sendmail from perl
Message-Id: <JCDK7.119$cs3.74850@news1.news.adelphia.net>
"Wiliam Stephens" <wil@fbagroup.co.uk> wrote in message
news:39e3e00a.0111201540.3c5e4e6@posting.google.com...
> "Brian Wakem" <no@email.com> wrote in message
news:<RWxK7.1195$6W6.399766@news2-win.server.ntlworld.com>...
>
> > if ($regEmail !~ /^[\w-.]+\@[\w-.]+$/) {
> > print "You have not entered a valid email address";
> > ...
>
> Surely you'll need a little more complex regex than that to determine
> a valid email address?
>
> Wil
To clarify my needs, I DON'T need to determine if the given email address is
valid, just that it is properly formed and does not contain invalid
characters. Does this regex do that?
Zach
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 2167
***************************************