[28990] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 234 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 17 11:09:42 2007

Date: Sat, 17 Mar 2007 08:09:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 17 Mar 2007     Volume: 11 Number: 234

Today's topics:
    Re: Find Missing Column and Extra Column <sahoo.byomokesh@gmail.com>
    Re: How to decompose nested objects <nobull67@gmail.com>
        Login time quota <koos@geen.spam>
        Net::SSH::W32Perl - hanging <satyen.sheth@gmail.com>
    Re: new CGI::Session creates a new session every visit. <spamtrap@dot-app.org>
        new CPAN modules on Sat Mar 17 2007 (Randal Schwartz)
    Re: odd behavior between Guitest and rcmd on windows <root@localhost.localdomain>
        Running several Perl scripts <ldolan@bigpond.net.au>
    Re: Running several Perl scripts <jurgenex@hotmail.com>
    Re: Running several Perl scripts <ldolan@bigpond.net.au>
    Re: Scope and Arrays <nobull67@gmail.com>
    Re: trying to determine gethostbyaddr call issues doesn <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 17 Mar 2007 02:24:45 -0700
From: "Rahul" <sahoo.byomokesh@gmail.com>
Subject: Re: Find Missing Column and Extra Column
Message-Id: <1174123485.894607.303310@n76g2000hsh.googlegroups.com>

On Mar 13, 4:25 am, Tad McClellan <t...@augustmail.com> wrote:
> Rahul <sahoo.byomok...@gmail.com> wrote:
> > My table is 3 columns.
> ><tgroup cols="3">
> ><row>
> ><entry valign="top" align="left" namest="col1"
> > nameend="col2"><p>centra</p></entry>
> ><!-- One row is missing here -->
>
> I thought you said it was supposed to contain 3 columns?
>
> There are *two* rows missing there then. Right?
>
> You forgot yet again so show us what you have tried so far.
>
> > Thanks for any help.
>
> Thanks for ignoring the help provided to you earlier.
>
> Have another fish along with your scorefile entry:
>
> ----------------------------
> #!/usr/bin/perl
> use warnings;
> use strict;
> use XML::Simple;
>
> my $xml = '
> <table>
> <tgroup cols="3">
> <colspec colnum="1" colname="col1"/>
> <colspec colnum="2" colname="col2"/>
> <colspec colnum="3" colname="col3"/>
> <tbody>
> <row>
> <entry valign="top" align="left"><p>nada</p></entry>
> <entry valign="top" align="left"><p>nothing</p></entry>
> <entry valign="top" align="left"><p>nada.</p></entry>
> <entry valign="top" align="left"><p></p></entry>  <!-- One Row Extra Here -->
> </row>
> <row>
> <entry valign="top" align="left" namest="col1" nameend="col2"><p>centra</p></entry>
> <!-- One row is missing here -->
> </row>
> </tbody>
> </tgroup>
> </table>
> ';
>
> my $ref = XMLin( $xml, ForceArray => ['entry'] );
> my $cols = $ref->{tgroup}{cols};
>
> my $row_cnt=0;
> foreach my $row ( @{ $ref->{tgroup}{tbody}{row} } ) {
>    my $col_cnt = @{ $row->{entry} };
>    print "line ", ++$row_cnt, " has $col_cnt columns\n" unless $cols == $col_cnt;
>
> }
>
> ----------------------------
>
> --
>     Tad McClellan                          SGML consulting
>     t...@augustmail.com                   Perl programming
>     Fort Worth, Texas

I am getting "Unrecognised option: ForceArray at cellcount.pl line
27". I have installed XML:Simple. What is the reason for this errors?


Thanks
Byomokesh



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

Date: 17 Mar 2007 00:27:24 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: How to decompose nested objects
Message-Id: <1174116444.071030.264340@e1g2000hsg.googlegroups.com>

