[23527] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5736 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 31 14:06:40 2003

Date: Fri, 31 Oct 2003 11:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 31 Oct 2003     Volume: 10 Number: 5736

Today's topics:
    Re: Anybody using PERL to control their house ? <abigail@abigail.nl>
    Re: Aps and Linux <jwillmore@remove.adelphia.net>
    Re: Aps and Linux <syscjm@gwu.edu>
    Re: Aps and Linux <jwillmore@remove.adelphia.net>
        Can someone explain this to me? <stanb@panix.com>
    Re: Can someone explain this to me? <pinyaj@rpi.edu>
    Re: Can someone explain this to me? <asu1@c-o-r-n-e-l-l.edu>
    Re: Can someone explain this to me? <stanb@panix.com>
    Re: Can someone explain this to me? <stanb@panix.com>
    Re: DOS window. (Bill)
    Re: Equivalent of "ls -t" ? (Anno Siegel)
    Re: Get Windows Task-Names?! <jwillmore@remove.adelphia.net>
    Re: How Do I Use CGI->System Call As CronJob? <no@no.no>
    Re: How Do I Use CGI->System Call As CronJob? (David Efflandt)
    Re: How to prevent connection string from being public? <jwillmore@remove.adelphia.net>
    Re: How to prevent connection string from being public? (Vorxion)
    Re: How to tell what modules are installed? (Malcolm Dew-Jones)
    Re: Logic Flow Question (JR)
    Re: Projects <uri@stemsystems.com>
    Re: Projects <jwillmore@remove.adelphia.net>
    Re: Video::Capture example? <stanb@panix.com>
    Re: Watching The ... <jwillmore@remove.adelphia.net>
    Re: Watching The ... <pasdespam_desmond@zeouane.org>
    Re: What am I doing wrong?! <jboes@nexcerpt.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 31 Oct 2003 17:28:11 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Anybody using PERL to control their house ?
Message-Id: <slrnbq56tb.4ut.abigail@alexandra.abigail.nl>

Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDCCXIII
September MCMXCIII in <URL:news:bntaoh$6kr$1@nets3.rz.RWTH-Aachen.DE>:
**  Also sprach Andrew Rich (VK4TEC):
**  
** > Anybody using automation and control ?
**  
**  In a broader sense, in that I use it to control my computer which is
**  part of my household (and that replaces TV and radio).
**  
**  I heard some rumours according to which Larry would have a Perl-controllable
**  coffee-machine.


During YAPC::NA::2000, Larry presented a talk about the X10
system he had installed at his house. It was Perl driven
(perl4-ish, no warnings, no strict).


Abigail
-- 
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()


------------------------------

Date: Fri, 31 Oct 2003 16:50:47 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Aps and Linux
Message-Id: <20031031111537.110b008b.jwillmore@remove.adelphia.net>

On Fri, 31 Oct 2003 13:33:42 +0100
"Ste" <nonspammare@nospam.com> wrote:
<snip>

This is ASP code, not Perl.

