[13502] in Perl-Users-Digest
Perl-Users Digest, Issue: 912 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 26 12:08:10 1999
Date: Sun, 26 Sep 1999 09: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: <938361909-v9-i912@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 26 Sep 1999 Volume: 9 Number: 912
Today's topics:
Re: [ANNOUNCE] New Unix System Log(s) scanner (Abigail)
Re: [perl c exe switch off question] (Abigail)
Re: a question of buttons <gellyfish@gellyfish.com>
Authen::Smb <thomas.schachner@awd.at>
Re: Authen::Smb <gellyfish@gellyfish.com>
Re: Combining variables - newbie <gellyfish@gellyfish.com>
Re: Combining variables - newbie <meowing@banet.net>
Re: Connecting Box to Box with the POST method? <gellyfish@gellyfish.com>
does something like istram.h exist for perl <folini@swix.ch>
Re: does something like istram.h exist for perl <bowman@montana.com>
How to write data into a file immediately? ()
Re: How to write data into a file immediately? <tchrist@mox.perl.com>
Re: How to write data into a file immediately? (Bill Moseley)
Re: Program API <gellyfish@gellyfish.com>
Re: Program API <madebeer@igc.apc.org>
Re: References <gellyfish@gellyfish.com>
Re: retrieving Win32 File Versions <gellyfish@gellyfish.com>
script hangs after reading certain amount of data (Jason Q.)
Re: Scripting to handle incoming email. <gellyfish@gellyfish.com>
using the System method <chyaron@netvision.net.il>
Re: using the System method <meowing@banet.net>
Re: WEB server in Pearl (Abigail)
Re: weekly update suggestions <gellyfish@gellyfish.com>
Re: why does strict not warn about shaddowing declarati (Abigail)
Re: Writing a background process.. (Abigail)
Re: Writing a background process.. <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Sep 1999 05:24:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: [ANNOUNCE] New Unix System Log(s) scanner
Message-Id: <slrn7urti6.hh.abigail@alexandra.delanet.com>
Bill Jones (bill@fccj.org) wrote on MMCCXV September MCMXCIII in
<URL:news:7sfra5$s1r$1@play.inetarena.com>:
() [ANNOUNCE] msg_log.perl -
What's the frigging point of having an announce group if you crosspost
it to other groups as well? If people want to see announcements,
they will read clp.announce. If they don't want to see them, they
don't read it.
Perhaps the moderator of clp.announce could write a little script to
auto-reject any crossposts to other (Perl) groups.
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 05:30:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: [perl c exe switch off question]
Message-Id: <slrn7urts5.hh.abigail@alexandra.delanet.com>
tonyko (tonyko@pacbell.net) wrote on MMCCXIV September MCMXCIII in
<URL:news:37EA8F9F.F9A6A673@pacbell.net>:
$$ Is there a way to disable user's capability calling hisCprogram.exe from
$$ inside his perlscript ?
Sure. Edit the Perl source and disable the "system" function.
Or remove his program.exe file.
$$ Is there a way to figure out who I disable and who I did not from a perl
$$ script ?
That's sentence I cannot parse.
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 09:35:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: a question of buttons
Message-Id: <7skpco$cj4$1@gellyfish.btinternet.com>
On Sat, 25 Sep 1999 23:32:06 -0700 David P. Schwartz wrote:
> How is it possible (if at all) to use multiple buttons on an HTML form?
You need to give them different names - how you might do that is nothing
to do with Perl.
[followups set]
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 10:15:45 GMT
From: Thomas Schachner <thomas.schachner@awd.at>
Subject: Authen::Smb
Message-Id: <938348139.1887022618@news.telekabel.at>
Hi !
Has anyone tried the Authen::Smb Module to authenticate against a
NT Server from your Perl scripts?
I tried but i always get error code 1 which means that an Server error occured.
But when i installed the package no error occured.
Any idea how i can track down the problem?
Thanks Thomas
------------------------------
Date: 26 Sep 1999 12:08:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Authen::Smb
Message-Id: <7sl2bt$cso$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 10:15:45 GMT Thomas Schachner wrote:
> Hi !
>
> Has anyone tried the Authen::Smb Module to authenticate against a
> NT Server from your Perl scripts?
>
Yes.
> I tried but i always get error code 1 which means that an Server error occured.
>
> But when i installed the package no error occured.
>
> Any idea how i can track down the problem?
>
No. You havent given us enough information. My bet would be that you
have made a mistake when telling it about your PDC - but beyond that who
knows ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 10:49:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Combining variables - newbie
Message-Id: <7skto9$cmk$1@gellyfish.btinternet.com>
On 21 Sep 1999 00:57:34 -0400 Uri Guttman wrote:
>>>>>> "GWB" == Graham W Boyes <me@toao.net> writes:
>
> GWB> I have two variables, $var1 and $var2 which I'd like to combine
> GWB> into a single variable $var3 with a space in between. How should
> GWB> I do this?
>
> GWB> I grant that sounds really, REALLY stupid.
>
> i leave it as an exercise for the group to find more dumb ways. lets see
> how many we can come up with. the dumber the better.
>
Some of the other answers (Ala's excluded) have looked dangerously sensible
#!/usr/bin/perl -w
use strict;
my $var1 = "eelackaneekee";
my $var2 = "vastandbulbous";
my $string = jjoin(' ',$var1,$var2);
print $string,"\n";
sub jjoin
{
my ($join_string,@strings) = @_;
my @out;
foreach (@strings)
{
my $index;
for $index ( 0 .. length ($_) - 1)
{
push @out,substr $_,$index,1;
}
push @out,$join_string;
}
my $out_string = '';
my $index = 0;
foreach (@out)
{
substr($out_string,$index++,1) = $_;
}
$out_string =~ s/\Q$join_string\E$//;
return $out_string;
}
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 07:36:59 -0400
From: meow <meowing@banet.net>
Subject: Re: Combining variables - newbie
Message-Id: <87n1u9hpk4.fsf@slip-32-101-160-194.ma.us.ibm.net>
Uri Guttman <uri@sysarch.com> wrote:
> i leave it as an exercise for the group to find more dumb ways. lets see
> how many we can come up with. the dumber the better.
#!/usr/local/bin/perl -w
use strict;
my $var1 = 'foom';
my $var2 = 'bark';
my $var3 = stringjoin($var1, $var2);
print "The answer is '$var3'.\n";
sub stringjoin {
my $result;
my ($p1, $p2) = @_;
open WFILE, ">join.tmp";
print WFILE <<M30W
if 1:
import os
cfile = open('join.c', 'w')
cfile.write('''main(int arrghc, char **arrghv) {
printf ("%s %s", arrghv[1], arrghv[2]);}''')
cfile.close()
os.system('cc -o joiner join.c')
os.unlink('join.c')
joinstream = os.popen('./joiner %s %s' % ("$p1", "$p2"))
jointext = joinstream.read()
joinstream.close()
os.unlink('joiner')
print '%s' %jointext
M30W
;
close WFILE;
open WFILE, 'python join.tmp|';
chomp ($result = <WFILE>);
close WFILE;
unlink('join.tmp');
return $result;
}
__END__
------------------------------
Date: 26 Sep 1999 09:54:50 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Connecting Box to Box with the POST method?
Message-Id: <7skqha$ckd$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 00:12:24 -0400 Martin Cloutier wrote:
> This is a multi-part message in MIME format.
> --------------CAB2FAB524C5B07537D46E71
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
Please dont do that - this vCard crap is meaningless to the majority
of newsreaders. If you cant find out how to switch it off then you
should get a newsreader that doesnt produce this stuff.
>
> I am looking to establish a connection from unix box to another and
> retrieve information from the second one using the POST method.
>
<snip>
> ___________________________________________
> Can anyone tell me steer me toward the right direction?
> Either through some web pages, a book...
>
I would suggest that use the module LWP::UserAgent which is part of the
libwww-perl package available from CPAN. There is a document that comes
with this (lwpcook.pod) that describes how to perform various tasks with
the module including making POST requests.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 15:56:01 +0200
From: Oliver Folini <folini@swix.ch>
Subject: does something like istram.h exist for perl
Message-Id: <37EE25F1.8BB47600@swix.ch>
hi
i'm pretty new in the world of peer and have some problems...
i would like to read lines 45 to 75 four times out of a file without
reading all the other lines. i'm looking for something like the
istream-class from c++
(streampos istream::tellg(), istream& istream::seekg(streampos). does
something like this exist for perl?
thanks for help
oliver
------------------------------
Date: Sun, 26 Sep 1999 10:00:30 -0600
From: bowman <bowman@montana.com>
Subject: Re: does something like istram.h exist for perl
Message-Id: <37EE431E.31789C78@montana.com>
Oliver Folini wrote:
>
> (streampos istream::tellg(), istream& istream::seekg(streampos). does
> something like this exist for perl?
There are some strangely named functions like 'seek' and 'tell' that may
be what you are looking for.
--
Bear Technology Making Montana safe for Grizzlies
http://people.montana.com/~bowman/
------------------------------
Date: 26 Sep 1999 12:27:57 GMT
From: hanshen@ms13.hinet.net ()
Subject: How to write data into a file immediately?
Message-Id: <7sl3gd$ini@netnews.hinet.net>
I want to write data into a file without closing it. We can
do it in C by calling function fflush. Is there any way to
do the job besides calling close in Perl? Thank you.
------------------------------
Date: 26 Sep 1999 07:11:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to write data into a file immediately?
Message-Id: <37ee1b6b@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
hanshen@ms13.hinet.net () writes:
:I want to write data into a file without closing it. We can
:do it in C by calling function fflush. Is there any way to
:do the job besides calling close in Perl? Thank you.
% man perlfaq5
...
How do I flush/unbuffer an output filehandle? Why must I do this?
...
--tom
--
"All things are proceeding rapidly to their contusion." --Larry Wall
------------------------------
Date: Sun, 26 Sep 1999 06:27:26 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: How to write data into a file immediately?
Message-Id: <MPG.1257bf172104c4f198978a@nntp1.ba.best.com>
hanshen@ms13.hinet.net (hanshen@ms13.hinet.net) seems to say...
> I want to write data into a file without closing it. We can
> do it in C by calling function fflush. Is there any way to
> do the job besides calling close in Perl? Thank you.
Of course.
try
perldoc -q flush
at your favorite prompt.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 26 Sep 1999 10:08:14 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Program API
Message-Id: <7skrae$cl0$1@gellyfish.btinternet.com>
On Sat, 25 Sep 1999 20:39:28 GMT Marc wrote:
> Hey,
>
> I wanted to add something like an API to my program to allow users of this
> program to create their own custom modules to edit the internals of the
> program. Like instead of displaying the results by date, they can make a
> module to edit that and say display the results in alpha-order (or something
> to that effect). Basically, like how Apache does it. There are modules to
> change the way the program authenticates people (by ASCII, DBM, SQL, etc.)
> but it doesn't actually edit the original source code (or so I believe).
> This is what I would like to do for my program, but I can't figure out where
> to start. I just need ideas and I think I could peice together the rest.
>
A possible way of doing this is to create the pertinent parts of the program
as a module - the methods of which the user can override by creating their
own module. That way the user can use the methods of the original module
as they chose but provide their own where required.
An alternative would be allow the users to provide their own subroutines
as call-backs to your subroutines - much like File::Find does for instance
so that your subroutines will call their code at the appropriate time..
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 00:10:03 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Program API
Message-Id: <APC&1'0'50775dc3'283@igc.apc.org>
Marc wrote:
>I wanted to add something like an API to my program to allow users of this
>program to create their own custom modules to edit the internals of the
>program.
I can think of several ways. The simplest way is
in mainprogram.pl
require 'mysubs.pl';
require 'configsubs.pl;
mysubs.pl has all of the subs you might want to let users over-ride.
configsubs.pl can start off blank, but can contain user 'modules'
(using this term loosely).
Since configsubs.pl is required after mysubs.pl, subs in configsubs.pl
will over-ride subs of the same name in mysubs.pl
HTH,
-Mike "is that dumb?"
------------------------------
Date: 26 Sep 1999 09:46:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: References
Message-Id: <7skq1o$ck9$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 04:43:04 GMT Brian wrote:
>
> #!/usr/bin/perl -w
>
> # See actual message below Perl.
>
> use strict;
> use CGI qw(-no_debug :standard);
>
> my $q = new CGI;
> print $q->header();
>
> my $subject = 'Subject Line';
> my $sigline = 'http://www.host.com/';
>
> print template('admin.html');
>
> sub template {
> my ($html,$template);
> $template = $_[0] or die "No template: $!";
> open(TEMPLATE, "<$template") or die "Cannot open $template: $!";
> while (<TEMPLATE>) { $html .= $_ };
> close(TEMPLATE);
> $html =~ s!\$(\w+)!${$1}!g;
> return $html;
> }
> __END__
>
>
> When I test the syntax using perl -c it tells me 'syntax OK.', but
> when I run the program it returns:
>
> Can't use string ("subject") as a SCALAR ref while "strict refs"
> in use at ref-example.pl line 20.
>
The problem is with the line :
$html =~ s!\$(\w+)!${$1}!g;
The problem is the symbolic reference
You should read the section entitled:
How can I expand variables in text strings?
in perlfaq4 wherein is described a way of doing this without using the
symbolic reference by using the 'e' modifier to the substitution operator
or by using hashes both of which are considered preferable to using a
symbolic reference in the majority of cases.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 12:13:01 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: retrieving Win32 File Versions
Message-Id: <7sl2kd$csr$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 05:15:47 -0400 Guy Corngood wrote:
> Newbie Question:
>
> Is it possible to grab the File Version of a file on a Win32 platform with
> Perl? Is this ability built into to Perl or is there a module out there
> that will make this possible? I have been unable to locate any info on
> this...
>
No this capability is not built into Perl . I am assuming you mean the
version information that is in EXE and DLL files for instance. If you
can identify where this information is in the files prologue (or whatever
it is called) then you could use Perl's builtin capabilities to
retrieve it - however the discussion of the format of Win32 executable
files is not a question for this group.
You might also find that one of the Win32::* modules will give you this
capability.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 12:49:02 GMT
From: jason@generationterrorists.com (Jason Q.)
Subject: script hangs after reading certain amount of data
Message-Id: <37f313e8.37740271@news.cyberway.com.sg>
Hi
I have a 50MB text file.
And I wrote the following script to query it with $keyword:
------------------------------------------------------------------------------------
open (DATA, "database.txt") || die "cannot open: $!";
while (<DATA>)
{
($field1, $field2, $field3) = split(/\ /, $_);
if ($field2 =~ /$keyword/i)
{
print "$_<P>";
}
}
close (DATA);
------------------------------------------------------------------------------------
It hangs at exactly the same place (record) each time it runs. I
simplified the script to the following to troubleshoot and the script
runs fine.
------------------------------------------------------------------------------------
open (DATA, "database.txt") || die "cannot open: $!";
while (<DATA>)
{
$count++;
}
close (DATA);
print "$count records were searched.";
------------------------------------------------------------------------------------
I've double-checked the intergrity of the data in the text file and
everything is ok.
Does
($field1, $field2, $field3) = split(/\ /, $_);
if ($product_name =~ /$keyword/i)
{
print "$_<P>";
$count++;
}
have any effect on memory requirments? Because it seems the script
dies after reading a certain amount of data, and only if there are any
references to $_.
Any help would be appreciated.
Thanks.
Jason Q.
------------------------------
Date: 26 Sep 1999 09:32:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Scripting to handle incoming email.
Message-Id: <7skp7o$cj1$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 08:00:48 GMT dhuang11@my-deja.com wrote:
> Hi All.
>
> I need to know how I can setup a mail server that handles incoming mail
> that can trigger signals to run a perl program. Here is what I need to
> do:
>
> The email server needs to be able to save email similar to how it
> currently does and be able to setoff a trigger to run a perl script
> that can parse through the said email and retrieve data from it. The
> parsing is easy, but I'm not sure how to get a mail server to call a
> Perl program upon email arrival. If anyone knows of a good way to do
> it, please let me know. I appreciate any and all responses!
You can run a program via sendmails aliases, with procmail, or from your
.forward file. None of these has anything to do with Perl - I would ask
in one of the comp.mail. newsgroups .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 11:10:12 +0200
From: "Yaron Cohen" <chyaron@netvision.net.il>
Subject: using the System method
Message-Id: <7sknr0$oo6$1@news.netvision.net.il>
im having problems using the System method in order to start Visual Basic
and have it compile a project.
in order to do this i pass VB the name of the project and /make ,so i pass
to the system method 3 parameters : "c:\program files\vb\vb5.exe"
"c:\temp\myproject.vbp" /make.
on windows 95 and 98 it works just fine but not on NT.
for some reason NT opens vb and load the project but does not compile it.
------------------------------
Date: 26 Sep 1999 06:17:14 -0400
From: greg andruk <meowing@banet.net>
Subject: Re: using the System method
Message-Id: <87r9jmgeol.fsf@slip-32-101-160-194.ma.us.ibm.net>
Yaron Cohen <chyaron@netvision.net.il> wrote:
> im having problems using the System method in order to start Visual Basic
> and have it compile a project.
Try comp.lang.basic.visual.misc. This group is just for Perl stuff.
------------------------------
Date: 26 Sep 1999 05:13:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: WEB server in Pearl
Message-Id: <slrn7urst6.hh.abigail@alexandra.delanet.com>
rommelhere (rommelhereNOroSPAM@YAHOO.COM.invalid) wrote on MMCCXVI
September MCMXCIII in <URL:news:164c000c.f00d98d1@usw-ex0108-059.remarq.com>:
\\
\\ I'm a perl newbie. i have to write a Webserver in perl.
\\
\\ Please suggest resources\modules and possible approach i
\\ should take.
I suggest you start learning Perl.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 10:01:15 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: weekly update suggestions
Message-Id: <7skqtb$ckj$1@gellyfish.btinternet.com>
On Sat, 25 Sep 1999 15:22:48 -0700 Dan Woods wrote:
> "user:pass@http://www.here.com/cgi-bin/x.cgi (close enough).
Shouldnt that be:
http://user:pass@www.here.com/cgi-bin/x.cgi
Anyhow if you use one of the LWP modules to do this then the module
will take care of supplying the credentials for you.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 05:18:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: why does strict not warn about shaddowing declarations ?
Message-Id: <slrn7urt73.hh.abigail@alexandra.delanet.com>
Stuart Yeates (syeates@manuka.cs.waikato.ac.nz) wrote on MMCCXVI
September MCMXCIII in <URL:news:938260249.889037@clint.waikato.ac.nz>:
() i've just spent several hours hunting a bug caused by a case
() which i thought was handled when i did a 'use strict':
()
() sub X {
() my $Y = 3;
() while (...){
() my $Y = $Y + 1;
() }
() }
()
() of course what happens is that one declaration shaddows the other,
() so the $Y that gets written to is the inner one not the outer one.
()
() is there a good reason why strict doesn't scream about this ?
Well, yeah. Creating lexical variables in a block with the same
name as variables from an outer scope is a *feature*. One which
isn't at all unique to Perl.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 05:21:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Writing a background process..
Message-Id: <slrn7urtb6.hh.abigail@alexandra.delanet.com>
Hartgeorge (hartgeorge@aol.com) wrote on MMCCXVII September MCMXCIII in
<URL:news:19990926020259.23393.00002511@ng-bh1.aol.com>:
::
:: I need to write a perl program that will automatically erase a few files
:: everday at around 2 am. How do you do this? My concern is the program will
:: waste processor time since it has to check the clock to determine when to
:: delete the files. Is the 'nice' command the anwser or is there something you
:: must do in perl??
Huh? If you just start the process at 2 am, there's no need to check
the clock, is there? Of course, how to start a program at a specific
time isn't a Perl question.
Get an alarm clock.
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 09:37:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Writing a background process..
Message-Id: <7skph4$cj7$1@gellyfish.btinternet.com>
On 26 Sep 1999 06:02:59 GMT Hartgeorge wrote:
> Hello,
>
> I need to write a perl program that will automatically erase a few files
> everday at around 2 am. How do you do this? My concern is the program will
> waste processor time since it has to check the clock to determine when to
> delete the files. Is the 'nice' command the anwser or is there something you
> must do in perl??
>
Is there any reason why cant use cron ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
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 912
*************************************