[19517] in Perl-Users-Digest
Perl-Users Digest, Issue: 1712 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 7 18:06:05 2001
Date: Fri, 7 Sep 2001 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999900309-v10-i1712@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 7 Sep 2001 Volume: 10 Number: 1712
Today's topics:
Re: ActivePerl says Out of Memory, but I'm not out of m <bart.lateur@skynet.be>
Re: Confused (again) over complex data structures. (Abigail)
Re: File::Find not recursing on Win32 Perl 5.001 <gnarinn@hotmail.com>
Re: HASH question <pilsl_@goldfisch.at>
Re: How do I use a / in a regular expression? nobull@mail.com
Re: How do I use a / in a regular expression? <mmynsted@prodigy.net>
Re: How do I use a / in a regular expression? <james@zephyr.org.uk>
Re: How do I use a / in a regular expression? <mmynsted@prodigy.net>
Re: How do I use a / in a regular expression? <bart.lateur@skynet.be>
Re: Linking pages dynamically <gnarinn@hotmail.com>
Re: Linking pages dynamically <cpryce@pryce.net>
Long ints (J. Hanson)
Re: Long ints <dan@tuatha.sidhe.org>
Matching 2 lines (Please HELP) (Ken Laird)
Re: Matching 2 lines (Please HELP) <uri@sysarch.com>
Re: my CGI don't want to terminate the execution... nobull@mail.com
Re: my CGI don't want to terminate the execution... <gnarinn@hotmail.com>
Object methods, chaining and the not-so-mythical 'wantm <djberge@qwest.com>
Re: Object methods, chaining and the not-so-mythical 'w <uri@sysarch.com>
Re: Perl Version <bart.lateur@skynet.be>
Re: Perl Version <jurgenex@hotmail.com>
Re: Perl Version (Malcolm Dew-Jones)
pictures saving problem... <wm@rd66.rr.nu>
Re: POST form data from e-mail client <gnarinn@hotmail.com>
Re: Problem with mail module <bart.lateur@skynet.be>
Re: resume <uri@sysarch.com>
Re: resume <uri@sysarch.com>
system() error message <mattc@country-life.com>
Re: Timezone offset <bart.lateur@skynet.be>
Re: user 'passwd' to change unix password in Perl scrip <gnarinn@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 07 Sep 2001 19:07:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: ActivePerl says Out of Memory, but I'm not out of memory? Is this a limitation in the Perl build I have?
Message-Id: <2b6iptc68jt75sssa4qn89kqp88t57er6g@4ax.com>
Jonadab the Unsightly One wrote:
>Maybe I don't understand my; my impression was that it
>did C-style lexical scoping -- i.e., if foo() has a my
>variable and calls bar(), bar() doesn't see the same
>value that foo() sees. That would be bad; the whole
>algorithm wouldn't work then, or I'd have to pass a
>lot more parameters, or convert everything to one big
>function. What I want lisp-style scoping, where every
>function sees the dynamically scoped value set by foo()
>until that iteration of foo() exits, at which point it
>should revert to the previous value -- I was under the
>impression that this is what local is for. That's my
>understanding of what the 2nd ed. camel book says, for
>example, in the glossary under "scope". But everyone
>seems to be steering me in the other direction -- have
>I totally misunderstood how my and local work?
No, you're right. People here seem to think "my" is the best think since
ice cream, and "local" is frowned upon.
If dynamic scoping is what you want, by all means, use local. But don't
forget indeed using it, then. It looks like people here have assumed
that some stuff grew indefinitely.
p.s. I once wrote a function that did calculus, symbolic derivations of
functions, with built-in clean up. It's typically an application where
traditionally one would use Lisp. Well: for trigonometric functions, I
often got out of memory errors after only 6 to 8 levels deep. It looks
like this is an application area that is extremely memory intensive.
--
Bart.
------------------------------
Date: 7 Sep 2001 19:11:23 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Confused (again) over complex data structures.
Message-Id: <slrn9pi726.kuj.abigail@alexandra.xs4all.nl>
Tassilo v. Parseval (Tassilo.Parseval@post.rwth-aachen.de) wrote on
MMCMXXIX September MCMXCIII in <URL:news:9n9ofb$92q$1@nets3.rz.RWTH-Aachen.DE>:
== On 6 Sep 2001 22:37:23 GMT, Abigail <abigail@foad.org> wrote:
== > Tassilo von Parseval (Tassilo.Parseval@post.rwth-aachen.de) wrote on
==
== > }} $stho->execute ( @{$records_array_ref->[$i++]} )
== > }}
== > }} Both Uri and Randal in general spoke in favour of the notation with the
== > }} curly brackets. The advantage over the shortcut is that this will always
== > }} work and you wont accidently run into errors.
== >
== > Well, in that case, one should also always use
== >
== > $ref -> [0] -> {foo} -> [10];
== >
== > instead of the "shortcut"
== >
== > $ref -> [0] {foo} [10];
==
== Take it or leave it, I do use the longer notation here as well. It costs
== me two more characters each time but that's a fair trade-off. The '->'
== is quite intuitive in my eyes: $ref->[0] := give me the first element of
== the array that is referenced by $ref.
Well, *that* arrow is mandatory.
== > Or perhaps better, one should always fully parenthesize arithmetic
== > expressions, and not use "short cuts" by leaving them out. After all,
== > that's what the pair of braces after the @ is doing: denoting precedence.
==
== But you saw what happened to the OP's author. He thought he could use
== the "shortcut" and hence screwed up precedence.
== And this comparison to parenthesizing arithmetic expressions isn't quite
== fair since children learn the arithmetic precedence at the ago of ten or
== at latest eleven.
Really? Do they learn the relative precedence of =, ?:, <<, ., and &?
People *do* keep making mistakes with them, and often their problems
end up in this group. But would that be a reason to suggest to always
fully parenthesize ones expressions? I think not. Then why should we with
@{} (and ${}, %{} and &{}).
== This is not the case with Perl and its stupendously
== expressive syntax. In 99% of all cases, you could make any Perl program
== a one-liner, yet you don't do it. Why not? ;-)
Because it would make POD and comments harder.
Abigail
--
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
. "\162\1548\110\141\143\153\145\162\0128\177" and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}
------------------------------
Date: Fri, 7 Sep 2001 18:58:05 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: File::Find not recursing on Win32 Perl 5.001
Message-Id: <999889085.104888692963868.gnarinn@hotmail.com>
In article <979ae699.0109070401.3ceb8a98@posting.google.com>,
Phil Hibbs <phil@snark.freeserve.co.uk> wrote:
>Dave Tweed <dtweed@acm.org> wrote in message news:<3B977EDA.62B755E4@acm.org>...
>> Try this. It's code that I've used, with minor tweaks, on DOS and Windows
>> platforms since Perl4 days.
>
>Thanks, that works!
>
>What does this mean:
> local (*DIR);
did you look at the docs?
perldoc local
perldoc perlsub
perldoc -q "filehandle local"
gnari
------------------------------
Date: Fri, 7 Sep 2001 20:18:12 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: HASH question
Message-Id: <3b990f68@e-post.inode.at>
Michael Carman wrote:
>
> "Do not meddle in the afairs of wizards, for they are subtle and quick
> to anger." (JRRT) :)
>
;) This was one of my dreams when I was younger and read the red book and
its surrounders over and over: to write a psychological profile about
Gandalf the Grey ...
Your answer is very ok. I agree that I should be a bit more specific in the
future. I had the feeling that the person is used with perl, but not with
anonymous structures.
The point why I personally destroy a deep structure 'manually' by doing
recursion is that the structure is very complex and is partially
crossreferenced in other structures, so garbage-collection by just deleting
the top-pointer wont work here. In fact I had small memleaking which is bad
in mod_perl-modules that need to run for weeks.
I agree that this design is not the best, buts its the way it is. I just
thought it would be a good example how to handle deep structures and
determine the type of given structures which was part of the OP's question.
I still think that my posting was actually better than no posting. But you
are right that a more detailed and specific posting would have been the
propert way to do it.
thnx for this posting,
peter
--
mag. peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: 07 Sep 2001 19:09:35 +0100
From: nobull@mail.com
Subject: Re: How do I use a / in a regular expression?
Message-Id: <u9r8tig9eo.fsf@wcl-l.bham.ac.uk>
Mark Mynsted <mmynsted@prodigy.net> writes:
> I want to remove all of the <font> and </font> type tags from many
> files. Something like the following would work if possible...
>
> perl -pi -e 's/\</?font.*?\>//ig' file
You need to quote the / with a \ or, alternatively use a different
delimiter for the s/// operator. Since this is being executed via
Unix shell you also need to escape the \ that escapes the /. BTW:
There;'s no need to escape the < and > in Unix shell if they are
already quoted by ''.
perl -pi -e 's/<\\/?font.*?>//ig' file
perl -pi -e 's!</?font.*?>!!ig' file
> Any help would be great. This is my first attempt at any perl.
Make life easy for yourself. Get some pratice with Perl scripts
before playing with one-liners which require expertese in both Perl
and Shell!
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 07 Sep 2001 19:03:57 GMT
From: Mark Mynsted <mmynsted@prodigy.net>
Subject: Re: How do I use a / in a regular expression?
Message-Id: <m2n146q0xx.fsf@mmynsted.corp.vha.com>
nobull@mail.com writes:
> Mark Mynsted <mmynsted@prodigy.net> writes:
>
> > I want to remove all of the <font> and </font> type tags from many
> > files. Something like the following would work if possible...
> >
> > perl -pi -e 's/\</?font.*?\>//ig' file
>
> You need to quote the / with a \ or, alternatively use a different
> delimiter for the s/// operator. Since this is being executed via
> Unix shell you also need to escape the \ that escapes the /. BTW:
> There;'s no need to escape the < and > in Unix shell if they are
> already quoted by ''.
>
> perl -pi -e 's/<\\/?font.*?>//ig' file
> perl -pi -e 's!</?font.*?>!!ig' file
>
> > Any help would be great. This is my first attempt at any perl.
>
> Make life easy for yourself. Get some pratice with Perl scripts
> before playing with one-liners which require expertese in both Perl
> and Shell!
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
Great. Thank you! :-)
P.S. I like your ASCII art.
--
-MM
/"\
(No un-solicited email please.) \ / ASCII Ribbon Campaign
See following url, X Against HTML Mail
http://pages.prodigy.net/mmynsted/spamoff.htm / \
------------------------------
Date: Fri, 7 Sep 2001 20:34:22 +0100
From: James Coupe <james@zephyr.org.uk>
Subject: Re: How do I use a / in a regular expression?
Message-Id: <2NBtu$J+ESm7EwCR@gratiano.zephyr.org.uk>
In message <m266avq7jv.fsf@mmynsted.corp.vha.com>, Mark Mynsted
<mmynsted@prodigy.net> writes
>I want to remove all of the <font> and </font> type tags from many
>files. Something like the following would work if possible...
Before implementing this, you may care to read:
perldoc -q HTML
--
James Coupe PGP Key: 0x5D623D5D
Close your eyes so you don't feel them EBD690ECD7A1F
They don't need to see you cry B457CA213D7E6
I can't promise I will heal you, but if you want to I will try 68C3695D623D5D
------------------------------
Date: Fri, 07 Sep 2001 20:02:25 GMT
From: Mark Mynsted <mmynsted@prodigy.net>
Subject: Re: How do I use a / in a regular expression?
Message-Id: <m2elpipy8h.fsf@mmynsted.corp.vha.com>
James Coupe <james@zephyr.org.uk> writes:
> In message <m266avq7jv.fsf@mmynsted.corp.vha.com>, Mark Mynsted
> <mmynsted@prodigy.net> writes
> >I want to remove all of the <font> and </font> type tags from many
> >files. Something like the following would work if possible...
>
> Before implementing this, you may care to read:
>
> perldoc -q HTML
>
> --
> James Coupe PGP Key: 0x5D623D5D
> Close your eyes so you don't feel them EBD690ECD7A1F
> They don't need to see you cry B457CA213D7E6
> I can't promise I will heal you, but if you want to I will try 68C3695D623D5D
Thank you.
--
-MM
/"\
(No un-solicited email please.) \ / ASCII Ribbon Campaign
See following url, X Against HTML Mail
http://pages.prodigy.net/mmynsted/spamoff.htm / \
------------------------------
Date: Fri, 07 Sep 2001 21:33:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How do I use a / in a regular expression?
Message-Id: <8geipt8g5gtmorr50kd0a5gi9vu5soddg5@4ax.com>
Mark Mynsted wrote:
>I want to remove all of the <font> and </font> type tags from many
>files. Something like the following would work if possible...
>
>perl -pi -e 's/\</?font.*?\>//ig' file
>
> ^
>It will not because of the / char. The following also does not work.
Put a backslash in front of it.
perl -pi -e 's/\<\/?font.*?\>//ig' file
Or, as the other poster wrote, you can replace the '/' delimiters with
something else,
single delimiters:
s!PAT!SUBST!
s@PAT@SUBST@
s:PAT:SUBST:
s;PAT;SUBST;
or with mathing pairs:
s(PAT)(SUBST)
s[PAT][SUBST]
s{PAT}{SUBST}
s<PAT><SUBST>
--
Bart.
------------------------------
Date: Fri, 7 Sep 2001 19:26:08 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Linking pages dynamically
Message-Id: <999890768.991876808926463.gnarinn@hotmail.com>
In article <3b98cfda@news-uk.onetel.net.uk>, Edd <edd@texscene.com> wrote:
>How can you generate dynamic pages with more than one page linking with each
>other.
huh?
>I have a list of items to list on my web site which runs to hundreds
>so they should be listed in more than one page , each page having a
>hyperlink conection displayed to the other pages.
>
>I have been doing this by opening files and creating a file for each page
>using PERL only. But now, I have to generate these dynamically. The list of
>items are stored in a mysql data table.
>
>I can list all the items on one dynamically generated page but not if I want
>to put them on separate linked pages.
why not?
>
>I thought of using forms with submit buttons for each page and each submit
>button running another cgi program but, this can't be the right solution.
if you are trying to say that you want a bunch of different urls to
point at the same underlying cgi, then there a re many ways to do it
you can use the querystring to specify the page:
http://bla.com/cgi-bin/yourscript?page=234
you can use the PATH_INFO trick:
http://bla.com/cgi-bin/yourscript/234
you can use some other webserver method, like Apaches mod_rewrite
http://bla.com/pages/234.html (mapped to cgi-bin/yourscript?page=234)
i am sure there are more
however, if your question was something else, maybe some examples
would help us grok your problem.
gnari
------------------------------
Date: Fri, 7 Sep 2001 16:12:19 -0500
From: "cp" <cpryce@pryce.net>
Subject: Re: Linking pages dynamically
Message-Id: <4Iam7.20496$x84.5130683@ruti.visi.com>
"gnari" <gnarinn@hotmail.com> wrote in message
news:999890768.991876808926463.gnarinn@hotmail.com...
> In article <3b98cfda@news-uk.onetel.net.uk>, Edd <edd@texscene.com> wrote:
> >How can you generate dynamic pages with more than one page linking with
each
> >other.
>
> huh?
>
> >I have a list of items to list on my web site which runs to hundreds
> >so they should be listed in more than one page , each page having a
> >hyperlink conection displayed to the other pages.
I'm with gnari, I'm not so sure that I understand what you're doing. But if
I read your question coorectly, HTML::Template and HTML::Pager might solve
your problem. They are listed on CPAN.
--
cp
------------------------------
Date: 7 Sep 2001 17:57:10 GMT
From: jph@u.washington.edu (J. Hanson)
Subject: Long ints
Message-Id: <9nb1pm$fns$1@nntp6.u.washington.edu>
I am working on an alpha with 8 byte longs. Perl pack and
unpack, however, treats longs as 4 bytes. Is my perl
mis-configured or is this a perl standard? See below for
code details.
Thanks for your help.
------------------
size.c:
void main(void) {
printf("short %d\n", sizeof(short));
printf("int %d\n", sizeof(int));
printf("long %d\n", sizeof(long));
printf("void * %d\n", sizeof(void *));
exit (0);
}
output from size.c:
short 2
int 4
long 8
void * 8
t.pl:
#!/usr/local/bin/perl
$out = pack 'L', 6;
print "$out";
exit 0;
running od -tx1 (hex dump) on the output of t.pl:
0000000 06 00 00 00
0000004
------------------------------
Date: Fri, 07 Sep 2001 18:34:16 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Long ints
Message-Id: <Iq8m7.315356$v5.31638104@news1.rdc1.ct.home.com>
J. Hanson <jph@u.washington.edu> wrote:
> I am working on an alpha with 8 byte longs. Perl pack and
> unpack, however, treats longs as 4 bytes.
Well, more to the point perl considers the "l" in pack
to represent a 32-bit integer.
> Is my perl mis-configured or is this a perl standard?
If your perl is of reasonably recent vintage you may have
the q and Q pack options. Check the docs for pack and,
if you don't have 'em (I think they came in with 5.6.0)
you'll have to upgrade to easily pack 64-bit integers.
Dan
------------------------------
Date: Fri, 07 Sep 2001 21:19:10 GMT
From: kenlaird@yahoo.com (Ken Laird)
Subject: Matching 2 lines (Please HELP)
Message-Id: <iRam7.46598$ju1.1421864@amsnews02.chello.com>
I‘ve got this file:
...
data
#
#
# name nameofservice-a
#
service1 2222
#
#
# name nameofservice-b
service2 5555
#
#
#
# name nameofservice-c
#
#
#
service3 6666
#
#
#
data
...
and would like to get every service and the name-of-service which precedes
a few lines before it.
Would be very grateful for any solution proposed.
Cordially
Ken Laird
------------------------------
Date: Fri, 07 Sep 2001 21:30:40 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Matching 2 lines (Please HELP)
Message-Id: <x7ae06g035.fsf@home.sysarch.com>
>>>>> "KL" == Ken Laird <kenlaird@yahoo.com> writes:
KL> data
KL> #
KL> #
KL> # name nameofservice-a
KL> #
KL> service1 2222
KL> #
KL> #
KL> # name nameofservice-b
KL> service2 5555
KL> and would like to get every service and the name-of-service which
KL> precedes a few lines before it.
KL> Would be very grateful for any solution proposed.
perl -ne 'print if /#\s*name/ .. /^service\d/'
your spec is not clear enough to do more than that. are 'name' and
'nameofservice' placeholders? maybe there is more to the file that can
be used to parse it? too many possibilities.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: 07 Sep 2001 19:25:04 +0100
From: nobull@mail.com
Subject: Re: my CGI don't want to terminate the execution...
Message-Id: <u9n146amf3.fsf@wcl-l.bham.ac.uk>
lotfixe@yahoo.fr (lotfi) writes:
> I have wrote a little CGI that search on a very big database, so my
> CGI don't want to terminate the execution, and the browser showed me
> that he can't download the result page
> I think that this is because of the timing out of the server, or of
> the browser, is this correct
Yes, you are correct in your assesment that this is related to the
server or the browser and not related to Perl.
> please help me, I am lost since 3 weeks
For really slow database operations I recommend that your script
fork-off to build the results page in a file and redirect the user to
another script that looks to see if query has finised and redirects
the user to the results page. If the query has not completed the
second script can simply say "bookmark this page and return here to
see if your query has completed".
There are many other techniques for this and they are often discussed
in newsgroups where CGI is discussed.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 7 Sep 2001 20:19:31 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: my CGI don't want to terminate the execution...
Message-Id: <999893971.885082120075822.gnarinn@hotmail.com>
In article <c1f8a8d9.0109070744.4df45160@posting.google.com>,
lotfi <lotfixe@yahoo.fr> wrote:
>I have wrote a little CGI that search on a very big database, so my
>CGI don't want to terminate the execution, and the browser showed me
>that he can't download the result page
>I think that this is because of the timing out of the server, or of
>the browser, is this correct
well, yes, if the cgi does not terminate, the webserver/browser
will timeout.
but if the cgi does not terminate, then maybe there is an infinite loop
or something. if the cgi just takes *very* long, you should see if the
search can be optimized. if it cannot, then maybe fork a background
process to do the search, and return a page to the user that says to come
back later to some special url.
gnari
------------------------------
Date: Fri, 7 Sep 2001 15:52:21 -0500
From: "Mr. Sunblade" <djberge@qwest.com>
Subject: Object methods, chaining and the not-so-mythical 'wantmethod'
Message-Id: <Bnam7.2873$k73.465993@news.uswest.net>
<Uri Guttman wrote, and others concurred...>
<some snippage>
S> I think what I really need is a fictional 'wantmethod' function
S> which would somehow do a lookahead, checking to see what the next
S> operation on an object is. The code would be something like:
>>well, you can't have that. in fact it makes little sense since context
>>is propogated via runtime and can be very complex.
S> if(wantmethod){ # return blessed copy of self }
S> elsif(defined wantarray){ # return a scalar or list }
S> else{ # return self }
>>no. forget about it.
>>perl methods are nothing more than regular subroutines called with the
>>object/class as the first argument. so it can't tell the sub that it was
>>a method call and it wants to be chained. you either support chaining or
>>not.
>>uri
Liar, liar, pants on fire... :-P
Well, I had all but resigned myself after this post and posts by Benjamin,
Abigail and John. But then, I was looking at the latest Perl Journal issue
and I happen to see mention of the 'Want' module!
Here were my original requirements:
if(wantmethod){ # return blessed copy of self; original self unmodified }
elsif(defined wantarray){ # return a scalar or list; self unmodified }
else{ # return modified self }
...so I look through the Want module documentation, I find a
'want('OBJECT')' method. So I can now do this:
if(want('OBJECT')){ # return blessed copy of self; original self
unmodified }
elsif(defined wantarray){ # return a scalar or list; self unmodified }
else{ # return modified self }
Then again, maybe I never explained myself clearly the first time around.
:-o
Regards,
Mr. Sunblade
------------------------------
Date: Fri, 07 Sep 2001 21:03:58 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Object methods, chaining and the not-so-mythical 'wantmethod'
Message-Id: <x7elpig1bp.fsf@home.sysarch.com>
>>>>> "S" == Sunblade <djberge@qwest.com> writes:
S> <Uri Guttman wrote, and others concurred...>
>>> perl methods are nothing more than regular subroutines called with the
>>> object/class as the first argument. so it can't tell the sub that it was
>>> a method call and it wants to be chained. you either support chaining or
>>> not.
S> Liar, liar, pants on fire... :-P
S> Well, I had all but resigned myself after this post and posts by Benjamin,
S> Abigail and John. But then, I was looking at the latest Perl Journal issue
S> and I happen to see mention of the 'Want' module!
yes, that is one way. it is not well known yet and it uses XS to get at
internal stuff so it can determine more about the calling context.
a similar (and more powerful) want function will be in perl6. in fact
some asked why you would want want to support an object reference and i
quoted your desire to have an object support both chaining and a value
return context.
S> Then again, maybe I never explained myself clearly the first time
S> around. :-o
that always help. core perl cannot do it. the Want module seems to do
exactly what you want.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 07 Sep 2001 18:58:30 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl Version
Message-Id: <2p5iptsvf6f6dmt1ijv7q97qmfen2hglkq@4ax.com>
George C. Demetros wrote:
>Is there anyway to determine the version of perl without running the binary?
>I know within a perl script you can look at the setting of $]. But I need to know
>a fast way of determining this version without running perl.
Eh, why? "perl -v" will tell you what it is. In addition, "perl -V" can
tell you far more than you ever wanted to know (tm).
--
Bart.
------------------------------
Date: Fri, 7 Sep 2001 12:31:44 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl Version
Message-Id: <3b9920a1@news.microsoft.com>
"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:2p5iptsvf6f6dmt1ijv7q97qmfen2hglkq@4ax.com...
> George C. Demetros wrote:
>
> >Is there anyway to determine the version of perl without running the
binary?
> >I know within a perl script you can look at the setting of $]. But I
need to know
> >a fast way of determining this version without running perl.
>
> Eh, why? "perl -v" will tell you what it is. In addition, "perl -V" can
> tell you far more than you ever wanted to know (tm).
Well, sure. But even "perl -v" still runs the perl binary.
On Windows you could check for the file version of perl.exe. It says
something like e.g. 5.6.1.629 (which would be Perl 5.6.1, build#629).
Don't know how to check this on a Unix system, though.
jue
------------------------------
Date: 7 Sep 2001 13:02:52 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Perl Version
Message-Id: <3b9927ec@news.victoria.tc.ca>
George C. Demetros (demetros@vnet.ibm.com) wrote:
: Hi.
: Is there anyway to determine the version of perl without running the binary?
: I know within a perl script you can look at the setting of $]. But I need to know
: a fast way of determining this version without running perl. Is there any file
: I can read that contains the version in it and is it dependably there across
: versions?
: Thanks.
$perl_root / lib / Config.pm
assuming it is the correct one for the perl install. You could grep it to
dig out details without using perl.
e.g.
grep "\$]" lib/Config.pm
File lib/Config.pm:
$] == 5.00503
or die "Perl lib version (5.00503) doesn't match executable version
($])";
I think that the config file always exists in a working install, though it
is possible for the file to be out of sync since it's just a seperate
file. (I don't know how likely that would be.)
--
Want to access the command line of your CGI account? Need to debug your
installed CGI scripts? Transfer and edit files right from your browser?
What you need is "ispy.cgi" - visit http://nisoftware.com/ispy.cgi
------------------------------
Date: Fri, 07 Sep 2001 21:46:53 GMT
From: "WebMeester" <wm@rd66.rr.nu>
Subject: pictures saving problem...
Message-Id: <hfbm7.1285$e6.28999@news.chello.be>
Hi,
I have to write a script that takes a few pictures (.gif and .jpg) from one
webserver and saves them on an other webserver (kind of a mirror thing). The
script I've written (using LWP) works partially. It does retrieve the pictures
and saves them on the other server, but when I open a picture, it is all
scrambled.
Obviously, I'm doing something wrong, but I can't figure it out.
The code is as follow:
* BEGIN *******************
use LWP::UserAgent;
use LWP::MediaTypes qw(guess_media_type);
use IO::File;
$ua = new LWP::UserAgent;
$address = $ARGV[0];
$outputfile = $ARGV[1];
$ua->agent ('Mozilla/3.0');
my $req = new HTTP::Request 'GET', $address;
$type = guess_media_type($address);
$req->content_type($type);
my $res = $ua->request($req);
$figuur = $res->content;
$fh = new IO::File "> $outputfile";
if (defined $fh) {
print $fh "$figuur";
$fh->close;
}
* END *******************
Thanks for any help provided.
--
Rudy
_________________________________________________________________
http://www.rol.be
Bezoek de evenementenkalender, op dit moment meer dan 450 evenementen!!!!!!
En niemand die u belet om uw fuif, concert, galabal, ... eraan toe te voegen :-)
<+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+>
| I'm not a complete idiot - some parts are missing.
| Wie het laatst lacht, sterft tenminste vrolijk!
<+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+><+=*°*=+>
------------------------------
Date: Fri, 7 Sep 2001 18:50:42 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: POST form data from e-mail client
Message-Id: <999888642.557337233796716.gnarinn@hotmail.com>
In article <b02m7.1421$Rd5.10452@NewsReader>,
Mike Dobson <miked@rdi-clear.com> wrote:
>
>I have an "E-mail this Vote Poll to a friend" set up on a site which send a
>copy of the poll to their e-mail so they can vote directly from their e-mail
>client (HTML enabled), similar to the www.devx.com e-mails I get.
>
>The problem I'm having is that the form is current set to method="POST"
>which doesn't seem to pass on the form data but does using method="GET"
>(which makes sense). DevX use POST but send the data to ASP.
>
>Before I make alterations to the script is it possible the receive POST form
>data from an e-mail client to the Perl/CGI script.
>
>Cheers in advance for any advice/comments
I do not understand what your problem is, but if you are not using
CGI.pm , then the solution is:
use CGI;
gnari
------------------------------
Date: Fri, 07 Sep 2001 21:33:25 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Problem with mail module
Message-Id: <k6ciptcruie0gjh6u3clv4it70kmuetcds@4ax.com>
John@home.net wrote:
>The problem is this: it works, but only about half of the time. I
>really need to get it to work 100% of the time.
So when is it not working? When no connection with an SMTP server can be
made?
Then you need a queueing mailer. Sendmail does such a thing on Unix,
IIRC.
--
Bart.
------------------------------
Date: Fri, 07 Sep 2001 19:00:15 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: resume
Message-Id: <x7lmjqg71v.fsf@home.sysarch.com>
this was so clueless as to guarantee you will not to be hired by anyone
here. spamming usenet with redmondware resumes is a losing proposition.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 07 Sep 2001 19:23:42 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: resume
Message-Id: <x7heueg5yr.fsf@home.sysarch.com>
>>>>> "JB" == Jerry Brown <jsbrown15@home.com> writes:
JB> AAARRGGGHHH!!!
JB> Sorry about that, folks, I was sending my resume to myself while perusin=
JB> g=20
JB> the collective wisdom in the newsgroup here, got things crossed up in=20
JB> Star Office. Shoulda stuck with mutt....
JB> Profuse apologies.
apology accepted.
now learn how to quote correctly. put your quoted BELOW the edited quote.
<jeopardectomy>
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 07 Sep 2001 17:05:25 -0400
From: Matt Carey <mattc@country-life.com>
Subject: system() error message
Message-Id: <3B993695.F61C317F@country-life.com>
I have a perl program(running on Linux/Apache) that accepts form data
from a web page(consisting of textareas) and then uses a remote shell
command to pass the form data to another server( an HP-UX).
$runcommand = "rsh consac /usr/bin/nsperl
/u/data/CONSAC/SRC.PERL/runuvprog.pl $data";
$result = system($runcommand);
Upon completion of the system call this message appears in the browser:
'Attempted READ of record ID larger than file/table maximum record ID
size of 255 characters.'
I'm trying to find out why I'm getting this message. I'm not reading
any files in my code.
Other than this message, the process works fine.
Thanks for any suggestions.
Thanks gnari for your response to my 'bad header' post
------------------------------
Date: Fri, 07 Sep 2001 19:10:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Timezone offset
Message-Id: <np6iptk2hjn80vjitr359suu9hfbuh9f73@4ax.com>
Sean Hamilton wrote:
>What I was looking for is a constant GMT offest (In my case, PST, so -8),
>and then a DST offset (+1, again, in my case), constant regardless of time
>of year.
Well, Daylight Saving Time and Time Zone often get lumped together. For
example, I now am in the time zone "CEST", or "Central European Summer
Time". In winter, I'm in "CET", Central European Time, and no, I've not
moved. Not far, anyway.
--
Bart.
------------------------------
Date: Fri, 7 Sep 2001 18:34:56 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: user 'passwd' to change unix password in Perl script without Expect
Message-Id: <999887696.97778607159853.gnarinn@hotmail.com>
In article <cfbf10e5.0109061744.649b5958@posting.google.com>,
Ryan Lam <ryan326@graduate.hku.hk> wrote:
>Hi,
>
>I am trying to write a perl script to change user's password throuth
>UNIX's "passwd" command. The "passwd" command is a interactive
>program.
>I have read through many posts about this topics but all suggested to
>use the Expect script in Perl.
>
>For my case, I can't use Expect script and other Packages that are not
>included in standard packages of Perl.
if the reason for this is that you are not allowed to install into
the main perl library path, then you should look at the faq
perldoc -q "How do I keep my own module/library directory?"
or for short:
perldoc -q library
if the reason is that you are not allowed to install modules at all,
then you should still take a look at that module for pointers.
i do not know if it is pure-perl, though
gnari
------------------------------
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 1712
***************************************