Wrong group :-(

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
The debate rages on: Is PL/I Bachtrian or Dromedary? 



------------------------------

Date: Fri, 31 Oct 2003 12:00:02 -0500
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: Aps and Linux
Message-Id: <3FA29512.4060407@gwu.edu>

James Willmore wrote:
> On Fri, 31 Oct 2003 13:33:42 +0100
> "Ste" <nonspammare@nospam.com> wrote:
> <snip>
> 
> This is ASP code, not Perl.
> 
> Wrong group :-(
> 

Nope, it's "Aps" code.  The OP said so.

         Chris Mattern



------------------------------

Date: Fri, 31 Oct 2003 17:10:11 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Aps and Linux
Message-Id: <20031031113501.46bff5d8.jwillmore@remove.adelphia.net>

On Fri, 31 Oct 2003 12:00:02 -0500
Chris Mattern <syscjm@gwu.edu> wrote:

> James Willmore wrote:
> > On Fri, 31 Oct 2003 13:33:42 +0100
> > "Ste" <nonspammare@nospam.com> wrote:
> > <snip>
> > 
> > This is ASP code, not Perl.
> > 
> > Wrong group :-(
> > 
> 
> Nope, it's "Aps" code.  The OP said so.
> 
>          Chris Mattern
> 

Sorry, but I believe the OP is mistaken.  It appears, to me, to be
ASP.  ASP is very similar to Visual Basic and it appears from the code
published that it's ASP (because of the syntax used).

But, of course, I could be wrong :-)

In any event, It don't look, talk, etc. like Perl code :-)

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
I have great faith in fools -- self confidence my friends call
<it.   -- Edgar Allan Poe 


------------------------------

Date: Fri, 31 Oct 2003 16:07:42 +0000 (UTC)
From: Stan Brown <stanb@panix.com>
Subject: Can someone explain this to me?
Message-Id: <bnu1ce$gf4$1@reader2.panix.com>

I'm trying to use the Video::Capture module (which has no docs) to capture
images from multple cards.  I've finally found the following snippet of
code in the perl module itself:

sub new(;$) {
my $class  = shift;
my $device = shift || "/dev/video0";
my $self = bless { device => $device }, $class;


It looks like the devie needs to be passed as the 2nd argument to the new
call., and if a 2nd arg is not received it defaults to the first card.

So far so good. Probel is the example cdoe I have passes _NO_ arguments to
the new call. Any idea what the first one should be?




-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


------------------------------

Date: Fri, 31 Oct 2003 11:25:28 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Stan Brown <stanb@panix.com>
Subject: Re: Can someone explain this to me?
Message-Id: <Pine.SGI.3.96.1031031112317.1088071A-100000@vcmr-64.server.rpi.edu>

[posted & mailed]

On Fri, 31 Oct 2003, Stan Brown wrote:

>I'm trying to use the Video::Capture module (which has no docs) to capture
>images from multple cards.  I've finally found the following snippet of
>code in the perl module itself:
>
>sub new(;$) {
>  my $class  = shift;
>  my $device = shift || "/dev/video0";
>  my $self = bless { device => $device }, $class;
>}
>
>It looks like the devie needs to be passed as the 2nd argument to the new
>call., and if a 2nd arg is not received it defaults to the first card.
>
>So far so good. Probel is the example cdoe I have passes _NO_ arguments to
>the new call. Any idea what the first one should be?

The first argument to any class method is the class name.  Have you used
any object-oriented Perl code before?

  my $object = Class->new($this, $that);

calls (more or less) the Class::new() function, with the arguments
('Class', $this, $that).

  package Class;
  sub new {
    my $class = shift;  # 'Class'
    my @args = @_;      # $this, $that
    # ...
  }

Therefore, you want to do:

  my $video = Video::Capture->new($device_location);

-- 
Jeff Pinyan            RPI Acacia Brother #734            2003 Rush Chairman
"And I vos head of Gestapo for ten     | Michael Palin (as Heinrich Bimmler)
 years.  Ah!  Five years!  Nein!  No!  | in: The North Minehead Bye-Election
 Oh.  Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)



------------------------------

Date: 31 Oct 2003 16:32:57 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Can someone explain this to me?
Message-Id: <Xns9425757CDB3AEasu1cornelledu@132.236.56.8>

Stan Brown <stanb@panix.com> wrote in
news:bnu1ce$gf4$1@reader2.panix.com: 

> I'm trying to use the Video::Capture module (which has no docs) to
> capture images from multple cards.  I've finally found the following
> snippet of code in the perl module itself:
> 
> sub new(;$) {
> my $class  = shift;
> my $device = shift || "/dev/video0";
> my $self = bless { device => $device }, $class;
> 
> 
> It looks like the devie needs to be passed as the 2nd argument to the
> new call., and if a 2nd arg is not received it defaults to the first
> card. 
> 
> So far so good. Probel is the example cdoe I have passes _NO_
> arguments to the new call. Any idea what the first one should be?

when you say

my $video = Video::Capture->new();

the new method is passed Video::Capture as the first argument.

Sinan.


------------------------------

Date: Fri, 31 Oct 2003 17:31:24 +0000 (UTC)
From: Stan Brown <stanb@panix.com>
Subject: Re: Can someone explain this to me?
Message-Id: <bnu69b$ic1$1@reader2.panix.com>

In <Pine.SGI.3.96.1031031112317.1088071A-100000@vcmr-64.server.rpi.edu> Jeff 'japhy' Pinyan <pinyaj@rpi.edu> writes:

>[posted & mailed]

>On Fri, 31 Oct 2003, Stan Brown wrote:

>>I'm trying to use the Video::Capture module (which has no docs) to capture
>>images from multple cards.  I've finally found the following snippet of
>>code in the perl module itself:
>>
>>sub new(;$) {
>>  my $class  = shift;
>>  my $device = shift || "/dev/video0";
>>  my $self = bless { device => $device }, $class;
>>}
>>
>>It looks like the devie needs to be passed as the 2nd argument to the new
>>call., and if a 2nd arg is not received it defaults to the first card.
>>
>>So far so good. Probel is the example cdoe I have passes _NO_ arguments to
>>the new call. Any idea what the first one should be?

>The first argument to any class method is the class name.  Have you used
>any object-oriented Perl code before?

Only copy be example WO an undertanding of why. I;ve never looked at the
source of the modules I was using before. OK that's a bad thing, but at
leats I'm willing to admint it.

>  my $object = Class->new($this, $that);

>calls (more or less) the Class::new() function, with the arguments
>('Class', $this, $that).

>  package Class;
>  sub new {
>    my $class = shift;  # 'Class'
>    my @args = @_;      # $this, $that
>    # ...
>  }

>Therefore, you want to do:

>  my $video = Video::Capture->new($device_location);

Ah, I see the things to the right of the -> are ALL arguments.

Rhanks, you have solved my imediate problem, AND educated me. Now I can go
fishing :-) (references the famous saying about teaching to fish).

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


------------------------------

Date: Fri, 31 Oct 2003 17:32:19 +0000 (UTC)
From: Stan Brown <stanb@panix.com>
Subject: Re: Can someone explain this to me?
Message-Id: <bnu6b3$ic1$2@reader2.panix.com>

In <Xns9425757CDB3AEasu1cornelledu@132.236.56.8> "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> writes:

>Stan Brown <stanb@panix.com> wrote in
>news:bnu1ce$gf4$1@reader2.panix.com: 

>> I'm trying to use the Video::Capture module (which has no docs) to
>> capture images from multple cards.  I've finally found the following
>> snippet of code in the perl module itself:
>> 
>> sub new(;$) {
>> my $class  = shift;
>> my $device = shift || "/dev/video0";
>> my $self = bless { device => $device }, $class;
>> 
>> 
>> It looks like the devie needs to be passed as the 2nd argument to the
>> new call., and if a 2nd arg is not received it defaults to the first
>> card. 
>> 
>> So far so good. Probel is the example cdoe I have passes _NO_
>> arguments to the new call. Any idea what the first one should be?

>when you say

>my $video = Video::Capture->new();

>the new method is passed Video::Capture as the first argument.
Ah, now I have an even better understanding of this.
-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


------------------------------

Date: 31 Oct 2003 08:30:43 -0800
From: wherrera@lynxview.com (Bill)
Subject: Re: DOS window.
Message-Id: <239ce42f.0310310830.95a94cb@posting.google.com>

"Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit> wrote in message news:<bnom3o$kqs$1@newshost.mot.com>...
> Guys,
> 
> I've been writing perl scripts at work on a w2k machine, but as I'm now
> doing a personal project, I thought I'd better do it at home.
> 
> For various reasons, I'm still running w98 at home, and have discovered that
> the w98 dos window is particularly crap, as I can't specify a buffer size.
> 
> If I put cmd.exe from my w2k machine onto  the w98 machine, will it run OK,
> and give me the dos window I'm used to, or is this a bad idea?
> 
> Are there any better ways around this?
> 

Several code editors will spawn a scrolling command line interface,
basically command.com with pipes to an editor page. I think maybe
there is an emacs port to win95 that does this but am not sure about
that--I think I saw this years ago.


------------------------------

Date: 31 Oct 2003 17:34:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Equivalent of "ls -t" ?
Message-Id: <bnu6eh$3dn$1@mamenchi.zrz.TU-Berlin.DE>

Abigail  <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMDCCXII
> September MCMXCIII in <URL:news:bnr860$5gr$1@mamenchi.zrz.TU-Berlin.DE>:

> []  Abigail  <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> [] >             sort 
> [] >             map {sprintf "%08x$_" => (stat) [9], $_} grep {! /^\./}
> readdir $dh;
> []                                                     ^^
> []  That second "$_" seems to be a remnant of an earlier version.  Otherwise,

[...]

> There was no earlier version. The format was intended to be '%08x%s';
> it's just that the directories I tested on didn't have files with %'s
> in their names, so the typo remained unnoticed.

Yes.  I noticed that the first $_ being in error was a more likely
scenario... after I posted.

> []  Why the hex format?
> 
> Because I know timestamps are 32 bit integers, which are at most 8 
> hex digits. I contemplated figuring out how many digits I needed,
> but then I realized that being lazy would save memory, so I used
> hex digits instead of normal digits.

Right.

Anno


------------------------------

Date: Fri, 31 Oct 2003 16:24:13 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Get Windows Task-Names?!
Message-Id: <20031031104903.10d73ef4.jwillmore@remove.adelphia.net>

On Fri, 31 Oct 2003 13:22:07 +0100
Kasper Dziurdz <usenet@repsak.de> wrote:
> is there a way or module to get the names of Windows tasks currently
> 
> running (for example "Google - Mozilla" but not "mozilla.exe")?!

I'm not 100% sure about this, but you could look at one of the many
Win32 modules.  I'm thinking one of those modules will accomplish the
task.  

A quick glance at:
http://search.cpan.org/search?query=win32+process&mode=module

shows Win32::Process::Info and Win32API::ProcessStatus _may_ fit the
bill.

One suggestion is to find out how to do what you want to do at the
command line and then fashion a script around that command.

I'm not a very big Windows user, so these are just suggestions. 
Others may be more helpful.

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
When we are planning for posterity, we ought to remember that
virtue is not hereditary.   -- Thomas Paine 


------------------------------

Date: Fri, 31 Oct 2003 16:59:47 GMT
From: "Public Interest" <no@no.no>
Subject: Re: How Do I Use CGI->System Call As CronJob?
Message-Id: <7ywob.201284$0v4.15684645@bgtnsc04-news.ops.worldnet.att.net>

Because I want the Child to be seperated and totally independent from
Parent, so system does not work for me. I want both child and parant to live
and run until finish. I want something like & in shell

ls &

How do I have a & in perl?


> Public Interest wrote:
> > The CGI still want for the exec to be finished!!!. I have printout from
the
> > EXEC. and it kept showing on my browser!!!
>
> man bash:
>
> exec      If  command is specified, it replaces the shell.
>
> When you run 'exec', there is no longer a script to return to.  exec is
> the last command any script will run.
>
> If you want to return to it, use 'system'.
>
> I'm guessing that perl and sh are consistent in the use of 'exec' and
> 'system'.
>
> -Dondo
>
> -- 
> What am I on?
> I'm on my bike,                         o__
> 6 hours a day, busting my ass.          ,>/'_
> What are you on? --Lance Armstrong     (_)\(_)
>




------------------------------

Date: Fri, 31 Oct 2003 18:43:59 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: How Do I Use CGI->System Call As CronJob?
Message-Id: <slrnbq5bbf.dka.efflandt@typhoon.xnet.com>

On 31 Oct 2003, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Public Interest <no@no.no> wrote in comp.lang.perl.misc:
>> Another very very big problem:
>> 
>> The CGI still want for the exec to be finished!!!. I have printout from the
>> EXEC. and it kept showing on my browser!!!
>> 
>> So they are still not independent.
> 
> That is because the child's STDOUT is the same as the parent's.  If you
> don't want to see output, re-direct it in the child process.

In other words look for daemonize in 'perldoc perlipc'.  It shows how to 
fork a child and disassociate itself from the parent (your CGI).  Of 
course your CGI should provide some proper output to either just 
acknowledge, or advise the browser if the fork fails.

Once you fork the child and disassociate it from the parent, it could run 
your 2 other processes.

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


------------------------------

Date: Fri, 31 Oct 2003 17:04:26 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: How to prevent connection string from being public?
Message-Id: <20031031112916.7cd099d2.jwillmore@remove.adelphia.net>

On Fri, 31 Oct 2003 13:02:27 +0100
James Henson <jbh@example.com> wrote:

> 
> I'm using a MySQL database from within some Perl cgi's. To
> make the connection, I have to supply the username/password
> in the connection string. This info is readable for anyone
> that can view my code, e.g. all other users that can access
> the webserver directly, or by some possible exploit.
> 
> How can I avoid this? I can't have my own webserver, obviously.
> 
> I have set up the database server so it only accepts connections
> from the webserver box, but that doesn't help with the above
> problem.
> 
> Any pointers?

This _appears_ not to be a Perl issue.  If the username/password is
passed as a parameter in a CGI script, the simple solution is to use
an SSL connection.  If the username/password is in a file that all on
the webserver have shell access to, there's an issue of file
permissions to be addressed.

If you post some code, maybe this will (dis)prove the above
statements.

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
In 1880 the French captured Detroit but gave it back ... they
couldn't get parts. 


------------------------------

Date: 31 Oct 2003 12:34:44 -0500
From: vorxion@knockingshopofthemind.com (Vorxion)
Subject: Re: How to prevent connection string from being public?
Message-Id: <3fa29d34$1_1@news.iglou.com>

In article <3fa24fb1$0$58708$e4fe514c@news.xs4all.nl>, James Henson wrote:
>
>I'm using a MySQL database from within some Perl cgi's. To
>make the connection, I have to supply the username/password
>in the connection string. This info is readable for anyone
>that can view my code, e.g. all other users that can access
>the webserver directly, or by some possible exploit.
>
>How can I avoid this? I can't have my own webserver, obviously.
>
>I have set up the database server so it only accepts connections
>from the webserver box, but that doesn't help with the above
>problem.
>
>Any pointers?

It's not possible.  To some degree, you're exposed by the need for having
it in either the script or in a config file.

Assuming a *nix platform, make sure you're running it as a user -other-
than the one httpd runs as (try cgiwrap for instance), make sure the
scripts are mode 0700 and configs are mode 0600.

That's about as good as you'll get given the nature of the beast.

You -can- do things like custom-encode them, or hard-code packed strings of
the data and then unpack them or custom-decode them at execution.  This is
only an added layer of obscurity if someone really analyses your code to
find out how it's derived.  It simply keeps them from being there in
plaintext--that's all.

Basically, if you take the user/mode steps listed above, the one thing you
have to worry about is someone breaking that particular account.  If
someone cracks the entire system, you have -far- bigger worries than your
mysql password.  :)  (It's -really- easy to cripple a system entirely to
the point it won't boot without a good hunt or a reinstall.)

-- 
Vorxion - Member of The Vortexa Elite


------------------------------

Date: 31 Oct 2003 10:09:49 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: How to tell what modules are installed?
Message-Id: <3fa2a56d@news.victoria.tc.ca>

Chris Mattern (syscjm@gwu.edu) wrote:
: Anno Siegel wrote:
: > Jim Anderson <james.h.anderson@ssmb.com> wrote in comp.lang.perl.misc:
: > 
: >>Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message
: >>news:<bnrtgk$14okgo$1@ID-184292.news.uni-berlin.de>...
: >>
: >>>Jim Anderson wrote:
: >>>
: >>>>What's the best way to get a list of all the installed modules?
: >>>
: >>>That's a FAQ.
: >>>
: >>>     perldoc -q installed
: >>
: >>Unfortunately, this just tells me that there's no doc for 'installed'.
: > 
: > 
: > Ah... you're running an older Perl.  The FAQ suggests to use the
: > ExtUtils::Installed module.  Another possibility is "perldoc perllocal".
: > That lists all modules that were properly installed through CPAN.

: My perl is 5.8.0, installed just a few months ago.  perldocs cannot
: find any FAQ with the keyword "installed".  It's beginning to look
: like this FAQ was recently *removed* for some reason.

	perldoc -q installed

It isn't in perl 5.005 or perl 5.6.1 either, on several systems I just 
checked.

(An admittedly small number of) Google postings from the past show various
answers but make no reference to any faq entry to answer the question.

This has certainly been a "Frequently Asked Question", but it doesn't look 
like it was a "Fully Answered Question" until very recently.

And for any number of production systems that require enhanced stability
over enhanced but-for-them-unused-features, this will continue to be a
"Frequently Annoying Quandry".



------------------------------

Date: 31 Oct 2003 10:56:12 -0800
From: jrolandumuc@yahoo.com (JR)
Subject: Re: Logic Flow Question
Message-Id: <b386d54b.0310311056.60bf3053@posting.google.com>

ctcgag@hotmail.com wrote in message news:<20031031095824.136$cG@newsreader.com>...
> jrolandumuc@yahoo.com (JR) wrote:
> >
> > Thanks, Ben.  I removed the my from the for loop, the way it is
> > removed in recipe 4.3.  I didn't mean to have that in there-it was a
> > typo.  The results, even with my removed in the for loop, are still
> > the same.  Am I correct in guessing that the $i variable is not reset
> > to 0 every time the for loop is entered?
> 
> A new variable is created each time the loop is entered.  That new variable
> can be referred to as $i from within the loop for which it was created (and
> now where else).  This $i is set to 0, but there are still other variables,
> which are also called $i but only from within their respective loops, that
> are not affected here.  This is the main point of recursion, that each
> recursive layer has access to only it's own lexical variables.
> 
> Xho

Thanks again to Ben, and thanks to Xho.  You answered precisely the
part that I didn't understand about subroutine calls, particularly
calls within a recursive subroutine.  These finer points were not
explained in any of the Perl books I have read (or perhaps I missed
them, or misunderstood them).  Thanks for clearing them up for me.


------------------------------

Date: Fri, 31 Oct 2003 16:10:29 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Projects
Message-Id: <x7llr1pevf.fsf@mail.sysarch.com>

>>>>> "RS" == Robert Shaffer <qwickfire@hotmail.com> writes:

  RS> Does anyone know where I can find some sort of list of unfinished
  RS> programming projects or open source projects that need developers?
  RS> Perl would be ideal. I need practice!

apprentice.perl.org. in particular look at stem which i created. it has
plenty of things that can be done and plenty to learn from.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Fri, 31 Oct 2003 16:28:55 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Projects
Message-Id: <20031031105345.2fe4a4c7.jwillmore@remove.adelphia.net>

On 31 Oct 2003 04:04:25 -0800
qwickfire@hotmail.com (Robert Shaffer) wrote:

> Does anyone know where I can find some sort of list of unfinished
> programming projects or open source projects that need developers?
> Perl would be ideal. I need practice!
> Thanks in advance.
> Robert Shaffer.

http://freshmeat.net/
http://sourceforge.net/

The two sites are open source software repositories.  Just off the top
of my head.

You could also look at:
http://search.cpan.org

Search for a particular module of interest, then contact the author
and see if he needs help.  Some of the bigger, newer modules are
always looking for developers to help write/test.

Although .... if you need practice ... find some task you don't want
to do manually and then write a script to perform that task.  I always
find that helpful to me - loads of practice there :-)

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
In America, any boy may become president and I suppose that's
just one of the risks he takes.   -- Adlai Stevenson 


------------------------------

Date: Fri, 31 Oct 2003 16:10:50 +0000 (UTC)
From: Stan Brown <stanb@panix.com>
Subject: Re: Video::Capture example?
Message-Id: <bnu1ia$gjb$1@reader2.panix.com>

In <kps4qv06cg99h8ombm4hukbeejsg1l9ffh@4ax.com> zentara <zentara@highstream.net> writes:

>On Fri, 31 Oct 2003 00:32:20 +0000 (UTC), Stan Brown <stanb@panix.com>
>wrote:

>>In <4u32qvgthijulq4baguj941i6a9jhr8g7p@4ax.com> zentara <zentara@highstream.net> writes:
>>
>>>On Wed, 29 Oct 2003 15:15:27 +0000 (UTC), Stan Brown <stanb@panix.com>
>>>wrote:
>>
>>>>I'm writing a perl script to capture images from some cameras, and make
>>>>mpes out of them on Linux.
>>
>>Thanks for the help on this again!

>>First, why do we go through the capture/convert loop twice per grab?
>>
>>for ( 0 .. 1 ) {
>>    my $nfr = $grab->capture( 1 - $frame, 640, 480 );
>>
>>I've been benchmarking, and it seems that the 2nd pass take much longer
>>than the first.

>Try it without it and see what happens. It is a mystery to me too.
>It seems to have something with getting a sync for the image.

Thanks for the help on this!


My biggest remaining issue is geting this to support the 2nd card. I posted
a message about this in a new thread. I found the call to new in the
module, and the device is optionaly the 2nd argument. Problem is I don't
now what to pass for the first "class" argument.

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


------------------------------

Date: Fri, 31 Oct 2003 17:24:37 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Watching The ...
Message-Id: <20031031114927.3e61dd5b.jwillmore@remove.adelphia.net>

On Fri, 31 Oct 2003 16:34:04 +0100
Desmond Coughlan <pasdespam_desmond@zeouane.org> wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
> 
> ... 'How to tell what modules are installed?' thread, I couldn't
> find an entry for 'perldoc -q installed' on my system, either. 
> Mention was then made that 5.8.1 was the latest version, and upon
> checking, I have 5.8.0.
> 
> My Perl install seems to work perfectly, and if a script fails to
> run, it's(so far) always been easy to trace it to my own
> idioc^H^H^Hinexperience.
> 
> The question is: as a newbie who's still struggling to get to grips
> with hashes, arrays and regex, is it worth my while installing 5.8.1
> ? 

Well ... 5.8.1 _is_ the latest version of Perl.  However, IMHO, I'm
thinking you may want to get comfortable with Perl _first_ before
installing _anything_ related to Perl.  Might I suggest that, since
you're new to Perl, you type the following at the command line and
then start reading from there - just to get a feel for what you have
to look forward to:

perldoc perl

I suggest this because the "white knuckled" way to install Perl
(meaning, from a tarball and then using configure, etc, etc) can be a
bit much for someone new to Perl.  But that's just an opinion :-)

Of course, if you're using Linux and can install from an RPM, the
above issue is moot.  Again, just my opinion :-)

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
Experience is what you get when you were expecting something
else. 


------------------------------

Date: Fri, 31 Oct 2003 18:36:28 +0100
From: Desmond Coughlan <pasdespam_desmond@zeouane.org>
Subject: Re: Watching The ...
Message-Id: <s5ja71-i2h2.ln1@zeouane.org>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

James Willmore <jwillmore@remove.adelphia.net> wrote ... 

{ snip }

>> The question is: as a newbie who's still struggling to get to grips with
>> hashes, arrays and regex, is it worth my while installing 5.8.1 ? 

> Well ... 5.8.1 _is_ the latest version of Perl.  However, IMHO, I'm
> thinking you may want to get comfortable with Perl _first_ before
> installing _anything_ related to Perl.  Might I suggest that, since
> you're new to Perl, you type the following at the command line and then
> start reading from there - just to get a feel for what you have to look
> forward to:
> 
> perldoc perl

Oh, I did that ages ago.  :-)

> I suggest this because the "white knuckled" way to install Perl (meaning,
> from a tarball and then using configure, etc, etc) can be a bit much for
> someone new to Perl.  But that's just an opinion :-)

That was in fact how I installed it.  I'm a Perl newbie, but spent a good
few years administering UNIX (even if it does appear that I'm developping a
nasty talent for hosing my own systems here at home), so working with
tarballs, configure, etc., is not that difficult.

> Of course, if you're using Linux and can install from an RPM, the above
> issue is moot.  Again, just my opinion :-)