On Mar 16, 11:39 pm, "TahoeKid" <rfd...@hotmail.com> wrote:
> I've created nested objects in perl, but having a problem extracting
> the nested objects.

It is nor clear what you mean by "I've created nested objects in perl"
or by "extracting the nested objects" and certainly not by "having a
problem".

I've not even sure whether you are using the word "object" to mean
data structures in general or specifically data structures that
present an OO interface.

>  I also haven't found any sample code in books or groups...

?!

> Any help would be great.

Please produce a minimal but compete Perl script to illustrate what
you've done so far then clearly explain what you want to do.



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

Date: Sat, 17 Mar 2007 16:07:42 +0100
From: Koos Pol <koos@geen.spam>
Subject: Login time quota
Message-Id: <45fc043f$0$322$e4fe514c@news.xs4all.nl>

After unfruitful debates with my teenage daughter about not spending too
much time on her computer, I decided to take the more eh, pragmatic
approach. As I couldn't find any program that suites me, I've written a
small Perl script that you can launch from your Un*x boot scripts.
You can run it like 

    login_quota -u mary -t 120 &

This will make sure Mary does not spend more that her alloted 120 minutes.

Some things perhaps noteworthy:
- It pauses timing when Mary's screensaver is running
- It can be fooled if she leaves a screensaver running on another X display
- Configuration locations are hard coded.
- It could use a day scheme variation. It would be nice to allow different
quota for for instance weekends.

But as it suits me already I'm not bothering to take it up another step.
If anyone wants to steal or borrow it, please feel free. I would appreciate
it though if you make your improvements public.

http://www.xs4all.nl/~koospol/public/login_quota

Cheers,
Koos
-- 
43rd Law of Computing: Anything that can go wr
fortune: Segmentation violation -- Core dumped


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

Date: 16 Mar 2007 20:09:04 -0700
From: "seth" <satyen.sheth@gmail.com>
Subject: Net::SSH::W32Perl - hanging
Message-Id: <1174100944.621836.179320@o5g2000hsb.googlegroups.com>

Hi all:


I have the following environment:

Citrix session (windows 2000 I believe)
ActiveState perl 5.8.7
Remote machine (either AIX or Linux).
*the debug output included is for connection to the AIX box.

What I'm trying to do:
------------------------------------------------------
using Net::SSH::W32Perl to make a ssh connection (passwordless) and
execute a command like this:  ls -l >> foo.txt


My problem:
------------------------------------------------------
The SSH session hangs.
This script works if  it is not run in a citrix session.  In other
words, it works fine in my
development environment which does not require me to use citrix.

The debug output shows that I connect, and the requested action is
carried out.  It is closing the session, that doesn't work (my guess).



I think the problem *could* be citrix, but I'm just not sure.
I'd appreciate some feedback, as to what else I can try.
I'm wondering if anyone can give specific feedback as to what to try,
but looking at my debug output for the SSH
connection the script invokes.

thanks.

-Seth





Here is the sample code that I'm running:
------------------------------------------------------

#!/usr/bin/perl

use strict;

use Net::SSH::W32Perl;
use Net::SSH::Perl;

my $file = ".\\id_rsa";

my $user="mightybob";
my $host="server.company.com";

my $ssh = Net::SSH::W32Perl->new($host,
					debug => 1,
					protocol=>'2',
					interactive=>0,
					port=>'22',
					identity_files=>["$file"],
					use_pty=>1);



$ssh->login($user);

my ($stdout, $stderr, $exit) = $ssh->cmd('ls -l > foo.txt');

print "STDOUT: $stderr \t $exit\n";



Here is the debug output:
------------------------------------------------------

H:\config\forseth_3>perl ssh_rsa.pl
rcctas6w: Reading configuration data /.ssh/config
rcctas6w: Reading configuration data /etc/ssh_config
rcctas6w: Connecting to server.company.com, port 22.
rcctas6w: Socket created, turning on blocking...
rcctas6w: Remote version string: SSH-1.99-OpenSSH_3.4p1

