[13042] in Perl-Users-Digest
Perl-Users Digest, Issue: 452 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 10 20:07:17 1999
Date: Tue, 10 Aug 1999 17:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 10 Aug 1999 Volume: 9 Number: 452
Today's topics:
Re: Are PerlApp and Perl2exe the same? <carvdawg@patriot.net>
Re: BEGIN's in subs (Martien Verbruggen)
Re: CGI newbie <jcreed@cyclone.jprc.com>
Re: CHMOD function (Malcolm Ray)
Re: exists problem (M.J.T. Guy)
Re: finding array size <glasscat@shell7.ba.best.com>
Flocking, whassat? <flexit@flexit.eurobell.co.uk>
Re: Flocking, whassat? (Larry Rosler)
getting perl onto windows laptop <JAMES.GRONQUIST@Sun.COM>
Re: Help - Split Function Blowing My Mind Away!! (Larry Rosler)
http://www.perl.com gone? (Phil Goetz)
Re: http://www.perl.com gone? (Martien Verbruggen)
HTTP_REFERER and Frames <dave_man@my-deja.com>
Re: list length (Randal L. Schwartz)
Re: list length (M.J.T. Guy)
Re: MIME::Lite newbie question <dan@tuatha.sidhe.org>
Re: Moving a Perlscript from NT to LINUX (Martien Verbruggen)
Re: Moving a Perlscript from NT to LINUX <flavell@mail.cern.ch>
Perl Question jsmith19991@my-deja.com
PLEASE HELP: system call to another perl program... <GOAWAYSPAMBASTARDSmartin3@dds.nl>
Re: PLEASE HELP: system call to another perl program... (Martien Verbruggen)
Re: pricing a perl job <elaine@chaos.wustl.edu>
Re: pricing a perl job <max@maxgraphic.com>
Re: pricing a perl job (David H. Adler)
Re: reference to object method (Martien Verbruggen)
Re: reference to object method (Damian Conway)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Aug 1999 19:29:39 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Are PerlApp and Perl2exe the same?
Message-Id: <37B0B5E3.BB711C75@patriot.net>
> The subject says it all. I have seen PerlApp on ActiveState's site and
> perl2exe on a seperate website (www.perl2exe.com). Are they the same?
> If not does anyone know the advantages/disadvantages of each? Thanks
Like Dave said, the goals are the same. However...
I have a small script that does some simple lookups using gethostbyxxx().
It would
not compile under PerlApp...only about 10 lines, and PerlApp claimed that
it ran out
of memory. I used Perl2Exe...compiled fine as either stand-alone or
Perl-dependant,
and the .exe file works just fine.
Perl2Exe is far superior on ALL of the tests I have run...
C
------------------------------
Date: Tue, 10 Aug 1999 23:56:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: BEGIN's in subs
Message-Id: <1%2s3.79$O21.4004@nsw.nnrp.telstra.net>
In article <7oq435$n5j$1@fcnews.fc.hp.com>,
ada@fc.hp.com (Andrew Allen) writes:
> Although perlref briefly mentions that "In the general case, then,
> named subroutines do not nest properly, although anonymous ones do", I
> was wondering why the following code behaves as it does:
>
> sub a
> {
> my $c;
> BEGIN {$c=7;}
> print "c=$c\n";
> }
>
> a();
> a();
>
> prints out
>
> c=7
> c=
>
> I'd expect either $c to always to be 7, or always to be undef.
I guess it has something to do with:
# perldoc perlmod
A BEGIN subroutine is executed as soon as possible, that is,
the moment it is completely defined, even before the rest of
the containing file is parsed. You may have multiple BEGIN
blocks within a file--they will execute in order of
definition. Because a BEGIN block executes immediately, it
can pull in definitions of subroutines and such from other
files in time to be visible to the rest of the file. Once a
^^^^^^
BEGIN has run, it is immediately undefined and any code it
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
used is returned to Perl's memory pool. This means you
can't ever explicitly call a BEGIN.
That means it will never be executed twice.
Martien
--
Martien Verbruggen |
Interactive Media Division | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 10 Aug 1999 18:03:29 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: CGI newbie
Message-Id: <a11zdbe1ji.fsf@cyclone.jprc.com>
abigail@delanet.com (Abigail) writes:
> print "And now they are no longer! <blink>Buhahahahaha!<\/blink>\n";
^^^^^ ^^^^^^^
Now that's what I call an *evil* laugh.
---Jason
------------------------------
Date: 10 Aug 1999 23:15:27 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: CHMOD function
Message-Id: <slrn7r1ckf.ut4.M.Ray@carlova.ulcc.ac.uk>
On Tue, 10 Aug 1999 17:39:25 -0400, stirling@banet.net <stirling@banet.net>
wrote:
>
>>Your solution is *only* different from the original poster's in that
>>it's slower.
>>
>>It doesn't fix anything.
>----And yet the funny thing is, it works. The way I came up with this
>solution is that the original poster said that it worked without the
>variable substitution, but didn't work with the variable substitution. I
>had never seen anyone do it without double quotes, and I then *tested* this
>to see if it was true before posting it on the newsgroups (what I think
>everyone should do before posting solutions). This may be a Perl bug, but
>it exists.
That's very odd. Can you post a snippet of code which demonstrates it
failing without quotes and succeeding with? Plus the output of 'perl -V'.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: 10 Aug 1999 23:44:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: exists problem
Message-Id: <7oqdgc$2os$1@pegasus.csx.cam.ac.uk>
Gene LeFave <gene@tekdata.com> wrote:
>The exact error log is:
>. Premature end of script headers
>. Syntax error in file ... at line 68,
>. next 2 tokens " exists $in"
>. Execution of ... aborted due to compilation errors.
I smell a flea-bitten dead camel.
That's a Perl4 error message.
Mike Guy
------------------------------
Date: 10 Aug 1999 22:11:40 GMT
From: Margaret Escherich <glasscat@shell7.ba.best.com>
Subject: Re: finding array size
Message-Id: <37b0a39c$0$226@nntp1.ba.best.com>
Thanks for the great replies.
I need to send chunks of data to a memory challenged device and I'm exploring different techniques for
doing so.
thanks again,
Margaret
Ala Qumsieh <aqumsieh@matrox.com> wrote:
: Margaret Escherich <glasscat@shell7.ba.best.com> writes:
:> It's easy to find the size (in bytes) of a file with -s.
:>
:> How do you find the size of an array or a splice? how could I, for
:> example, take 400 bytes of an array?
: Now this is a question you don't see everyday!
: Why would you want 400 bytes of an array? AFAIK, Perl's arrays (unlike
: C's) do not occupy contiguous memory locations. So it is very hard to
: manipulate arrays in Perl by indexing their memory locations.
: Perhaps your question is not posed properly. Would care to explain
: what is it exactly that you are looking for?
: Ala
------------------------------
Date: Tue, 10 Aug 1999 23:47:26 +0100
From: "Troy Knight" <flexit@flexit.eurobell.co.uk>
Subject: Flocking, whassat?
Message-Id: <7oqa1k$vg4$1@slrn.eurobell.net>
I'm no perl expert as you will tell from this post and I have a question on
file locking.....What is it? I think it stops things getting mixed up when a
file is being read and written to, is this correct? I also think, correct me
if I'm wrong, that there are four functions you can use, can someone explain
what these are, and can someone also tell me when eactley I need to use file
locking.....thanks, much appreciated. By the way, I'm sorry if the answer is
lurkng somewhere in the faq's or docs, I have been looking there for ages
and can't find the answer.....
Troy
------------------------------
Date: Tue, 10 Aug 1999 16:22:34 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Flocking, whassat?
Message-Id: <MPG.121a541914a280ae989e27@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7oqa1k$vg4$1@slrn.eurobell.net> on Tue, 10 Aug 1999 23:47:26
+0100, Troy Knight <flexit@flexit.eurobell.co.uk> says...
> I'm no perl expert as you will tell from this post and I have a question on
> file locking.....What is it? I think it stops things getting mixed up when a
> file is being read and written to, is this correct? I also think, correct me
> if I'm wrong, that there are four functions you can use, can someone explain
> what these are, and can someone also tell me when eactley I need to use file
> locking.....thanks, much appreciated. By the way, I'm sorry if the answer is
> lurkng somewhere in the faq's or docs, I have been looking there for ages
> and can't find the answer.....
How hard did you look at perlfaq5? There are three successive entries:
How can I lock a file?
Why can't I just open(FH, ">file.lock")?
I still don't get locking. I just want to increment the number in the
file. How can I do this?
If after reading them and trying some experiemtns, you stillhave
problems, please ask again and show the code that failed to do what you
wanted.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 10 Aug 1999 16:15:27 -0700
From: JAMES GRONQUIST <JAMES.GRONQUIST@Sun.COM>
Subject: getting perl onto windows laptop
Message-Id: <37B0B28F.C4DB382C@Sun.COM>
I've got an older laptop computer. It is not connected to the net and
I'm trying to get perls for windows loaded onto it. The zip file is too
big for 1 disk. I've tried directly connecting the notebook to another
desktop using a serial cable but it would not work. Any ideas how I can
get perl onto this system? Is there anyplace that I can get perl on
floppies?
Tia,
Jim
*************************************************
james.gronquist@sun.com
M/S NWK11-205
Phone: 510/574-8415
Fax: 510/574-6591
Cell: 408/836-5207
*************************************************
------------------------------
Date: Tue, 10 Aug 1999 16:01:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <MPG.121a4f373dba2a21989e26@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <37b076fd$0$225@nntp1.ba.best.com> on 10 Aug 1999 19:01:17
GMT, John Callender <jbc@shell2.la.best.com> says...
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> > The first argument to split(), though for historical reasons often
> > written as a string, is really a regular expression. The vertical bar
> > is a regular-expression metacharacter.
>
> > Write that line thus:
>
> > @record = split(/\|/, $_[0]);
>
> > And all will be well. (This is on my Top Ten list of Perl surprises for
> > beginners. The vertical bar is a popular field separator!)
>
> If you really have such a list, I'd be very interested in seeing it.
Well, I'll show them, in no particular order. I'm sure others will be
able to slice and dice, transmogrify and improve.
I put this list together without looking at the 'Common Goofs for
Novices' section in the Blue Camel (page 528 et seq.). These are my
informal recollections from comp.lang.perl.misc.
Not included are mechanical failures, such as syntax errors, failure to
use '-w' and 'use strict;', etc. Those in the list are all semantic
errors, unremarked at run time except by bad results.
Also not included are performance botches (such as hideous sorts with
repeated complex key extraction) or poor algorithms (such as character-
at-a-time processing where functions would do the job), or style errors
(lower-case filehandles, upper-case variables, uninterpolating double-
quoted strings).
Failure to check for failure of system calls.
Failure to chomp() input lines.
Failure to binmode() a binary file.
Failure to escape metacharacters in split().
Failure to prefix directory before file tests using readdir().
Use of ==, etc. instead of eq, etc.
Use of = instead of == or eq.
Use of captured variables from regex match without checking for success.
Use of incorrect context: my $x = @_; my ($y) = @_;
Y2K and month-1 errors using localtime().
Confusion of Boolean tests for true/false, defined(), exists().
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 10 Aug 1999 22:19:15 GMT
From: goetz@cse.buffalo.edu (Phil Goetz)
Subject: http://www.perl.com gone?
Message-Id: <7oq8h3$dse$1@prometheus.acsu.buffalo.edu>
I have gotten a first-time newsgroup poster's message encouraging
me to find the FAQ at http://www.perl.com
Has that site moved? When I go there, I find only two links,
one to Perl and one to XML. The Perl link is inoperative,
and the XML link generates a server error.
This may be because I'm using Lynx. My X server broke yesterday.
Or has the FAQ moved?
Phil
------------------------------
Date: Tue, 10 Aug 1999 22:52:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: http://www.perl.com gone?
Message-Id: <y22s3.16$O21.2516@nsw.nnrp.telstra.net>
In article <7oq8h3$dse$1@prometheus.acsu.buffalo.edu>,
goetz@cse.buffalo.edu (Phil Goetz) writes:
> I have gotten a first-time newsgroup poster's message encouraging
> me to find the FAQ at http://www.perl.com
good advice. Better advice would be to look on the local hard drive of
the machine where perl is installed, or to install perl on your
machine. The FAQ is part of the distribution. The FAQ at perl.com used
to be quite out of date, but that could have changed by now.
> Has that site moved? When I go there, I find only two links,
> one to Perl and one to XML. The Perl link is inoperative,
> and the XML link generates a server error.
That's odd. When I look, I can see many links :)
> This may be because I'm using Lynx. My X server broke yesterday.
> Or has the FAQ moved?
The links are there in lynx as well. Maybe you should try again.
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Tue, 10 Aug 1999 22:02:17 GMT
From: TVsezSO <dave_man@my-deja.com>
Subject: HTTP_REFERER and Frames
Message-Id: <7oq7h2$1im$1@nnrp1.deja.com>
i am haveing a small prob with the environment variable HTTP_REFERER if
i call the cgi script from a frame page it returns the menu frame url
instead of the main frame. i am new at perl so forgive me if i say
something stupid. if someone could point me in the right direction to
find the information i need i would be most happy. Thanks --Dave
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 10 Aug 1999 15:25:15 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: list length
Message-Id: <m1hfm7clys.fsf@halfdome.holdit.com>
>>>>> "Derek" == Derek Sherlock <derek_sherlock@hp.com> writes:
Derek> My bad -- trying to infer a general principle where none exists!
It is one of the most common mistakes made by new users (and a few
experienced users :).
I suspect there are some bad tutorials out there (actually, more than
suspect, I've read them :) that talk about "converting a list to a
scalar". It's sad that people attempting to teach Perl don't first
get a good grasp and a clear vision of what Perl does to begin with.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 10 Aug 1999 23:40:35 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: list length
Message-Id: <7oqd9j$2ng$1@pegasus.csx.cam.ac.uk>
Gerhard Muth <gmuth@bytecare.com> wrote:
>
>Is there a way to get the number of elements of a list WITHOUT
>assigning it to a variable?
>
>e.g. Thread->list gives a list of Threads. This works fine but is
>not what I want:
>
>@l = Thread->list;
>print $#l." threads in list";
The standard (but not obvious) Perl idiom for this is
$length = () = Thread->list;
Determining how and why it works (and when it works) is left as an
exercise for the assiduous POD reader.
Mike Guy
------------------------------
Date: Tue, 10 Aug 1999 23:58:26 GMT
From: <dan@tuatha.sidhe.org>
Subject: Re: MIME::Lite newbie question
Message-Id: <C03s3.61$_04.2793@news.rdc1.ct.home.com>
In comp.lang.perl.modules mr_potato_head@my-deja.com wrote:
> Hi,
> Can anyone show me how to do multiple attachments using MIME::Lite?
> I'm able to do single attachments but I don't know how to do multiples.
> I also have a problem with sending text attachments. Everytime I send
> a text attachment it is loaded into the body of the message. Why? And
> finally, can anyone show me how to insert a variable in the file
> attachment section? I have mulitple files that I would like to attach,
> and I would like to pass these files into a variable to send so I can
> use this same script somewhere else. Thanks in advance...
If you're adding the text bits to a multipart/mixed, you're doing the
right thing. Many mail clients show all the text parts regardless of the
message structure, though. (PINE and Eudora do sometimes, and I'd bet the
Microsoft ones do too.
Basically nothing you can do about it, alas. You're best off sticking to
the standard and letting the mail clients misbehave. (Trying to fight them
is doomed to failure, alas)
Dan
------------------------------
Date: Tue, 10 Aug 1999 23:02:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Moving a Perlscript from NT to LINUX
Message-Id: <mc2s3.19$O21.2516@nsw.nnrp.telstra.net>
In article <37B09D40.1F94FB6@magnet.at>,
Thomas Schmickl <schmickl@magnet.at> writes:
> First I transformed them with "recode ibmpc:latin1 *.pl" into
> unix-textfiles, but
> I unfortionatly used german special characters in my code.
> So I know, this is not a pure PERL-question, but I think many of you
> guys/girls
> here might have had this problem before.
Not me, but the question gets asked here quite a bit. I don't know
that recode thingy, but it very likely is overkill. It probably did
more than just change the DOS line ends into Unix line ends. Either
use something like dos2unix, or something like
# perl -pi -e 's/\015$//' filenames
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Wed, 11 Aug 1999 01:24:07 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Moving a Perlscript from NT to LINUX
Message-Id: <Pine.HPP.3.95a.990811011755.8670A-100000@hpplus03.cern.ch>
On Tue, 10 Aug 1999, Martien Verbruggen wrote:
> In article <37B09D40.1F94FB6@magnet.at>,
> Thomas Schmickl <schmickl@magnet.at> writes:
>
> > First I transformed them with "recode ibmpc:latin1 *.pl" into
[...]
> Not me, but the question gets asked here quite a bit. I don't know
> that recode thingy, but it very likely is overkill.
"ibmpc" is the DOS codepage, and that definitely isn't what Windows uses
as its native storage encoding. So this performs a useful function, but
not the one that is wanted here.
> It probably did
> more than just change the DOS line ends into Unix line ends.
More than just "probably". If it doesn't convert DOS codepage to
iso-8859-1 then I demand a refund. It isn't what the questioner wants.
> Either
> use something like dos2unix,
Oh dear. I know two fundamentally different programs calling themselves
dos2unix. One converts DOS format to unix format (which is exactly what
the questioner doesn't want), and the other confuses everybody by only
converting newlines, and not converting DOS codepage to unix at all.
gruesse bzw. all the best
------------------------------
Date: Tue, 10 Aug 1999 23:27:08 GMT
From: jsmith19991@my-deja.com
Subject: Perl Question
Message-Id: <7oqcg1$572$1@nnrp1.deja.com>
I'm having a problem with a perl script. The problem
we are having is with the E-mailing of information to a
client. To make it simple, the scriptsends an Email to
someone after they enter their address (Mary Smith in
the following example). The script includes the following
lines for sending the mail:
...
open(MAIL,"|$mailprog -t");
print MAIL "To: Mary Smith\n";
print MAIL "From: John\n\n");
print MAIL "Subject: Information\n\n";
...
When the Email is received by the person however, the "From"
field reads not "John", but "John@whsun626.webhosting.com"
How do we get rid of the extra server info following the name?
We've tried a few things but it always reads the same.
Thank you for your time...
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 10 Aug 1999 23:17:28 +0100
From: "Martin Wachters" <GOAWAYSPAMBASTARDSmartin3@dds.nl>
Subject: PLEASE HELP: system call to another perl program...
Message-Id: <7oq8et$336$1@nclient15-gui.server.virgin.net>
Hi all!
I want to make a system call to another perl program from my perl program.
This works fine except when I create one of the second program's input files
in my first program. I even added a sleep statement to try to kludge the
problem...
The error message my perlprog2 gives suggests the inputfile has been
truncated...
- If don't create my inputfile on the fly (but use an existing one)
everything's fine
- If I run my perlprog2 on the command line afterwards everything's fine (so
the inputfile isn't truncated at all)
It seems like the system call kicks in too soon.
I tested this on both Solaris and NT the only difference seems to be a
slight difference in the place the file seems to get truncated
#more stuff...
create_inputfile("inputfile");
sleep 10;
system "perlprog2 inputfile @moreargs";
#nothing yet...
If anyone has an idea of what's going on and has an elegant solution he/she
would make me VERY HAPPY and FOREVER GRATEFUL by sending me an email!!!!!!
Regards,
Martin
GOAWAYSPAMBASTARDSmartin3@dds.nl
------------------------------
Date: Tue, 10 Aug 1999 22:56:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PLEASE HELP: system call to another perl program...
Message-Id: <o62s3.18$O21.2516@nsw.nnrp.telstra.net>
In article <7oq8et$336$1@nclient15-gui.server.virgin.net>,
"Martin Wachters" <GOAWAYSPAMBASTARDSmartin3@dds.nl> writes:
> Hi all!
HI!!!
> I want to make a system call to another perl program from my perl program.
No, you don't, and you can't. A system call is a call to the OS. What
you want to do is run another program using the system function. An
important difference.
> This works fine except when I create one of the second program's input files
> in my first program. I even added a sleep statement to try to kludge the
> problem...
Do you flush the output? close the file? Where's the code?
> It seems like the system call kicks in too soon.
How can it? The program won't run any earlier than you tell it to.
> create_inputfile("inputfile");
Now.. The code that makes up this sub would be a good thing to show to
us.
> would make me VERY HAPPY and FOREVER GRATEFUL by sending me an email!!!!!!
Nope. You posted a question here, and you can collect your answers
here.
Martien
--
Martien Verbruggen |
Interactive Media Division | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd. | make up 3/4 of the population.
NSW, Australia |
------------------------------
Date: Tue, 10 Aug 1999 18:20:08 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: pricing a perl job
Message-Id: <37B0A538.6E477CAC@chaos.wustl.edu>
Tom Mornini wrote:
> It was stupid. I hope, however, that we don't end up calling you "The
> "The person formerly known as brian d foy" after you've changed your name,
> offically, to some symbol, or perhaps to shorten it to much simpler "brian".
Good lord, now you go after his sense of style. I go by either HFB,
HappyFunBall or e. [pronounced e period]. What's wrong with a little flair?
> Of course, if you do, perhaps the original poster can create a visually
> appealing design for you! :-)
Hmmm. I've been thinking about a logo or design for myself, I wonder
what he charges...
/me flees laughing
e.
------------------------------
Date: Tue, 10 Aug 1999 15:49:03 -0700
From: Max Pinton <max@maxgraphic.com>
Subject: Re: pricing a perl job
Message-Id: <100819991549036242%max@maxgraphic.com>
$75 an hour. Logos usually cost around $600. Other designers charge
differently.
Simple, eh?
In article <37B0A538.6E477CAC@chaos.wustl.edu>, Elaine -HFB- Ashton
<elaine@chaos.wustl.edu> wrote:
> Tom Mornini wrote:
> > It was stupid. I hope, however, that we don't end up calling you "The
> > "The person formerly known as brian d foy" after you've changed your name,
> > offically, to some symbol, or perhaps to shorten it to much simpler "brian".
>
> Good lord, now you go after his sense of style. I go by either HFB,
> HappyFunBall or e. [pronounced e period]. What's wrong with a little flair?
>
> > Of course, if you do, perhaps the original poster can create a visually
> > appealing design for you! :-)
>
> Hmmm. I've been thinking about a logo or design for myself, I wonder
> what he charges...
>
> /me flees laughing
>
> e.
------------------------------
Date: 10 Aug 1999 19:26:10 -0400
From: dha@panix.com (David H. Adler)
Subject: Re: pricing a perl job
Message-Id: <slrn7r1d8h.57t.dha@panix.com>
On 10 Aug 1999 09:26:31 GMT, Tom Mornini <tmornini@netcom9.netcom.com> wrote:
>brian d foy <brian@pm.org> wrote:
>
>: * i'm a lot better and faster than you are, so the time it takes
>: *me* to do the job is of no relevance to the amount *you* should
>: charge
>
>: * i cost a lot more than you do.
>
>These statements are incredibly arrogant since they are likely not based on
>fact, regardless of how true they might be.
Maybe it's just me, but I found it to be *quite* clear that both
statements above had an implicit "as a Perl programmer" at the end.
Given that, the original post made it clear that they are, in fact,
true.
>If, Brian D. Foy, (correct capitalization and punctuation not accidental),
Perhaps that is correct for Mr. Foy - whoever he is...
>you know these statements to be true because you have worked with him AND
>know what he charges, then I retract the above statement and humbly apologize.
I had assumed that he was telling the truth when he said that this was
his first Perl work of note.
>: there is no way that
>: you'll be able to get those rates.
>
>Oh my! I'm sure no one else makes as much money as YOU do, hey Brian?
>
>After spending a huge amount of time telling him how to charge, and
>making it very clear to him that he can charge anything that he wants
>and can get his client to agree to, why would you now suggest that he
>couldn't POSSIBLY get some fixed amount?
Now you're just being argumentative. He won't get that kind of money
because he's barely a professional (*as a Perl programmer*, I hasten
to add before you make the same parsing error again :-/ ).
I think the information brian posted *was* helpful... assuming one
takes it in the spirit in which it was intended, rather than as a
flame.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"I go where I will and I do what I can" - Henry Fool
------------------------------
Date: Tue, 10 Aug 1999 23:35:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: reference to object method
Message-Id: <JG2s3.41$O21.3375@nsw.nnrp.telstra.net>
In article <37b09772@news5.newsfeeds.com>,
"David Christensen" <dchristensen@california.com> writes:
> Hello, World!
>
> I have started working with Perl objects, and am stuck:
>
> How do I create a reference to an object method?
I totally fail to see why you would want to do that. Since an object
method is virtually useless without the object reference, I fail to
see its use. Remember that perl passes the object reference as the
first argument to a object method.
[I'll reorder your post slightly]
> # function
> sub FooOnYou {
> $self = shift;
> print @_;
> }
This however, is an awful hybrid of an object method and a class level
method, but in functionality is neither. If you want an object method,
it should act on the object. If you want a class method, it should act
on the class. Anything else is just a sub, but could be seen as a
class method.
package Class;
sub objMethod {
my $self = shift;
# do something with $self
}
# called as $obj->objMethod
# Class methods can be written in many ways, depending on how you want
# to use them:
sub classMethod {
my $proto = shift;
my $class = ref($proto) || $proto;
# Do something with class variables
}
# called as Class->classMethod or $obj->classMethod
sub classMethod {
my $class = shift;
}
# called as Class->classMethod
sub ordinarySub {
# Do something
}
# called as Class::ordinarySub
First, you'll need to decide what sort of sub you need. You get a
reference to the sub by doing something like:
my $ref = \&Bar::FooOnYou;
When you call this again, you'll be responsible for supplying the
correct arguments, because from here on, you've lost the blessed
object. What you get is a reference to the sub, not a reference to an
object specific version of that sub. There is no such thing. This
means that if you get a reference to an object method, you will have
to call it like this:
&$ref($bar, "Howdy\n");
always making sure that the first argument is a blessed reference. So,
why would you want to do that? The above is exactly the same as:
$bar->FooOnYou("Howdy\n");
I suspect there are ways of getting a sub reference based on a blessed
reference (possibly using ref, I abhor it too much to try to figure it
out)., but I wouldn't bother. If you want a method to be an object
method, use it as such. If you want it to be a class reference, use it
as such. If you want it to be a sub in a different name space, use it
as such, and if you take a reference to a sub, the last is what you
get.
> How do I dereference the reference?
I suspect you want something like:
$bar->$ref->(@arguments);
But that's not the way this works. You'd be hard pressed to get
anything elegant using that sort of syntax.
&$ref($bar, @arguments);
is probably the best thing, but it doesn't look very oo anymore, does
it?
The fact that you are trying this sort of tells me that you might have
designed your classes incorrectly or clumsily. I'd probably recosider
that before trying to juggle code references in this way.
Martien
--
Martien Verbruggen |
Interactive Media Division | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd. | make up 3/4 of the population.
NSW, Australia |
------------------------------
Date: 11 Aug 1999 00:01:14 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: reference to object method
Message-Id: <7oqega$hje$1@towncrier.cc.monash.edu.au>
"David Christensen" <dchristensen@california.com> writes:
> How do I create a reference to an object method?
> How do I dereference the reference?
> my $ref = \$bar->FooOnYou;
> &$ref("Howdy\n");
> my $ref = \&bar->FooOnYou;
> &$ref("Howdy\n");
> And several others...
>Can it be done? What's the syntax?
my $ref = \&Bar::FooOnYou; # methods, even object methods, belong to
# classes not individual objects
$var->$ref("Howdy\n"); # object methods must be called on objects
# even when called via a reference.
If you *really* want to be able to call the method as:
&$ref("Howdy\n");
(and you might, if you were using it as a callback or something
similar), then you'll need to use a closure:
my $bar = Bar->new(); # as before
$ref = sub { $bar->FooOnYou(@_) }; # wrap up object and method call
# in an anonymous subroutine
&$ref("Howdy\n"); # call it
Damian
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 V9 Issue 452
*************************************