I'm using FreeBSD, but as their ports system sucks bigtime, I generally
install from source myself.

Ah hell, what else do I have to do on a Friday evening; I'm off to install
5.8.1 ... 

- -- 
Desmond Coughlan               |desmond [at] zeouane [dot] org
http://www.zeouane.org/ 

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQA/AwUBP6KPiGiD+5zjSqyTEQKaewCcCHnZu/tDZBuysweZutvRzmV2I4MAoPza
IXTr2NyigMdagKHkzDJft478
=aDJk
-----END PGP SIGNATURE-----


------------------------------

Date: Fri, 31 Oct 2003 17:53:45 GMT
From: Jeff Boes <jboes@nexcerpt.com>
To: Tony Walker <tony.walker@dhl.com>
Subject: Re: What am I doing wrong?!
Message-Id: <d9ec083e87ec0c92bd12d425e3d5a80a@news.teranews.com>

Tony Walker wrote:
>         my $LINE = @entry[$i];
>         if ($CUR =~/$LINE/){
>         print $CUR;
>         }

Consider "$CUR =~ /\Q$LINE\E/" here; if the text in $LINE contains any 
regular expression meta-characters (like "."), your match may not work 
the way you want it to.

-- 
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
            ...Nexcerpt... Extend your Expertise



------------------------------

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 5736
***************************************


home help back first fref pref prev next nref lref last post