rcctas6w: Remote protocol version 1.99, remote software version
OpenSSH_3.4p1
rcctas6w: Net::SSH::Perl Version 1.30, protocol version 2.0.
rcctas6w: No compat match: OpenSSH_3.4p1.
rcctas6w: Connection established.
rcctas6w: Sent key-exchange init (KEXINIT), wait response.
rcctas6w: Algorithms, c->s: 3des-cbc hmac-sha1 none
rcctas6w: Algorithms, s->c: 3des-cbc hmac-sha1 none
rcctas6w: Entering Diffie-Hellman Group 1 key exchange.
rcctas6w: Sent DH public key, waiting for reply.
rcctas6w: Received host key, type 'ssh-dss'.
rcctas6w: Host 'server.company.com' is known and matches the host key.
rcctas6w: Computing shared secret key.
rcctas6w: Verifying server signature.
rcctas6w: Waiting for NEWKEYS message.
rcctas6w: Enabling incoming encryption/MAC/compression.
rcctas6w: Send NEWKEYS, enable outgoing encryption/MAC/compression.
rcctas6w: Sending request for user-authentication service.
rcctas6w: Service accepted: ssh-userauth.
rcctas6w: Trying empty user-authentication request.
rcctas6w: Authentication methods that can continue:
publickey,password,keyboard-interactive.
rcctas6w: Next method to try is publickey.
rcctas6w: Trying pubkey authentication with key file '.\id_rsa'
rcctas6w: Login completed, opening dummy shell channel.
rcctas6w: channel 0: new [client-session]
rcctas6w: Requesting channel_open for channel 0.
rcctas6w: channel 0: open confirm rwindow 0 rmax 32768
rcctas6w: Got channel open confirmation, requesting shell.
rcctas6w: Requesting service shell on channel 0.
rcctas6w: channel 1: new [client-session]
rcctas6w: Requesting channel_open for channel 1.
rcctas6w: Entering interactive session.
rcctas6w: Sending command: ls -l > ssh.3
rcctas6w: Requesting service exec on channel 1.
rcctas6w: channel 1: open confirm rwindow 0 rmax 32768



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

Date: Fri, 16 Mar 2007 21:10:06 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: new CGI::Session creates a new session every visit. GRRR!!!
Message-Id: <m2odmsisk1.fsf@local.wv-www.com>

xhoster@gmail.com writes:

