[7007] in Perl-Users-Digest
Perl-Users Digest, Issue: 632 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 18 20:17:14 1997
Date: Wed, 18 Jun 97 17:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 18 Jun 1997 Volume: 8 Number: 632
Today's topics:
Re: "Cloning" a Perl install (no C compiler) <kperrier@Starbase.NeoSoft.COM>
Re: "Cloning" a Perl install (no C compiler) (Brian Jepson)
Re: "Cloning" a Perl install (no C compiler) (Quentin Fennessy)
$100 to the first one who can solve this one <dan@clockwork.net>
[Q] Updating Netscape address book (Paquin Michel)
Re: appending two files into one? <pmerle@corp.sun.com>
Binary conversion (reading a gif header) <nick@bluewave.co.uk>
Re: Binary conversion (reading a gif header) (Nathan V. Patwardhan)
Re: Command line args..? (Nathan V. Patwardhan)
dbi to sybase <rup@ms.com>
Re: HELP: How to limit the length of contents in guestb (Craig Berry)
Logical XOR <coder@sprayonhair.com>
Re: Logical XOR (Quentin Fennessy)
Perl - Excel Diaolg Box Suppression dougr@gcomm.com
Perl and HTML forms question <megspace@interport.net>
Perl and Tcl which is suitable for automatic testing (Chuan Wang)
Perl Q: Re: Random Numbers <joe@mrpc.com>
Re: Perl Q: Re: Random Numbers (Ken Shan)
System command (George M. Pieri)
Re: System command (Quentin Fennessy)
testing <kblau@cell1.com>
Re: Tie and Multidimensional hashes (and other stuff) (Gurusamy Sarathy)
Re: Trouble compiling TkPerl under NT (Gurusamy Sarathy)
Use and code in 2 files (Eric Finley)
Re: When do I call srand? <Dskramer@concentric.net>
Where To Find Perl 4 for Solaris Pre-Compiled? jtucker@vnet.net
Re: Where To Find Perl 4 for Solaris Pre-Compiled? (Quentin Fennessy)
Win 32 port of Comm.pl by Eric Arnold derek.winters@arris-interactive.com
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Jun 1997 16:55:02 -0500
From: Kent Perrier <kperrier@Starbase.NeoSoft.COM>
Subject: Re: "Cloning" a Perl install (no C compiler)
Message-Id: <csen9z8tl5.fsf@Starbase.NeoSoft.COM>
Robert Flannigan <flannigan.robert@infoband.com> writes:
> before I go about re-inventing the wheel, I was wondering if there was a
> "canned" method for duplicating a specific Perl build to X number of
> systems on a network (37 in my case).
>
> we essentially have many SVR4 (NCR) unix systems spead around the country
> that are at the same rev of OS and assorted libraries and system files.
> I have built Perl cleanly on our "golden" lab system, but do not have a C
> compiler installed on the production machines, and therefore cannot use
> the recommended method of `sh Configure; make; etc.` to build on each
> box. therefore my plan is to:
>
<SNIP>
> is there a simpler method that I have yet to find on CPAN, FAQs, or the
> other places I've been checking? is this method in any way "dangerous"
> in that it would miss something? may thanks to the contributors to this
> list for any feedback.
>
After compile perl on the lab machine, tar up the perl source directory.
Assuming that make is on the other 37 machines, untar the source directory
on the target machines and type 'make install'
Kent
--
Kent Perrier kperrier@neosoft.com
Corporations don't have opinions, people do. These are mine.
------------------------------
Date: 18 Jun 1997 22:52:15 GMT
From: bjepson@ids.net (Brian Jepson)
Subject: Re: "Cloning" a Perl install (no C compiler)
Message-Id: <slrn5qgpcj.1hq.bjepson@Sol2-5.ids.net>
In article <866657638.20693@dejanews.com>, Robert Flannigan wrote:
>before I go about re-inventing the wheel, I was wondering if there was a
>"canned" method for duplicating a specific Perl build to X number of
>systems on a network (37 in my case).
>
>we essentially have many SVR4 (NCR) unix systems spead around the country
>that are at the same rev of OS and assorted libraries and system files.
>I have built Perl cleanly on our "golden" lab system, but do not have a C
>compiler installed on the production machines, and therefore cannot use
>the recommended method of `sh Configure; make; etc.` to build on each
>box.
[...]
When you run ./Configure, you have the opportunity to pick an
installation directory. One possibility would be to choose something
like /opt/perl and then everything will go nicely under that directory.
The relevant question from ./Configure is:
Installation prefix to use? (~name ok) [/usr/local]
You should be able to tar the directory up, and put it on all the
other machines. Then, you can symlink /opt/perl/bin/perl to
/usr/bin/perl and /usr/local/bin/perl. Another nice thing is that
for machines that are relatively close to each other, you could
just export /opt/perl via NFS, and there will be no need to use up
any extra disk space.
Hope this helps,
--
Brian Jepson * (bjepson@ids.net) * http://www.ids.net/~bjepson
Int(ra|er)net Database Developer, Author, Crypto-Fluxologist
Non-Prophet Arts Technology Flux: http://www.ids.net/~as220
WWW/Database/NT,Java/Database: http://www.ids.net/~bjepson/books
------------------------------
Date: 18 Jun 1997 22:04:14 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: "Cloning" a Perl install (no C compiler)
Message-Id: <5o9m0u$cgj$1@amdint2.amd.com>
In article <866657638.20693@dejanews.com>,
Robert Flannigan <flannigan.robert@infoband.com> wrote:
>before I go about re-inventing the wheel, I was wondering if there was a
>"canned" method for duplicating a specific Perl build to X number of
>systems on a network (37 in my case).
Robert, Here is an excerpt from the INSTALL file from perl5.004:
=head2 Creating an installable tar archive
If you need to install perl on many identical systems, it is
convenient to compile it once and create an archive that can be
installed on multiple systems. Here's one way to do that:
# Set up config.over to install perl into a different directory,
# e.g. /tmp/perl5 (see previous part).
sh Configure -des
make
make test
make install
cd /tmp/perl5
tar cvf ../perl5-archive.tar .
# Then, on each machine where you want to install perl,
cd /usr/local # Or wherever you specified as $prefix
tar xvf perl5-archive.tar
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: Wed, 18 Jun 1997 17:11:39 -0500
From: Dan Brian <dan@clockwork.net>
Subject: $100 to the first one who can solve this one
Message-Id: <33A85D1B.15B@clockwork.net>
I will personally send a check for $100 to the first person who is able
to answer this question in a way that works. Pardon the crude sales
pitch, I'm desperate. :|
I am using the Perl compiler, alpha-3, to compile some scripts that make
use of the msql-perl XSUBs. I can successfully compile various scripts
that use other XSUBs, but the msql-perl extensions are more complex,
since they define different data types in typemap. I can sucessfully
compile the script linking it to the libmsql.a archive as well as a
libMsqlPerl.a archive I have generated successfully. However, when I run
this executable, I get the error "Can't call method 'connect' in empty
package 'Msql' in suchandsuch.pl line 54, <FILE> chunk 12." I can't
figure out why the compiler thinks this package is 'empty'.
I've been wrestling with this one for over a week, and I'm not a C
programmer, so I'm lost. Anyone experienced with XSUBs and the compiler,
please give me a hand. Respond to me with a phone number if you want me
to call, or I'll give you mine.
Regards,
Dan Brian
dan@clockwork.net
------------------------------
Date: Wed, 18 Jun 1997 16:01:15 -0400
From: m.paquin@nfb.ca (Paquin Michel)
Subject: [Q] Updating Netscape address book
Message-Id: <m.paquin-1806971601160001@qawhaq.nfb-onf.ca>
Is it possible, thru PERL, to update the address book in Netscape ?
The reason is I have made a perl program that, based on search criteria
supplied by the user, display the name, local & internet email address of
each employees found and I would like, using a button, to give the
possiblity of taking the information found (the internet email address &
the name) and insert it in the user address book.
By doing that, it would be easier for the user to perform search, let say
for peoples in accounting, give the group a name and have those names
inserted in his/her address book.
Thanks for any help you can give me.
--
Michel Paquin
National Film Board of Canada / Office National du Film du Canada
m.paquin@nfb.ca
------------------------------
Date: Wed, 18 Jun 1997 13:53:44 -0700
From: Pierre Merle <pmerle@corp.sun.com>
Subject: Re: appending two files into one?
Message-Id: <33A84AD8.628E@corp.sun.com>
oups not filename but fiel.
sorry.
Pierre
------------------------------
Date: Tue, 17 Jun 1997 16:05:27 +0100
From: Nick Holmes <nick@bluewave.co.uk>
Subject: Binary conversion (reading a gif header)
Message-Id: <33A6A7B7.25B0@bluewave.co.uk>
Hi,
slight problem encountered:
I am trying to read the dimension data from the top of a .gif file, I
can read in the requisite number of bytes, but cannot then convert the
(binary) numbers into a readable format.
What I need to do is convert my two byte values into decimal format, but
I have been unable to come up with a convenient means of doing this in
Perl.
I am using perl 5.003 on an x86 linux machine.
thanks in advance
Nick Holmes
------------------------------
Date: 18 Jun 1997 21:32:40 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Binary conversion (reading a gif header)
Message-Id: <5o9k5o$7ge@fridge-nf0.shore.net>
Nick Holmes (nick@bluewave.co.uk) wrote:
: I am trying to read the dimension data from the top of a .gif file, I
: can read in the requisite number of bytes, but cannot then convert the
[snip]
If you're just trying to get the size of the image, why not use
Image::Size available from a CPAN near you?
http://www.perl.com/CPAN/modules/by-module/Image/
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 18 Jun 1997 21:33:59 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Command line args..?
Message-Id: <5o9k87$7ge@fridge-nf0.shore.net>
Mike Stok (mike@stok.co.uk) wrote:
: getopt '?x', \%opts;
Neat!
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Wed, 18 Jun 1997 14:44:38 -0400
From: Peter -Ping Ru <rup@ms.com>
Subject: dbi to sybase
Message-Id: <33A82C95.167EB0E7@ms.com>
The following script is hanging forever
use DBI;
$dh = DBI->connect('db', 'user', 'pwd', 'Sybase');
Usually the sybase connection need server name, uid, pwd and option
db name (default db). Where I could specify the server name in the
connect call?
Thanks for any help.
rup@ms.com
--
____________________________________________________________________
Peter P. Ru Tel: (212)762-2646
Morgan Stanley & Co, 750 7th Ave, NYC, NY 10019. Fax: (212)762-0527
------------------------------
Date: 18 Jun 1997 23:42:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: HELP: How to limit the length of contents in guestbook script?
Message-Id: <5o9rot$8vr$1@marina.cinenet.net>
perl guy (perlprogrammer@hotmail.com) wrote:
[snipped: my string-length-limiting code]
: cool idea, but how could you limit the size to 500 chars, yet let the
: comment go through still, and just stop at the 500th char?. Without an
: error, etc?. Link in a chat room, to limit the size of people's posts?.
: Any ide-erz?..
Not sure what you mean by this -- that's what my code does. Leave out
the warning message if you don't want to issue one. The point is that,
after passing through my code fragment, the string contains a known
maximum number of characters, having been truncated if necessary, and
with an optional ellipsis tacked on. You can then freely do whatever
else you want with it.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 18 Jun 1997 14:37:44 -0700
From: Matt Ooi <coder@sprayonhair.com>
Subject: Logical XOR
Message-Id: <Pine.SUN.3.91.970618140800.29982B-100000@circuit>
What is the symbol (if there is one) for logical XOR? Every reference I
have checked makes no reference to there actually being a symbol. My
second question is if there is no symbol, how was logical xor used before
Perl 4? Also, the word xor has a lower precedence, is there a way to give
xor a higher precedence?
--Matt
------------------------------
Date: 18 Jun 1997 22:10:02 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: Logical XOR
Message-Id: <5o9mbq$cpb$1@amdint2.amd.com>
In article <Pine.SUN.3.91.970618140800.29982B-100000@circuit>,
Matt Ooi <coder@sprayonhair.com> wrote:
>What is the symbol (if there is one) for logical XOR? Every reference I
>have checked makes no reference to there actually being a symbol. My
>second question is if there is no symbol, how was logical xor used before
>Perl 4? Also, the word xor has a lower precedence, is there a way to give
>xor a higher precedence?
> --Matt
There are two operators for xor in perl 5. (from perlop(1))
Binary "xor" returns the exclusive-OR of the two surrounding
expressions. It cannot short circuit, of course.
Binary "^" returns its operators XORed together bit by bit.
xor does have low precedence - easily solved by parenthesizing to taste.
foo xor bar and baz
(foo xor bar) and baz
foo xor (bar and baz
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: Wed, 18 Jun 1997 17:11:24 -0600
From: dougr@gcomm.com
Subject: Perl - Excel Diaolg Box Suppression
Message-Id: <866671296.385@dejanews.com>
Is there a command to suppress "Save Changes In "xxx.xxx"" ? I am
running Perl on my NT machine and using OLE to update a Excel 5
spreadsheet. But the dialog box comes up and requires me to choose yes
at the machine. I need to suppress this so the process can be
transparent to everyone.
Thanks,
Doug
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 18 Jun 1997 17:15:24 -0400
From: Barry Kaplan <megspace@interport.net>
Subject: Perl and HTML forms question
Message-Id: <33A84FEC.BAC73FE5@interport.net>
Perl newbie here. Sorry if this isn't very clear. I have a HTML form
from which the information is parsed though a perl script and that's
working fine. I also have the perl script outputting a second form to
request additional information from the user. This information then gets
passed off to a second perl script. The problem is I can't figure out
if there is a way to pass off the information from the first form to the
second perl script. Here's a condensed example of what I'm trying to do.
*******************************************************************
This is webform.html:
<FORM ACTION="cgi-bin/webform1.cgi" METHOD="POST">
<P>Please enter your name:<BR>
<INPUT TYPE="text" NAME="name" SIZE=30 MAXLENGTH=50>
<P><INPUT type='submit' value='submit' ></FORM>\n";
This is webform1.cgi:
#!/usr/bin/perl
require 'cgi-libs/cgi_handlers.pl' ;
&get_request();
print "Hello", $rqpairs{'name'}, "!\n";
# here's the second outputted form from within the script.
print "<FORM ACTION='webform2.cgi' METHOD='POST'>";
print "<P>Please enter your email address:<BR>\n";
print "<INPUT TYPE='text' NAME='email' SIZE=30 MAXLENGTH=50>\n";
print "<P><INPUT type='submit' value='submit' ></FORM>\n";
This is webform2.cgi:
#!/usr/bin/perl
require 'cgi-libs/cgi_handlers.pl' ;
&get_request();
print "Hello", $rqpairs{'name'}, "!\n"; # This is the variable that
won't carry over from the first form!
print "Your address is", $rqpairs{'email'},"\n";
******************************************************************
Is there a way to store the 'name' variable so that it can be read into
webform2.cgi? Thanks for any suggetions.
-Barry
------------------------------
Date: 18 Jun 1997 21:53:24 GMT
From: chuan@engr.mun.ca (Chuan Wang)
Subject: Perl and Tcl which is suitable for automatic testing
Message-Id: <5o9lck$59q$1@coranto.ucs.mun.ca>
Hi,
I'm new to Perl and Tcl and no experence in software testing. If I want
to write the testing script, between Perl and Tcl, which one is more
suitable for that? Any advice is appeciated.
------------------------------
Date: 16 Jun 1997 19:09:32 GMT
From: "Tyler Carey" <joe@mrpc.com>
Subject: Perl Q: Re: Random Numbers
Message-Id: <01bc7a8b$7d751840$972d70ce@Tyler>
Hi,
I'm designing a web page where I would like to have a cgi script that will
load a different random image every time the page is loaded. Now, I've
tried digging through the Perl resources that I have, but can't seem to
find anything for PERL (operating under Windows NT) that will handle Random
Numbers. Any suggestions?
Thanks,
Ty
------------------------------
Date: 18 Jun 1997 20:30:12 GMT
From: ken@digitas.harvard.edu (Ken Shan)
Subject: Re: Perl Q: Re: Random Numbers
Message-Id: <5o9ggk$ccq$2@news.fas.harvard.edu>
Tyler Carey (joe@mrpc.com) wrote:
> I'm designing a web page where I would like to have a cgi script that will
> load a different random image every time the page is loaded. Now, I've
> tried digging through the Perl resources that I have, but can't seem to
> find anything for PERL (operating under Windows NT) that will handle Random
> Numbers. Any suggestions?
First, your question is answered in perlfunc, perlfaq4 and perlfaq5,
all of which are documentation included with the Perl distribution. A
simple text search for the word "random" would have found you all.
Second, don't crosspost to the obsolete newsgroup comp.lang.perl or
the irrelevant newsgroup comp.lang.perl.modules.
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"Life," he said, "is like a grapefruit."
"Er, how so?"
"Well, it's sort of orangy-yellow and dimpled on the outside, wet and squidgy
in the middle. Oh, and some people have half a one for breakfast." -SLATFATF
------------------------------
Date: Wed, 18 Jun 1997 17:27:54 -0700
From: george.pieri@mci.com (George M. Pieri)
Subject: System command
Message-Id: <MPG.e121ce5851dc500989680@news.cs.mci.com>
Is it possible to output the contents of the
system command to an array "INSTEAD OF" a
file...
e.g.
Instead of
--------------
system "dir > output.file" ;
Want
----------
system "dir > @my_array " ;
Thanks in advance!
------------------------------
Date: 18 Jun 1997 22:15:50 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: System command
Message-Id: <5o9mmm$d27$1@amdint2.amd.com>
In article <MPG.e121ce5851dc500989680@news.cs.mci.com>,
George M. Pieri <george.pieri@mci.com> wrote:
>
>Is it possible to output the contents of the
>system command to an array "INSTEAD OF" a
>file...
How about
@array = `dir`;
>From perlop(1):
qx/STRING/
`STRING`
A string which is interpolated and then executed as
a system command. The collected standard output of
the command is returned. In scalar context, it
comes back as a single (potentially multi-line)
string. In list context, returns a list of lines
(however you've defined lines with $/ or
$INPUT_RECORD_SEPARATOR).
>From perlfunc(1): (note the >>>)
system LIST
Does exactly the same thing as "exec LIST" except
that a fork is done first, and the parent process
waits for the child process to complete. Note that
argument processing varies depending on the number
of arguments. The return value is the exit status
of the program as returned by the wait() call. To
get the actual exit value divide by 256. See also
>>> the exec entry elsewhere in this document. This is
>>> NOT what you want to use to capture the output from
>>> a command, for that you should merely use backticks,
>>> as described in the section on `STRING` in the
>>> perlop manpage.
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: 18 Jun 1997 14:58:00 -0700
From: Kenneth Blau <kblau@cell1.com>
Subject: testing
Message-Id: <33A859A9.41F9@cell1.com>
testing
------------------------------
Date: 18 Jun 1997 23:48:15 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Tie and Multidimensional hashes (and other stuff)
Message-Id: <5o9s3v$th@srvr1.engin.umich.edu>
[ mailed and posted ]
In article <33A70B69.2663@ti.com>, Chris Mason <cmason@ti.com> wrote:
>
>Then this tied sub hash could access another hash on the server using
>the same method as the first hash (emulating multi-dimensional hashes).
>Would something like this work? Am I pushing too many boundaries here?
>I read through the source of MLDBM.pm but it seems to pull the whole sub
>hash in from the DBM file and return it. This would be a bad thing in
>Nethash. (It seems like the real solution is to have perl really handle
>multidimensional tied hashes by passing in all the keys to the FETCH
>method.)
MLDBM works fine (for me atleast) for small web databases and such,
where the nesting of data structures is not too deep and not too wide.
In short, it is not a scalable solution, mostly because it has to
construct/deconstruct a whole "tree" in the "forest" of data for
every FETCH/STORE. You will be ok if your trees are really little
more than shrubs, and not giant redwoods.
There has been some noise (mostly from me) about supporting a
multi-dimensional FETCH in the TIE interface on the perl5-porters
list. I hope to add something of the sort to 5.005 (assuming 5.005
aint going to be here in a hurry). Once this is available,
$h{foo}[0]{bar} would translate to $hobj->FETCH('foo',0,'bar'),
and similarly for STORE. This allows the tie package to implement
the multidimensional struct as a flat structure internally, if
needed, and optimise access to just the particular node that needs
to be fetched/stored.
The rest of your problem sounds like you badly need a full-blown
database server. Have you considered that option?
- Sarathy.
gsar@umich.edu
------------------------------
Date: 18 Jun 1997 23:26:42 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Trouble compiling TkPerl under NT
Message-Id: <5o9qri$d@srvr1.engin.umich.edu>
[ mailed and posted ]
In article <01bc7b03$d88e1600$038182c1@TI_SGML_SUNDOG>,
Chris Wareham <chriswareham@dial.pipex.com> wrote:
>According to the documentation, the last two alpha versions of TkPerl
>(402.000 and 402.001)
>should compile under WinNT using Visual C++, and now under Borland's C++
>compiler (presumably
>C++ Builder).
Tk402.000 is an alpha version (I'm sure you knew that).
Tk402.000 will compile with perl5.004(and later) under Visual C++ 4.0
(and later) after applying a patch, which presumably was posted
in c.l.p.tk (email me for my version if you can't find it).
It will compile with perl5.004_01 under Borland C++ 5.02 and later
after applying another patch (email me for it). No, C++ Builder
cannot be used to build either perl or Tk (due to stupid Borland
marketing tricks having to do with not supplying DLL versions of
their C Runtime with that product).
> I compiled Perl 5.004 under Visual C++ v2.0 with no problem,
>and installed the
>pre-compiled binaries of Tcl7.6 / Tk4.2.
VC++ 2.0 will not suffice for building Tk402.000. You need at least
VC++ 4.0. It is possible that some tweaking will let you do it, but
I haven't tried (no reason to, I'm afraid).
>So, if anyone has successfully compiled TkPerl under NT, can I have a copy
>of your binary? Or
>failing that, any details of what version of Visual C++ is best and any
>workarounds needed.
If I can manage it, I plan to upload a binary version of perl5.004_01
to CPAN that contains the most popular modules in the next couple of
days. At this point, I plan to include Tk402.000 in it (unless Nick
wants to donate his most up-to-date version, which should be better).
Watch c.l.p.a.
- Sarathy.
gsar@umich.edu
------------------------------
Date: 18 Jun 1997 22:17:11 GMT
From: ez041407@boris.ucdavis.edu (Eric Finley)
Subject: Use and code in 2 files
Message-Id: <5o9mp7$ba5$1@mark.ucdavis.edu>
I would like to put my code in 2 different files as it is getting to be
really long. I looked at
www.perl.org/CPAN/doc/manual/html/pod/perlmod.html for help and used the
template given there and then started to snip out the things that I don't
think I really need/want. All I reall want to do is be able to call a
function in a different file. As a test case I have 2 files:
prog.pl:
use Subfile;
$mesg2 = "world";
phm($mesg2);
print "exiting\n";
and Subfile.pm:
package Subfile;
# here's a file-private function as a closure,
# callable as &$priv_func; it cannot be prototyped.
my $priv_func = sub {
# stuff goes here.
};
sub main::phm {
my ($word) = @_;
print "Hello $word\n";
print "Hello $main::mesg2\n";
} # no prototype
and get the output I expect:
Hello world
Hello world
exiting
I have 2 questions. The first is why when I take out the "my $priv_func"
sub I get the following error:
Subfile.pm did not return a true value at mult_file.pl line 2.
BEGIN failed--compilation aborted at mult_file.pl line 2.
What do those lines do?
And the second question is, is this the way I want to go about solving
this problem? I read Tom's article on use and require and also the camel
and I think that use is the way I want to go, but am not certain.
Thanks,
Eric Finley
------------------------------
Date: Wed, 18 Jun 1997 18:35:40 -0400
From: David Kramer <Dskramer@concentric.net>
Subject: Re: When do I call srand?
Message-Id: <Pine.SUN.3.96.970618181355.11708E-100000@mariner.cris.com>
On 18 Jun 1997, Michael Fuhr wrote:
> Date: 18 Jun 1997 13:14:31 -0600
> From: Michael Fuhr <mfuhr@dimensional.com>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: When do I call srand?
>
> David Kramer <Dskramer@concentric.net> writes:
>
> > I am trying to find out the "scope" of srand.
> > Does it only affect rand() in the one process, or all processes?
> > If I have one perl program that require()'s another, and both need random
> > numbers, should I call srand() in the require()'ed program, or only the
> > outer program?
> > Also, exactly what does srand expect as a parameter? What range of number
> > does it expect?
>
> See the entry for srand in the perlfunc manual page -- it should
> answer your questions.
Unfortunately, it does not. It merely states that it "Sets the random
number seed for the rand operator." That does not tell me if the rand
operator is working with the same seed/sequence for every process on the
system, for every instance of perl (or in my case oraperl5), for every
call within your PID, or for every call in your module. Please correct me
if I am wrong here.
It also does not explain what srand expects as a parameter, other than
saying it's an "expression". Does a larger number produce more random
number? What about a floating point number? What about a string? Do you
see my point?
-------------------------------------------------------------------
DDDD David Kramer dskramer@concentric.net
DK KD http://www.concentric.net/~dskramer
DKK D
DK KD Shh! Be vewy, vewy qwiet! I'm hunting wuntime ewwors...
DDDD
------------------------------
Date: Wed, 18 Jun 1997 14:38:31 -0600
From: jtucker@vnet.net
Subject: Where To Find Perl 4 for Solaris Pre-Compiled?
Message-Id: <866661695.24848@dejanews.com>
Does anyone have information on where I can get a pre-compiled version of
Perl 4 for Solaris 2.5? We need version 4 for 100% support of some
existing scripts. Thanks,
Jeff Tucker, jtucker@vnet.net
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 18 Jun 1997 22:21:05 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: Where To Find Perl 4 for Solaris Pre-Compiled?
Message-Id: <5o9n0h$dbh$1@amdint2.amd.com>
In article <866661695.24848@dejanews.com>, <jtucker@vnet.net> wrote:
>Does anyone have information on where I can get a pre-compiled version of
>Perl 4 for Solaris 2.5? We need version 4 for 100% support of some
>existing scripts. Thanks,
I advise against using Perl 4 for your code. The conversion is often
trivial. But if you must...
There are perl 4 binaries on the CD-ROM included with 'Unix Power Tools.'
Also a company called RTR (or Ready To Run) produces CD-ROMs with
Unix binaries. Check out
http://www.rtr.com
Of course, there may be free net sources as well - why don't you try
a search engine or two?
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: Wed, 18 Jun 1997 16:12:09 -0600
From: derek.winters@arris-interactive.com
To: derek.winters@arris-interactive.com
Subject: Win 32 port of Comm.pl by Eric Arnold
Message-Id: <866667709.30082@dejanews.com>
I'm just wondering if anyone has ever done a Win 32 PERL port of Eric
Arnold's Comm.pl module. I'd really appreciate it if someone could let me
know by email where I can acquire such a port. Thanks.
Derek Winters
derek.winters@arris-interactive.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 632
*************************************