[16016] in Perl-Users-Digest
Perl-Users Digest, Issue: 3425 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 20 11:19:58 2000
Date: Mon, 19 Jun 2000 18: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)
Message-Id: <961463110-v9-i3425@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 19 Jun 2000 Volume: 9 Number: 3425
Today's topics:
Re: [ Regexp ] Curious Behaviour of " last if /(match)/ (Tad McClellan)
Re: [ Regexp ] Curious Behaviour of " last if /(match)/ (Tad McClellan)
accessing other servers using Perlscript & ASP (Bert Maher)
compiling a decryption module for Perlfilter (Eric Smith)
Re: Crazy enough that it might just work... (Tad McClellan)
Re: Crazy enough that it might just work... (Eric Bohlman)
Re: Crazy enough that it might just work... <callgirl@la.znet.com>
Re: Crazy enough that it might just work... (Eric Bohlman)
Re: Dir Listsing <psychoNOpsSPAM@pcpatches.com.invalid>
Re: Dir Listsing <psychoNOpsSPAM@pcpatches.com.invalid>
Re: du perl trial - recursive neverending loop occurs (Mike)
Re: Formatting question? <callgirl@la.znet.com>
Re: Formatting question? (Craig Berry)
Re: Formatting question? <lr@hpl.hp.com>
Re: help creating directories with perl VincentMurphy@mediaone.net
Re: help creating directories with perl <tony_curtis32@yahoo.com>
HTTP::Request <mike@friedwire.com>
Re: HTTP::Request <tony_curtis32@yahoo.com>
Re: Internet Programmers Wanted! (Tad McClellan)
logs of BigFloats, binomial density function, large fac mnanao@my-deja.com
Re: my vs. our VincentMurphy@mediaone.net
Re: Net::NNTP question. <post_replys_please@invalid-address.com>
Re: Passing a database handles to subs.... (Abigail)
Re: Passing a database handles to subs.... <david@dbillingham.demon.co.uk>
Re: Passing a database handles to subs.... (Abigail)
Re: Perl Builder 2.0 for LINUX - Beta Available (Alan Curry)
Re: Perl Timer help <abe@ztreet.demon.nl>
Re: Piping output from JAVAC to a file. (Brandon Metcalf)
Re: Simple Question ~ How to perform a directory recurs (Eric Bohlman)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Jun 2000 17:28:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <slrn8kt449.due.tadmc@magna.metronet.com>
On Mon, 19 Jun 2000 21:26:12 +0200, TheEx0rcist <TheEx0rcist@fanclub.org> wrote:
>I am trying to retrieve the first occurence of "match" in the file $file :
>
>--
>open (FILE,"$file") or die "$file : $!";
^ ^
Those quotes don't do anything, and therefore, should not be there.
> while (<SDJ>) {
> last if /(match)/;
> };
>print $1;
>--
>
>However I don't know why
Because that is what it is supposed to do.
>but as soon as the loop is exited, the matched
>pattern : $1 becomes empty (!)
>Can anyone
The docs that you got with your perl can.
They should already be on your hard disk.
>explain why in the first case, $1 comes empty?
'perlre.pod' describes Perl's regular expressions.
If you are having trouble with regex memories, then you should
go read about regex memories:
perldoc perlre
-------- 5.6 -----------------------
The numbered variables ($1, $2, $3, etc.) and the related punctuation
set (C<<$+>, C<$&>, C<$`>, and C<$'>) are all dynamically scoped
until the end of the enclosing block or until the next successful
match, whichever comes first.
--------------------------------------
-------- 5.005_03 -----------------------
The scope of $E<lt>digitE<gt> (and C<$`>, C<$&>, and C<$'>)
extends to the end of the enclosing BLOCK or eval string, or to the next
successful pattern match, whichever comes first.
-------------------------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Jun 2000 19:18:28 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <slrn8ktai4.e0l.tadmc@magna.metronet.com>
On Mon, 19 Jun 2000 23:54:19 +0200, TheEx0rcist <TheEx0rcist@fanclub.org> wrote:
>Thanks Steve,
>
>You have effectively explained what Perl does of its $<DIGIT> variables. But
>not my actual question : "WHY?" :(
Because global variables are bad.
>Why does Perl act likewise? Why doesn't $1 always have the value of the last
>matched pattern, inside or outside a block? Normal variables ($variable) are
>always the same inside or outside a block as long as you don't say
>"local($variable)"
And even when you _do_ make them local(), they are still
the _same_ variable, they just have different _values_.
(you should _always_ prefer my() over local(), except where
you _cannot_ use my().
Dynamic scoping (local) is strange.
Lexical scoping (my) is what nearly everybody expects to get.
Use my(). Don't use local().
)
When you my() them, they are truly different variables.
>so why should $<DIGIT> variables act otherwise? Why
>should Perl assume "local($<DIGIT>)"? It nothing but obfuscating ...
No, it _avoids_ obfuscations.
Global variables can be changed "at a distance", which makes the
place where they are being changed hard to find.
Restricting where changes can be made makes troubleshooting easier.
The code below prints "bar". With your suggested global $1,
it would print "foo":
---------------------------
#!/usr/bin/perl -w
use strict;
$_ = "foo bar baz\n";
if ( /(bar)/ ) {
my_sub($1);
print "$1\n";
}
# insert a few thousand lines of code here
sub my_sub {
my($str) = @_;
if ( $str =~ /(foo)/ )
{ return 1 }
else
{ return 0 }
}
---------------------------
I think one of the other followups tried to make this same point.
>Well I guess it is just a choice, which is not very wise in my opinion ...
^^^^^^^^^^^^^
Have you some grounding in the relevant disciplines then?
Nobody with even just a semester of Computer Science training
would argue that global variables are good. It is pretty
much universally accepted that globals are bad.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 20 Jun 2000 00:30:33 GMT
From: bert1@airmail.net (Bert Maher)
Subject: accessing other servers using Perlscript & ASP
Message-Id: <0D3357CF2D7B3CBB.6511DBFED75102A9.8B350C88DFD6B8C6@lp.airnews.net>
Hi, I've been trying to use Active Server Pages in conjunction with
perl script, and I've been running into a problem when trying to
access the filesystem of other (non-web) servers on my network. The
open() function can't seem to access anything outside of the internet
directory structure. Can anyone help?]
Thanks,
Bert Maher
bmaher@imacs.com
------------------------------
Date: 19 Jun 2000 23:22:23 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: compiling a decryption module for Perlfilter
Message-Id: <slrn8ktaot.io6.eric@plum.fruitcom.com>
Hi
I am using the Perl Source filter module to encrypt source code for
distribution on win32 but wish to compile the decryption algorythm
Package. I have much experience with PerlApp.pl to exe's but none
with creating either COM objects or Perl controls and "no" C knowledge
(in case of suggestions to use a compiled C decrypto).
I am looking for something that while resonably easy to implement will
be as efficient as possible. The perl source cannot be compiled
because we are using either mod_perl or fcgi.
thanx
--
Eric Smith
eric@fruitcom.com
------------------------------
Date: Mon, 19 Jun 2000 17:40:38 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Crazy enough that it might just work...
Message-Id: <slrn8kt4qm.due.tadmc@magna.metronet.com>
On Mon, 19 Jun 2000 09:25:39 -0700, Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid> wrote:
>Gee, that was mature. "HTML Programming is impossible..."
Please post an HTML program then, we've never seen one.
Teach us.
You can't convince people that HTML programming is possible
just by saying that HTML programming is possible.
Show how HTML programming is possible.
>Whatever, at least if you think
>you're such a hot shot you could show some maturity.
Correcting misused terminology is not immature.
Griping about having your mistakes corrected is immature.
>And I'm sorry about this flame.
I don't think you are being truthful there.
>I'm sure it's not
>too mature in and of itself, but stupidity begets, well,
>stupidity.
No, misuse of terms begets corrections.
Grownups learn from their mistakes.
If my followup was "stupid", then you seem to be asserting
that your post was the stupidity that "begot" it.
Don't be so hard on yourself. Making a mistake is not
the same as being stupid.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Jun 2000 23:50:16 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Crazy enough that it might just work...
Message-Id: <8imbjo$vng$3@nntp9.atl.mindspring.net>
David H. Adler (dha@panix.com) wrote:
: Well, my point was that that method makes one's ability to tell if it
: *is* in fact wisdom questionable...
There's a perhaps apocryphal story about a nineteenth-century author
(possibly Baudelaire) who was experimenting with hallucinogens. One time
under the influence he had what he regarded as a truly profound insight
that he absolutely *had* to write down at once, and so he did. Later
when he was sober he took a look at what he had written: "This place
really stinks."
------------------------------
Date: Mon, 19 Jun 2000 16:55:56 -0700
From: Kira <callgirl@la.znet.com>
Subject: Re: Crazy enough that it might just work...
Message-Id: <394EB30C.932A4AA0@la.znet.com>
Tad McClellan wrote:
> Agentkhaki <altavistaNOalSPAM@agentkhaki.com.invalid> wrote:
> >Gee, that was mature. "HTML Programming is impossible..."
> Please post an HTML program then, we've never seen one.
Standard test for 'something' being a program language,
is reiteration. I cannot think of any html code which
_directly_ causes reiteration.
I can think of html code which will do funny things
to a cgi program and do equally funny things to a
person's personal computer, but not with reiteration.
Perhaps, in a very vague, almost nonsensical sense,
html can 'program' a program to react in selected ways.
Still, there is no debate on html not being a programming
language. It cannot reiterate. This html stuff is truly
a macro language much like America Online is a macro
based system, but not a true program, in itself.
Kira
------------------------------
Date: 20 Jun 2000 00:02:03 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Crazy enough that it might just work...
Message-Id: <8imc9r$vng$5@nntp9.atl.mindspring.net>
Tad McClellan (tadmc@metronet.com) wrote:
: You can't convince people that HTML programming is possible
: just by saying that HTML programming is possible.
:
: Show how HTML programming is possible.
[snip]
: Correcting misused terminology is not immature.
Particularly when the misuse signals a fundamentally incorrect (not just
incomplete) mental model of the subject in question. Who was the wit (I
get the urge to say Will Rogers) who said "The trouble isn't what you
don't know, it's what you know that ain't so."?
Someone who regards HTML as a programming language will be extremely
frustrated when his creations don't "look the same" in different browsing
environments. We expect the statements in a programming language to have
well-defined behaviors. HTML "programmers" expect to be able to control
all details of browser behavior from their HTML. Some of them expect to
be able to control all details of the user's computer ("What command do I
put in my HTML to maximize the browser?").
HTML is about "this is." Not about "do this." Wanting it to be about
"do this" doesn't make it "do this." Being in the business of making
money rather than doing academic inquiry doesn't make it "do this."
Client requirements can't make it "do this."
------------------------------
Date: Mon, 19 Jun 2000 15:08:16 -0700
From: psycho <psychoNOpsSPAM@pcpatches.com.invalid>
Subject: Re: Dir Listsing
Message-Id: <00b8986a.5e310a78@usw-ex0102-013.remarq.com>
sorrym i can't send the source code to any one b/c my firend im
dong this for, own's a co. sorry.
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Mon, 19 Jun 2000 15:12:37 -0700
From: psycho <psychoNOpsSPAM@pcpatches.com.invalid>
Subject: Re: Dir Listsing
Message-Id: <00946680.3126641f@usw-ex0106-046.remarq.com>
hye, markus.. where would i get this doc.?
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 19 Jun 2000 15:55:55 -0700
From: tcsh@holly.colostate.edu (Mike)
Subject: Re: du perl trial - recursive neverending loop occurs
Message-Id: <slrn8kt5nb.orr.tcsh@faure.cs.colostate.edu>
rootbeer@redcat.com (Tom Phoenix):
> On 19 Jun 2000, Mike wrote:
> > if (-f $new_name) {
>
> > $tot+=(stat($new_name))[7];
>
> You're not allowing for symbolic links or files with multiple names, or
> for files which can't be stat'ted. Also, the size of a file is easier to
> get with -s, although there's nothing wrong with a slice.
Great, it was symbolic links that was causing the problems. I can't come up
with a case where -s $new_name would work but stat($new_name) would fail.
What, outside of not having read permission, would cause the inability to stat.
>
> If you re-code with File::Find, your program will be simpler, more
> portable, and more reliable. Cheers!
Sure. However, I just coded this up because I've never written a recursive
program in perl. Just an excercise, much thanks for pointing out the flaws.
--
Mike
------------------------------
Date: Mon, 19 Jun 2000 16:05:33 -0700
From: Kira <callgirl@la.znet.com>
Subject: Re: Formatting question?
Message-Id: <394EA73D.CAFB5416@la.znet.com>
Larry Rosler wrote:
> Rich <rvanoni@e-estimating.com> says...
> > If $x = 45.123456789 and I wanted to only show 2 decimal places
> > I would use the following command:
> > printf("x=%.2f", $x);
> > Is there any way to do this type of formatting inside the print<< statement?
> > Or is there a way to change the value of $x from 45.123456789 to 45.12
> > before I use the print<< statement?
> There is no such thing as a 'print<<' statement. There is a print()
> function; the notation << introduces a quoted string, that may be used
> as the argument for print(), or elsewhere.
> Within the quoted string ('here-doc'), you can interpolate variables, or
> even expressions:
> print <<EOT;
> some text \$ ${\sprintf '%.2f' => $x} some more text
> EOT
Mr. Rosler, please don't think me rude. I have a
sincere favor to ask of you and, some code for the
originating author if he reads this. He should. Lots
of good information presented by you Mr. Rosler.
</ego massage>
I am really curious how great of a time difference
there is between these two methods. This ain't a
contest or ego show down. I have a hunch my method
will be quite a bit slower but I am interested in
how much slower. Mr. Rosler, as a favor, would you
mind benchmarking these for me? I don't have any
benchmark facilities other than counting blinks
of my eyes and, at my age, I cannot seem to blink
fast enough to compare these two:
$string = "1234.56789";
print <<EOL;
${\substr ($string, 0, (index ($string, ".") + 3))}
EOL
print <<FOL;
${\sprintf '%.2f' => $string}
FOL
Thanks Mr. Rosler,
Kira
===
For the originating author, some alternatives.
Mr. Rosler will post some speed tests on this.
PRINTED RESULTS:
________________
Simple Substring Method:
Old String: 12.3456789
New String: 12.34
Variable Substring Method:
Old String: 1234.5678
New String: 1234.56
Substring Inside A Print: 1234.56
Printf Inside A Print: 1234.57
TEST SCRIPT:
____________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
# SIMPLE SUBSTRING METHOD
$string = "12.3456789";
$new_string = substr ($string, 0, 5);
print "Simple Substring Method: \n
Old String: $string \n
New String: $new_string \n\n";
# VARIABLE SUBSTRING METHOD
$string = "1234.5678";
$new_string = substr ($string, 0, (index ($string, ".") + 3));
print "Variable Substring Method: \n
Old String: $string \n
New String: $new_string \n\n";
print <<EOL;
Substring Inside A Print: ${\substr ($string, 0, (index ($string, ".") +
3))}
Printf Inside A Print: ${\sprintf '%.2f' => $string}
EOL
exit;
------------------------------
Date: Tue, 20 Jun 2000 00:48:13 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Formatting question?
Message-Id: <sktfqdube7f135@corp.supernews.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: Within the quoted string ('here-doc'), you can interpolate variables, or
: even expressions:
:
: print <<EOT;
: some text \$ ${\sprintf '%.2f' => $x} some more text
: EOT
Or even:
printf <<'EOT', $x;
some text $%.2f some more text
EOT
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Beauty and strength, leaping laughter and delicious
| languor, force and fire, are of us." - Liber AL II:20
------------------------------
Date: Mon, 19 Jun 2000 17:42:48 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Formatting question?
Message-Id: <MPG.13b85ddccbd6579198ab9f@nntp.hpl.hp.com>
In article <394EA73D.CAFB5416@la.znet.com>, callgirl@la.znet.com says...
> Larry Rosler wrote:
>
> > Rich <rvanoni@e-estimating.com> says...
> > > If $x = 45.123456789 and I wanted to only show 2 decimal places
> > > I would use the following command:
>
> > > printf("x=%.2f", $x);
>
> > > Is there any way to do this type of formatting inside the print<< statement?
> > > Or is there a way to change the value of $x from 45.123456789 to 45.12
> > > before I use the print<< statement?
...
> > Within the quoted string ('here-doc'), you can interpolate variables, or
> > even expressions:
>
> > print <<EOT;
> > some text \$ ${\sprintf '%.2f' => $x} some more text
> > EOT
...
> I am really curious how great of a time difference
> there is between these two methods. This ain't a
> contest or ego show down. I have a hunch my method
> will be quite a bit slower but I am interested in
> how much slower. Mr. Rosler, as a favor, would you
> mind benchmarking these for me? I don't have any
> benchmark facilities other than counting blinks
> of my eyes and, at my age, I cannot seem to blink
> fast enough to compare these two:
Install Perl 5, which comes with Benchmark.pm, and do it yourself if you
are really interested.
...
> For the originating author, some alternatives.
> Mr. Rosler will post some speed tests on this.
No, I won't, because I'm not terribly concerned about it. The original
question was whether he could calculate results within a string rather
than interpolating them. I showed how, with references to the
documentation.
The difference in speed between evaluating an expression then
interpolating the result or interpolating an expression directly is
likely to be negligible.
Anyone who wants to can compare the speeds of index/substr and sprintf.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 20 Jun 2000 00:30:14 GMT
From: VincentMurphy@mediaone.net
Subject: Re: help creating directories with perl
Message-Id: <wk4s6pjist.fsf@mediaone.net>
>>>>> "Tom" == Tom Briles <sariq@texas.net> writes:
Tom> Jubilee Prescott wrote:
>>
>> How can I create directories with perl? I'm on a redhat 6 machine.
Tom> Perl's base functions are documented in the 'perlfunc' page of the
Tom> manual.
Tom> Type 'perldoc perlfunc' at your command prompt, and perhaps you'll find
Tom> something similar to Linux's 'mkdir' in there.
perldoc File::Path
This is a more portable solution, to operating systems like Windows, than
something like system mkdir ...
-- Vinny
------------------------------
Date: 19 Jun 2000 19:42:29 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: help creating directories with perl
Message-Id: <877lbl6v4a.fsf@limey.hpcc.uh.edu>
>> On Tue, 20 Jun 2000 00:30:14 GMT,
>> VincentMurphy@mediaone.net said:
Tom> Type 'perldoc perlfunc' at your command prompt, and
Tom> perhaps you'll find something similar to Linux's
Tom> 'mkdir' in there.
> perldoc File::Path
> This is a more portable solution, to operating systems
> like Windows, than something like system mkdir ...
Ever looked at the source for File::Path?
File::Path::mkpath is implemented in terms of mkdir().
(And yes, it works under DOS/Windows.)
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Mon, 19 Jun 2000 23:30:12 GMT
From: <mike@friedwire.com>
Subject: HTTP::Request
Message-Id: <sktb843ge7f104@corp.supernews.com>
Perlfolk,
I am trying to use HTTP::Request to build a download script for PDF
files. I get an error that looks like this:
An Error OccurredAn Error Occurred500 Can't connect to :80 (Bad peer
address)
And no file is downloaded. The same code works fine on csv files. Is
there a trick to downloading PDF files?
Mike
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 19 Jun 2000 18:34:57 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: HTTP::Request
Message-Id: <87em5t6y8u.fsf@limey.hpcc.uh.edu>
>> On Mon, 19 Jun 2000 23:30:12 GMT,
>> <mike@friedwire.com> said:
> Perlfolk, I am trying to use HTTP::Request to build a
> download script for PDF files. I get an error that
> looks like this:
> An Error OccurredAn Error Occurred500 Can't connect to
> :80 (Bad peer address)
> And no file is downloaded. The same code works fine on
> csv files. Is there a trick to downloading PDF files?
Could be the web server is doing something at the other
end with the PDF files.
Impossible to say without seeing code and the HTTP
transaction.
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Mon, 19 Jun 2000 19:24:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Internet Programmers Wanted!
Message-Id: <slrn8ktasv.e0l.tadmc@magna.metronet.com>
On Mon, 19 Jun 2000 21:34:35 GMT, Kevin McElligott <xirocco@jps.net> wrote:
>Get "free" exposure for your scripts online.
Already we can infer that we will eventually find that this
is a solicitaion to write code for no pay.
>We have been successful in affiliating ourselves with many
>programmers on the Internet, and in return our programmers get
>advertising space on the site, as well as referral business and
>personal bio's listed by their scripts (with links to their site).
You have found lots of mediocre programmers. That's nice.
(The truly Good programmers get paid for their work)
>Kevin McElligott
>xirocco@jps.net
>due to the spamming on newsgroups, our primary internet email
>address is not used here.
>
>DO NOT SPAM. IT HURTS ALL OF US
Posting an advertisement in a discussion newsgroup _is_ spamming.
Practice what you preach!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Jun 2000 22:20:29 GMT
From: mnanao@my-deja.com
Subject: logs of BigFloats, binomial density function, large factorials
Message-Id: <8im6b3$5un$1@nnrp1.deja.com>
I'm trying to compute NON-cumulative binomial density functions
of rather large N (>1000). In other words, for a set of N trials,
I want to know the probabilty of getting *exactly* n "positives" of
probability p. As a result, I need to calculate factorials
of these large N which easily overflow perls ~1x10^308 limit.
So far I've tried:
Math::Cephes same large float limitation
only cumulative binomial densities calculated
Math::CDF only cumulative binomial densities calculated
Math::BigFloat logs can't be calculated
Math::GMP I can't get this to work at all without a
segmentation fault.
Any ideas? No solution is too hackish at this point! I just want to
get the stupid thing to WORK! Thanks in advance,
Max
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 20 Jun 2000 00:19:06 GMT
From: VincentMurphy@mediaone.net
Subject: Re: my vs. our
Message-Id: <wk7lbljjba.fsf@mediaone.net>
>>>>> "Drew" == Drew Simonis <care227@attglobal.net> writes:
Drew> tlars@my-deja.com wrote:
>>
>> Can anyone explain the difference between my and our in Perl?
>>
Drew> my creates a copy of the variable specific to the enclosing
Drew> block. I have never heard of a scoping element called our,
Drew> and my Perl docs contain no reference to it.
perldoc -f our
I first saw it in beta releases of 5.6.
--Vinny
------------------------------
Date: Mon, 19 Jun 2000 22:22:29 GMT
From: "DougW" <post_replys_please@invalid-address.com>
Subject: Re: Net::NNTP question.
Message-Id: <F2x35.5153$Ai6.44221@typhoon.kc.rr.com>
"Tom Phoenix" wrote ...
> On Mon, 19 Jun 2000, DougW wrote:
>
> > Using Activestate perl and Net::NNTP
> >
> > So far I have been able to post (easy)
> > but I need an example of how to interact.
>
> Between the docs for Net::NNTP and RFC-977, I don't know what more you
> want.
I dunno.. an easy answer perhapse? ^_^
I was just hoping there was a small example program that used
Net:NNTP so I could figgure out how to search for a given article.
> > The goal is a bot that searches a specific news group for a REQ:
> > (request) then fills that request.
>
> You're new here, aren't you. :-)
Checks behind ears...
Yep, wet..
Now if you need something coded in Fortran IV, 77 or RDC Assembler. :)
I still have my JCL cards! eek!
Ah.. them were real bits.
> > To that end I'd also appreciate it if someone could
> > point me to a UUEncode/UUDecode library. I could
> > code it myself but I'd rather not.
>
> Then you should look on CPAN.
>
> http://search.cpan.org/
Thankyee!
> > Oh, the email address in my post is bogus.
> > Sorry, I get entirely too much spam as it is.
>
> Odd. My real address is on my postings, but I spend more time each week
> dealing with _paper_ junk mail. I doubt that hiding your address helps you
> as much as you think.
Your probably correct. :(
Who would have though one innocent binness card would
land me more 3X5 packs and free magazines than I could possibly
read in one day.
Luckely I wook for the Goobermint so I have time. :)
> Cheers!
mmmm.. Guinness.. mmmm..
------------------------------
Date: 19 Jun 2000 18:16:24 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Passing a database handles to subs....
Message-Id: <slrn8kt7vt.3a7.abigail@alexandra.delanet.com>
David (david@dbillingham.demon.co.uk) wrote on MMCDLXXXIII September
MCMXCIII in <URL:news:961450893.12571.0.nnrp-03.c2deb140@news.demon.co.uk>:
$$
$$ Abigail <abigail@delanet.com> wrote in message
$$ news:slrn8kmau2.mlf.abigail@alexandra.delanet.com...
$$ >
$$ > Arguments to subs in Perl *are* passed by reference:
$$ >
$$ > sub inc ($) {$_ [0] ++}
$$ > my $n = 1;
$$ > inc $n;
$$ > print $n; # Prints 2.
$$ >
$$ > There is no choice of passing by reference or value.
$$ >
$$ > But I fail to see why you want to change the database or statement
$$ > handle in the sub.
$$ >
$$
$$ Thanks for your reply.
$$
$$ I want to pass a handle to a sub so that I can declare variables with 'my',
$$ use 'strict', and use the handle elsewhere in my code.
That answers the question on why you want to pass arguments. That doesn't
answer my question though. You asked how to pass arguments by reference -
and you generally want to do that because you want to change the value.
Hence my question.
If you don't plan to change the handle; then it would not matter whether
the argument is passed by value or reference.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Mon, 19 Jun 2000 23:47:32 +0100
From: "David" <david@dbillingham.demon.co.uk>
Subject: Re: Passing a database handles to subs....
Message-Id: <961454895.4747.0.nnrp-07.c2deb140@news.demon.co.uk>
Abigail <abigail@delanet.com> wrote in message
news:slrn8kt7vt.3a7.abigail@alexandra.delanet.com...
> David (david@dbillingham.demon.co.uk) wrote on MMCDLXXXIII September
> MCMXCIII in
<URL:news:961450893.12571.0.nnrp-03.c2deb140@news.demon.co.uk>:
> $$
> $$ Abigail <abigail@delanet.com> wrote in message
> $$ news:slrn8kmau2.mlf.abigail@alexandra.delanet.com...
> $$ >
> $$ > Arguments to subs in Perl *are* passed by reference:
> $$ >
> $$ > sub inc ($) {$_ [0] ++}
> $$ > my $n = 1;
> $$ > inc $n;
> $$ > print $n; # Prints 2.
> $$ >
> $$ > There is no choice of passing by reference or value.
> $$ >
> $$ > But I fail to see why you want to change the database or statement
> $$ > handle in the sub.
> $$ >
> $$
> $$ Thanks for your reply.
> $$
> $$ I want to pass a handle to a sub so that I can declare variables with
'my',
> $$ use 'strict', and use the handle elsewhere in my code.
>
>
> That answers the question on why you want to pass arguments. That doesn't
> answer my question though. You asked how to pass arguments by reference -
> and you generally want to do that because you want to change the value.
> Hence my question.
>
> If you don't plan to change the handle; then it would not matter whether
> the argument is passed by value or reference.
>
>
No I don't need to change the value, so if I can pass it by value then fine.
I've found that you can only pass arrays to subs by ref so assumed that this
might well be the same (is this correct?).
Still don't know how to do it though :)
With thanks
David Billingham
------------------------------
Date: 19 Jun 2000 19:03:41 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Passing a database handles to subs....
Message-Id: <slrn8ktaoi.3a7.abigail@alexandra.delanet.com>
David (david@dbillingham.demon.co.uk) wrote on MMCDLXXXIV September
MCMXCIII in <URL:news:961454895.4747.0.nnrp-07.c2deb140@news.demon.co.uk>:
Please do not send stealth Ccs.
}} No I don't need to change the value, so if I can pass it by value then fine.
}} I've found that you can only pass arrays to subs by ref so assumed that this
}} might well be the same (is this correct?).
}}
}} Still don't know how to do it though :)
Which part of:
Arguments to subs in Perl *are* passed by reference:
There is no choice of passing by reference or value.
didn't you understand?
You don't have a choice, and I was only asking because you explicitely
asked for call be reference.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: Mon, 19 Jun 2000 22:04:19 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <DNw35.1165$Iv3.32157@news-east.usenetserver.com>
In article <394E5E92.3C3D@solutionsoft.com>,
Marty Ford <marty@solutionsoft.com> wrote:
>We would like to invite everyone here try a pre-release copy of Perl
>Builder 2.0 for Linux.
Snip from pbtar/install2:
wine -managed pb2linux.exe
cd /home
chmod -R 777 wine
chmod -R 777 pb2
I think you'll find it a little harder to get away with that kind of thing in
the new world you're stumbling into.
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Tue, 20 Jun 2000 01:44:11 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Perl Timer help
Message-Id: <hibtks8r6l36kmddebas3lgjee138jv6pc@4ax.com>
On Mon, 19 Jun 2000 21:30:06 GMT, felrodian@my-deja.com wrote:
> I have hacked the following program and am wondering why it isn't
> working. It seems to stop after a few times. I believe that it is
> getting back to 00 in the time, then doesn't want to work anymore. I
> have tried fixing the problem with the two if statements just before the
> while statement. Please submit ideas.
I don't understand what it is supposed to do but that will definitely
get into an infinite loop.
...
> while($sec < $exectime)
> {
> $lt = localtime();
> $sec = $lt->sec;
That guaranties that $sec will be in [0..59]
> }
> print "$print\n";
> $exectime = $exectime + $timer;
$exectime will be > 59 within 29 runs of &timer, so the while condition
will _always_ be true => infinite loop.
--
Good luck,
Abe
------------------------------
Date: 20 Jun 2000 00:30:07 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: Piping output from JAVAC to a file.
Message-Id: <8imduf$aad$1@bcrkh13.ca.nortel.com>
s_m_campbell@my-deja.com writes:
> I am trying to pipe the output from a JAVAC.EXE compile to a file so I
> can then parse it for errors, etc. I have tried the following with no
> success.
>
> Attempt 1:
> ==========
> $Status = `$Exe $RelType $Memory \@$Filelist -d $ClassDir`;
> open (LOGFILE, '>', $TempOut) or return;
> print LOGFILE, $Status;
> close (LOGFILE);
How about
$Status = `$Exe $RelType $Memory \@$Filelist -d $ClassDir 2>&1`;
Then just parse the contents of $Status instead of writing it to a file.
Brandon
------------------------------
Date: 19 Jun 2000 23:39:26 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Simple Question ~ How to perform a directory recursive search ?
Message-Id: <8imave$vng$2@nntp9.atl.mindspring.net>
David Meyers (dmeyers@panix.com) wrote:
: sub wanted {
: print "$File::Find::dir/$_\n" if (/.*\.txt$/);
: }
The leading .* is unnecessary.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3425
**************************************