> Sherm Pendley <spamtrap@dot-app.org> wrote:
>> "TonyV" <kingskippus@gmail.com> writes:
>>
>> > Unfortunately, it looks like there isn't a CGI-Session-4.20 available
>> > for Windows, at least not from ActiveState.  :-(  Oh well, at any
>> > rate, in case anyone else finds this thread through your favorite
>> > search engine *here* are the documents you should be looking at:
>>
>> Actually, you shouldn't be looking at cpan.org for docs at all. The docs
>> that are included with the module itself, right on your own computer, are
>> guaranteed to always be for the version you have.
>
> Unless you are discussing things with other people (for example, people on
> usenet) in which case what is installed on your own computer isn't terribly
> relevant to what behavior other people are experiencing.

I think there's a disconnect here - I don't know who missed something. If
it was me, sorry!

I thought the OP was using CGI::S 3.95, and was misled by looking at CPAN
docs for 4.20. That was my point - if you want to find the docs for the
precise version of a module you happen to be using, the best place to find
them is right on the same machine you're running your script on.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Sat, 17 Mar 2007 05:42:11 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Mar 17 2007
Message-Id: <JF196B.LEv@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Alien-wxWidgets-0.29
http://search.cpan.org/~mbarbon/Alien-wxWidgets-0.29/
building, finding and using wxWidgets binaries 
----
Archive-Cpio-0.05
http://search.cpan.org/~pixel/Archive-Cpio-0.05/
module for manipulations of cpio archives 
----
Bio-Das-Lite-1.49
http://search.cpan.org/~rpettett/Bio-Das-Lite-1.49/
Perl extension for the DAS (HTTP+XML) Protocol (http://biodas.org/) 
----
BitTorrent-V0.02
http://search.cpan.org/~qantins/BitTorrent-V0.02/
Perl extension for extracting, publishing and maintaining BitTorrent related things 
----
CGI-Application-Plugin-HTDot-0.04
http://search.cpan.org/~cromedome/CGI-Application-Plugin-HTDot-0.04/
Enable "magic dot" notation in CGI::Application-derived applications that use HTML::Template for their templating mechanism. 
----
CGI-Application-Plugin-HTDot-0.05
http://search.cpan.org/~cromedome/CGI-Application-Plugin-HTDot-0.05/
Enable "magic dot" notation in CGI::Application-derived applications that use HTML::Template for their templating mechanism. 
----
ConfigReader-Simple-1.25
http://search.cpan.org/~bdfoy/ConfigReader-Simple-1.25/
Simple configuration file parser 
----
Crypt-ECDSA-0.045
http://search.cpan.org/~billh/Crypt-ECDSA-0.045/
Elliptical Cryptography Digital Signature Algorithm 
----
Crypt-PBC-0.7.20.0-0.4.8
http://search.cpan.org/~jettero/Crypt-PBC-0.7.20.0-0.4.8/
OO interface for the Stanford PBC library 
----
Data-Alias-1.03
http://search.cpan.org/~xmath/Data-Alias-1.03/
Comprehensive set of aliasing operations 
----
Data-Dumper-Again-0.0001
http://search.cpan.org/~ferreira/Data-Dumper-Again-0.0001/
An OO alter ego for Data::Dumper 
----
Data-Dumper-Again-0.0002
http://search.cpan.org/~ferreira/Data-Dumper-Again-0.0002/
An OO alter ego for Data::Dumper 
----
Devel-StackTrace-1.14
http://search.cpan.org/~drolsky/Devel-StackTrace-1.14/
Stack trace and stack trace frame objects 
----
Egg-Release-1.19
http://search.cpan.org/~lushe/Egg-Release-1.19/
WEB application framework release version. 
----
File-PathInfo-1.09
http://search.cpan.org/~leocharre/File-PathInfo-1.09/
access to path variables, stat data, misc info about a file 
----
Google-Checkout-1.0.2
http://search.cpan.org/~dzhuo/Google-Checkout-1.0.2/
----
Graphics-ColorUtils-0.05
http://search.cpan.org/~janert/Graphics-ColorUtils-0.05/
Easy-to-use color space conversions and more. 
----
KA-Tie-Dir-2.9
http://search.cpan.org/~initdotd/KA-Tie-Dir-2.9/
Access file system via a Perl hash 
----
Language-Kemuri-0.01
http://search.cpan.org/~tokuhirom/Language-Kemuri-0.01/
Kemuri Interpreter. 
----
Lemonldap-Config-Parameters-3.1.1
http://search.cpan.org/~egerman/Lemonldap-Config-Parameters-3.1.1/
Backend of configuration for lemonldap SSO system 
----
Location-GeoTool-2
http://search.cpan.org/~kokogiko/Location-GeoTool-2/
Perl extension for Geometry processing 
----
Log-Log4perl-ConfigByInifile-0.04
http://search.cpan.org/~horshack/Log-Log4perl-ConfigByInifile-0.04/
Get Log::Log4perl config from an ini-File 
----
Mac-iTerm-LaunchPad-1.007
http://search.cpan.org/~bdfoy/Mac-iTerm-LaunchPad-1.007/
----
Mac-iTunes-0.88
http://search.cpan.org/~bdfoy/Mac-iTunes-0.88/
interact with and control iTunes 
----
Makefile-GraphViz-0.16
http://search.cpan.org/~agent/Makefile-GraphViz-0.16/
Draw building flowcharts from Makefiles using GraphViz 
----
Makefile-Parser-0.17
http://search.cpan.org/~agent/Makefile-Parser-0.17/
A simple parser for Makefiles 
----
Math-BigInt-1.81
http://search.cpan.org/~tels/Math-BigInt-1.81/
Arbitrary size integer/float math package 
----
Module-Release-1.14
http://search.cpan.org/~bdfoy/Module-Release-1.14/
Automate software releases 
----
Mozilla-Mechanize-GUITester-0.11
http://search.cpan.org/~bosu/Mozilla-Mechanize-GUITester-0.11/
enhances Mozilla::Mechanize with GUI testing. 
----
Mozilla-SourceViewer-0.04
http://search.cpan.org/~bosu/Mozilla-SourceViewer-0.04/
Perl extension to get current page source. 
----
Net-DNS-Async-1.05
http://search.cpan.org/~shevek/Net-DNS-Async-1.05/
Asynchronous DNS helper for high volume applications 
----
Net-SDEE-0.01
http://search.cpan.org/~jminieri/Net-SDEE-0.01/
Security Device Event Exchange 
----
Net-WhoisNG-0.08
http://search.cpan.org/~stiqs/Net-WhoisNG-0.08/
Perl extension for whois and parsing 
----
PDF-API2-0.59
http://search.cpan.org/~areibens/PDF-API2-0.59/
A Perl Module Chain to faciliate the Creation and Modification of High-Quality "Portable Document Format (aka. PDF)" Files. 
----
POE-Component-Server-SimpleContent-1.06
http://search.cpan.org/~bingos/POE-Component-Server-SimpleContent-1.06/
The easy way to serve web content with POE::Component::Server::SimpleHTTP. 
----
Physics-Particles-1.02
http://search.cpan.org/~smueller/Physics-Particles-1.02/
Simulate particle dynamics 
----
Prima-Image-Magick-0.01
http://search.cpan.org/~karasik/Prima-Image-Magick-0.01/
Juggle images between Prima and Image::Magick. 
----
Sash-1.01
http://search.cpan.org/~wbailey/Sash-1.01/
----
Sash-Plugin-VerticalResponse-1.01
http://search.cpan.org/~wbailey/Sash-Plugin-VerticalResponse-1.01/
----
Scalar-Defer-0.10
http://search.cpan.org/~audreyt/Scalar-Defer-0.10/
Lazy evaluation in Perl 
----
Senna-0.51
http://search.cpan.org/~dmaki/Senna-0.51/
Perl Interface To Senna Fulltext Search Engine 
----
SyslogScan-Daemon-SpamDetector-0.53
http://search.cpan.org/~muir/SyslogScan-Daemon-SpamDetector-0.53/
Notice spammers in the log files 
----
Template-Plugin-DtFormatter-1.10
http://search.cpan.org/~arthas/Template-Plugin-DtFormatter-1.10/
Easily create formatted string from DateTime objects 
----
Test-MonitorSites-0.06
http://search.cpan.org/~hesco/Test-MonitorSites-0.06/
Monitor availability and function of a list of websites 
----
Test-Run-0.0106
http://search.cpan.org/~shlomif/Test-Run-0.0106/
----
Test-Run-Plugin-AlternateInterpreters-0.01
http://search.cpan.org/~shlomif/Test-Run-Plugin-AlternateInterpreters-0.01/
Define different interpreters for different test scripts with Test::Run. 
----
Test-Run-Plugin-AlternateInterpreters-0.0101
http://search.cpan.org/~shlomif/Test-Run-Plugin-AlternateInterpreters-0.0101/
Define different interpreters for different test scripts with Test::Run. 
----
Test-TAP-HTMLMatrix-0.08
http://search.cpan.org/~gaal/Test-TAP-HTMLMatrix-0.08/
Creates colorful matrix of Test::Harness friendly test run results using Test::TAP::Model. 
----
Tie-Array-Packed-0.08
http://search.cpan.org/~salva/Tie-Array-Packed-0.08/
store arrays in memory efficiently as packed strings 
----
Tree-Trie-1.3
http://search.cpan.org/~avif/Tree-Trie-1.3/
A data structure optimized for prefix lookup. 
----
VR-API-1.00
http://search.cpan.org/~nmarden/VR-API-1.00/
Communicate with VerticalResponse's API services 
----
WebService-Images-Nofrag-0.06
http://search.cpan.org/~franckc/WebService-Images-Nofrag-0.06/
upload an image to http://pix.nofrag.com 
----
Win32-Process-Info-1.009
http://search.cpan.org/~wyant/Win32-Process-Info-1.009/
Provide process information for Windows 32 systems. 
----
Wx-0.69
http://search.cpan.org/~mbarbon/Wx-0.69/
interface to the wxWidgets cross-platform GUI toolkit 
----
threads-shared-1.08
http://search.cpan.org/~jdhedden/threads-shared-1.08/
Perl extension for sharing data structures between threads 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 17 Mar 2007 09:17:09 +0100 (CET)
From: Csaba <root@localhost.localdomain>
Subject: Re: odd behavior between Guitest and rcmd on windows
Message-Id: <Xns98F65444D3825iiidi666@194.177.96.26>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in
news:Xns98EED163F596Casu1cornelledu@127.0.0.1: 

> Mark Seger <Mark.Seger@hp.com> wrote in
> news:essaso$lsa$1@usenet01.boi.hp.com: 
> 
>> I have a testing environment that is set up in such a way that after 
>> logging into the PC, a window is displayed that waits for the user to
>> hit the ENTER key and then automaticall starts running a canned set
>> of tests.  This system also has rcmd set up on it for doing various
>> mgmt tasks such as rebooting it.  What I'd like to do is use rcmd to
>> remotely run a local program that sends the ENTER to the system and
>> so remotely start the tests running.
[snip]
> 
> AFAIK, services don't automatically have the right to interact with
> the desktop.
> 
> For your script, started using rcmd, to be able to interact with the 
> desktop, you'll need to set it up that way.

Also, the service (and everything started from it) might have a 
completely different desktop from the one containing the window with the 
button you want to press. Try changing the account for the service to be 
the same as the user logged in interactively.

-- 
Life is complex, with real and imaginary parts.


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

Date: Sat, 17 Mar 2007 04:30:44 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Running several Perl scripts
Message-Id: <U9KKh.12248$8U4.10310@news-server.bigpond.net.au>

Hi all, Using Win XP, ActiveState Perl 5.8.
Question from Perl newby: If I have several Perl scripts that I would 
like to run periodically how can I write a script say master_perl.pl 
that runs say perl_1.pl, perl_2.pl etc.
At present I concatenate all the scripts into one long one but it seems

$my_method =~ m/ugly/; # is true

I have checked the faq and cpan sites plus done a general Google 
searching but cannot find guidance...any assistance appreciated!
Cheers, Peter


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

Date: Sat, 17 Mar 2007 04:41:37 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Running several Perl scripts
Message-Id: <5kKKh.341$742.331@trndny07>

dysgraphia wrote:
> Question from Perl newby: If I have several Perl scripts that I would
> like to run periodically

If by periodically you mean recurring in regular intervals, then the 'at' 
command (similar to 'cron' on Unix) is your friend. Or the Task Scheduler 
from the GUI.

> how can I write a script say master_perl.pl
> that runs say perl_1.pl, perl_2.pl etc.

If you question is really about running (a set of) external programs which 
happen to be other Perl scripts from a given Perl script, then you may want 
to check out system() and/or qx().
If you are looking for parallel execution fork() and exec() would be the way 
to go (although there are other methods, too)

jue 




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

Date: Sat, 17 Mar 2007 07:27:48 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: Running several Perl scripts
Message-Id: <ULMKh.12300$8U4.4735@news-server.bigpond.net.au>

Jürgen Exner wrote:
> dysgraphia wrote:
> 
>>Question from Perl newby: If I have several Perl scripts that I would
>>like to run periodically
> 
> If by periodically you mean recurring in regular intervals, then the 'at' 
> command (similar to 'cron' on Unix) is your friend. Or the Task Scheduler 
> from the GUI.

>>how can I write a script say master_perl.pl
>>that runs say perl_1.pl, perl_2.pl etc.
> 
> If you question is really about running (a set of) external programs which 
> happen to be other Perl scripts from a given Perl script, then you may want 
> to check out system() and/or qx().
> If you are looking for parallel execution fork() and exec() would be the way 
> to go (although there are other methods, too)
> 
> jue 

Thanks Jürgen!, Your comments are much appreciated and sound exactly 
what I have been looking for.
Your mention of Task Scheduler and the 'at' command has got me thinking 
this may be the way to go instead of my manual method.

I will also look at system() and qx()...plenty here to go on with.
Thanks again for your help!
Cheers, Peter



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

Date: 17 Mar 2007 06:41:59 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Scope and Arrays
Message-Id: <1174138919.290482.227530@l77g2000hsb.googlegroups.com>

On Mar 16, 4:40 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:

> So one (rather ugly, I admit) solution would be to
> change "my $message;" into "our $message;":
>
>     our $message;
>     my @messages = ("Hello", "Goodbye");
>
>     foreach $message (@messages) {
>       displayPrint();
>     }
>
>     sub displayPrint {
>
>       print "My message is $message.\n";
>
>     }
>
> prints
>
>     My message is Hello.
>     My message is Goodbye.
>
> I like Anno's way with the hash better, though (that's how I
> would do it).

I think that the global variables design pattern should not be
dismissed out of hand. If used widely they will make code
unmaintainable and unreadable. But used sparingly they can make for
more readable and more maintainable.

To see my epiphany:

http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/e00e827ea3f9ab6f/2fbfe18a8d5e7acd#2fbfe18a8d5e7acd



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

Date: Sat, 17 Mar 2007 10:17:31 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: trying to determine gethostbyaddr call issues doesnt appear to be dns related
Message-Id: <slrnevnchb.nk9.hjp-usenet2@yoyo.hjp.at>

On 2007-03-16 20:30, j.greg.k@gmail.com <j.greg.k@gmail.com> wrote:
> I have checked the dns ptr records for the example below and the
> records exists. also when doing an nslookup from the console on the
> system in which perl is installed I get the correct name
>
> $ nslookup a.b.c.d
[...]
> d.c.b.a.in-addr.arpa    name = ccc_dddd_ddddddd_ddd_cc.dom.ain.
>
> Where c = character and d = digit. It's a common naming convention we
> use on our internal dns servers:
> building_model_serialtag_other-tag_type

Underscores aren't allowed in host names, but that shouldn't matter.

> Next is the output when I run the perl program
>
> $ ./hostname.pl
>  SUB:GETHOSTNAME: Got ccc_dddd_ddddddd_ddd
>
> It truncates the last _ccc for some reason.

It also truncates the domain name, which it shouldn't do.

This makes me wonder whether gethostbyaddr gets the information from
DNS at all. Check if there is a local /etc/hosts file with the affected
ip addresses. If that's not the case check /etc/nsswitch.conf, whether
there are any other datasources except "files" and "dns" for "hosts".

	hp


-- 
   _  | Peter J. Holzer    | Blaming Perl for the inability of programmers
|_|_) | Sysadmin WSR       | to write clearly is like blaming English for
| |   | hjp@hjp.at         | the circumlocutions of bureaucrats.
__/   | http://www.hjp.at/ |	-- Charlton Wilbur in clpm


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 234
**************************************


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