[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Mon Feb 14 14:57:57 2005 -->
- <!--x-from-r13: znavnp ng oybbqenira.arg (znavnp ng oybbqenira.arg) -->
- <!--x-message-id: 002301c512ce$bdd82830$6101a8c0@mike -->
- <!--x-reference: 008801c512c8$6df55140$[email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Slightly ot: perl question. -->
- <li><em>date</em>: Mon Feb 14 14:57:57 2005</li>
- <li><em>from</em>: maniac at bloodraven.net (maniac at bloodraven.net)</li>
- <li><em>references</em>: <008801c512c8$6df55140$[email protected]> <<a href="msg00540.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Slightly ot: perl question.</li>
>> I don't see how any of the variables in the while loop are being
>> measured.
>> All that exists is a:
>> my ($host, $schedid, ...) at the very beginning of this perl script.
the while loop will step through each row returned
----- Original Message -----
From: "Christopher Fowler" <cfowler at outpostsentinel.com>
To: "Atlanta Linux Enthusiasts" <ale at ale.org>
Sent: Monday, February 14, 2005 2:24 PM
Subject: Re: [ale] Slightly ot: perl question.
> That is some hard to read perl. Why use the qq in the prepare? Why not
> a string?
>
> On Mon, 2005-02-14 at 14:07, John Cole wrote:
>> Howdy all!
>>
>> First of all, it is amazing how much knowledge you gain when you have to
>> fix
>> systems you didn't design. :)
>>
>> Well, my question for today is why this code snippet doesn't work. It's
>> in
>> a program I'm trying to utilize but I'm not getting the while loop to
>> activate.
>>
>> # Open a ForkManager handle limiting the number of children
>> # to MAX_FORKS
>> $pm = new Parallel::ForkManager($scanq);
>>
>> #Select scheduled scans to run.
>> $sth = $dbh->prepare(qq{
>> SELECT scan.host, scan.sched_id, sched.sid, sched.timeout,
>> sched.username, sched.next_scan
>> FROM nessus_scan scan, nessus_schedule sched
>> WHERE scan.status = "S"
>> AND scan.server_id=$serverid
>> AND scan.sched_id=sched.id
>> AND sched.next_scan > 0
>> } );
>> $sth->execute;
>>
>> while(($host, $schedid, $sid, $timeout, $username,
>> $scantime)=$sth->fetchrow_array){
>> $pm->start and next; # Do the fork
>> my $dbhf;
>>
>> $dbhf =
>> DBI->connect("$CONFIG{'DATABASEDSN'}:$CONFIG{'DATABASENAME'}:$CONFIG{'DATABA
>> SEHOST'}","$CONFIG{'DATABASEUSER'}","$CONFIG{'DATABASEPASSWORD'}", {
>> PrintError => 0,
>> RaiseError => 1,
>> AutoCommit => 1 } ) or die("Failed to connect :
>> $DBI::errstr\n");
>>
>>
>> If I do a:
>> print $sth->fetchrow_array;
>> After the $sth->execute; I get the output from the db as requested.
>>
>> I don't see how any of the variables in the while loop are being
>> measured.
>> All that exists is a:
>> my ($host, $schedid, ...) at the very beginning of this perl script.
>>
>> Any ideas anyone?
>>
>> Thanks,
>> John Cole
>>
>>
>> This email and any files transmitted with it are solely intended for the
>> use of the
>> addressee(s) and may contain information that is confidential and
>> privileged. If
>> you receive this email in error, please advise us by return email
>> immediately.
>> Please also disregard the contents of the email, delete it and destroy
>> any copies
>> immediately.
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
>
>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00537" href="msg00537.html">[ale] Slightly ot: perl question.</a></strong>
<ul><li><em>From:</em> jcole at filink.com (John Cole)</li></ul></li>
<li><strong><a name="00540" href="msg00540.html">[ale] Slightly ot: perl question.</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00543.html">[ale] Easy to use CMS?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00545.html">[ale] My iBook -- [for sale]</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00540.html">[ale] Slightly ot: perl question.</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00542.html">[ale] Slightly ot: perl question.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00544"><strong>Date</strong></a></li>
<li><a href="threads.html#00544"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>