[28020] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9384 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 26 14:06:03 2006

Date: Mon, 26 Jun 2006 11:05:07 -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           Mon, 26 Jun 2006     Volume: 10 Number: 9384

Today's topics:
    Re: cgi/perl on Tomcat web server <tadmc@augustmail.com>
    Re: cgi/perl on Tomcat web server narra.madan@gmail.com
    Re: cgi/perl on Tomcat web server <jurgenex@hotmail.com>
    Re: cgi/perl on Tomcat web server <tadmc@augustmail.com>
        Cron Job through Perl <bob@tclaboratories.com>
    Re: Error when connecting to database using Win32::ODBC <ced@blv-sam-01.ca.boeing.com>
    Re: FAQ 1.15 Where can I get a list of Larry Wall witti <brian.d.foy@gmail.com>
    Re: FAQ 2.12 Which magazines have Perl content? <brian.d.foy@gmail.com>
    Re: FAQ 3.5 How do I debug my Perl programs? <brian.d.foy@gmail.com>
    Re: FAQ 3.5 How do I debug my Perl programs? <pue@gmx.net>
    Re: FAQ 4.30 How do I capitalize all the words on one l <brian.d.foy@gmail.com>
    Re: Hash of Arrays <pradeep.bg@gmail.com>
        How to read from a file with both text and binary <brian.gaber@pwgsc.gc.ca>
    Re: How to read from a file with both text and binary <tuser3@gmail.com>
    Re: languages with full unicode support <owong@castortech.com>
    Re: Making the simple impossible and the impossible unt <tadmc@augustmail.com>
    Re: Making the simple impossible and the impossible unt krakle@visto.com
    Re: Need Search::Binary examples <nomail@sorry.com>
        Please help Perl Newbie understand this statement jm-1@remotekontrol.com
    Re: Please help Perl Newbie understand this statement <jurgenex@hotmail.com>
    Re: Problem with Multi- threaded Server xhoster@gmail.com
    Re: Regexp problem <tadmc@augustmail.com>
    Re: Regular Expression Generator <rvtol+news@isolution.nl>
    Re: Termination and type systems <dthierbach@usenet.arcornews.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 26 Jun 2006 08:10:31 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: cgi/perl on Tomcat web server
Message-Id: <slrne9vn67.jvh.tadmc@magna.augustmail.com>


[ Please choose one posting address and stick with it. ]


narra.madan@gmail.com <narra.madan@gmail.com> wrote:

> can anyone briefly describe how to work cgi/perl on tomcat server...


We can discuss the Perl part here in the Perl newsgroup.

CGI is discussed in the CGI newsgroup: comp.infosystems.www.authoring.cgi

Web servers are discussed in the web server newsgroups:

      comp.infosystems.www.servers.mac
      comp.infosystems.www.servers.misc
      comp.infosystems.www.servers.ms-windows
      comp.infosystems.www.servers.unix


> possible please send me a working example


#!/usr/bin/perl
use warnings;
use strict;
print "Content-Type: text/plain\n\n";
print "Hello from the CGI world\n";


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 26 Jun 2006 06:27:18 -0700
From: narra.madan@gmail.com
Subject: Re: cgi/perl on Tomcat web server
Message-Id: <1151328438.371017.90760@b68g2000cwa.googlegroups.com>

this is related to perl purely....

i have a perl script and jsp's...i want to intract between these two...

i tested with two different servers one apache and other weblogic
because once one instance of apache is started we cant start another
server....

so i used weblogic...to overcome this i want to work on a single server
and tomcat supports this thing..

please try to co-operate and post information if you are familar on
this thread instead of telling this is totally out of this group....

this is useful for others in this group who wants to do something
different with perl..



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

Date: Mon, 26 Jun 2006 13:36:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: cgi/perl on Tomcat web server
Message-Id: <IpRng.26798$Xn.18589@trnddc05>

narra.madan@gmail.com wrote:
> this is related to perl purely....

What is related to Perl? Please quote appropriate context -as has been 
customary for 2 decades- when replying such that people have a chance to 
know what you are talking about.

> i have a perl script and jsp's...i want to intract between these
> two...
> i tested with two different servers one apache and other weblogic
> because once one instance of apache is started we cant start another
> server....

This sounds like a problem with your web server.

> so i used weblogic...to overcome this i want to work on a single
> server and tomcat supports this thing..

Ok, fine. But how is this specific to Perl? Are you saying it works fine if 
you are writing your CGI programs in C or Fortran or Cobol?

> please try to co-operate and post information if you are familar on
> this thread instead of telling this is totally out of this group....

Well, if I would do my annual tax return with a Perl program, then a 
question about if I can deduct the lawn fertiziler as business expense for a 
home office would still be off topic to a Perl NG.

> this is useful for others in this group who wants to do something
> different with perl..

The only Perl related part in any CGI question is "perldoc -f print" and 
"perldoc CGI" (plus it's relatives). How to configure a web server has 
nothing to do with Perl.

jue 




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

Date: Mon, 26 Jun 2006 09:37:05 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: cgi/perl on Tomcat web server
Message-Id: <slrne9vs8h.kar.tadmc@magna.augustmail.com>

narra.madan@gmail.com <narra.madan@gmail.com> wrote:

> please try to co-operate and post information 


I will.

I did.


> if you are familar on
> this thread instead of telling this is totally out of this group....


Errr, but what if it *is* totally out of this group?

You would prefer NOT to know a place that is more likely to have
people who are able to answer your question?

OK then.


> this is useful for others in this group who wants to do something
> different with perl..


Configuring web servers is off-topic in this newsgroup, you are
looking for answers in the wrong place.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 26 Jun 2006 10:39:06 -0700
From: "Bob Anastasia" <bob@tclaboratories.com>
Subject: Cron Job through Perl
Message-Id: <1151343546.449793.147900@c74g2000cwc.googlegroups.com>

Hello,
I am looking to try to add, edit, and view cron jobs through a perl
script. does anyone have a way to do so. I looked at Schedule::Cron but
it seems like it is more for setting up crons in specific sub routines
in itself instead of setting up actual cron jobs. (unless i
misunderstood it) in which case if anyone had previous experience in
Schedule::Cron then could they give me an example of how to
add/edit/view through that script.


thank you



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

Date: Mon, 26 Jun 2006 17:38:26 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Error when connecting to database using Win32::ODBC
Message-Id: <J1HAC2.256@news.boeing.com>

madan wrote:

 ...
> 
> #########
> Undefined subroutine &Scalar::Util::blessed called at
> W:/usr/lib/overload.pm line 89.


Another good item to remember: list OS and Perl versions when posting.

(Scalar::Util for instance wasn't included in the core until 5.6.1 if
  I remember correctly. )

-- 
Charles DeRykus


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

Date: Mon, 26 Jun 2006 08:26:44 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 1.15 Where can I get a list of Larry Wall witticisms?
Message-Id: <260620060826440440%brian.d.foy@gmail.com>

In article <1150684564.898958.72490@h76g2000cwa.googlegroups.com>,
<krakle@visto.com> wrote:

> PerlFAQ Server wrote:
> > 1.15: Where can I get a list of Larry Wall witticisms?
> > 
> 
> This is a Frequently Asked Question????????????

It used to be a very frequently asked question when Larry was more 
active in usenet.

But, your question is sorta like asking why you need so many police
officers when there is no crime... :)

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Mon, 26 Jun 2006 08:28:22 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 2.12 Which magazines have Perl content?
Message-Id: <260620060828226326%brian.d.foy@gmail.com>

In article <pan.2006.06.09.07.23.10.610486@imaginet.fr>, Emmanuel
Florac <eflorac@imaginet.fr> wrote:

> Le Thu, 08 Jun 2006 18:03:02 -0700, PerlFAQ Server a écrit :
> 
> > 
> > 2.12: Which magazines have Perl content?
> 
> This one needs to be updated. The Perl Journal is dead, and the Perl
> Review is entirely devoted to perl.

The Perl Journal stopped publishing, but you can still get its 
articles online at the Dr. Dobbs site.  I will update the 
answer appropriately though.

Thanks,

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Mon, 26 Jun 2006 08:30:08 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 3.5 How do I debug my Perl programs?
Message-Id: <260620060830082711%brian.d.foy@gmail.com>

In article <2vs7m3-i4t.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
<benmorrow@tiscali.co.uk> wrote:

> Quoth niall.macpherson@ntlworld.com:
> > >
> > >     The "Data::Dumper" module can pretty-print Perl data structures:
> > >
> > >             use Data::Dumper( Dump );

> There are (apparently) two bugs in the FAQ. Firstly, import arguments
> need quoting, so it should be
> 
>     use Data::Dumper qw(Dump);
> 
> and secondly, Data::Dumper indeed doesn't export a 'Dump' function, so
> it should be
> 
>     use Data::Dumper qw(Dumper);
>     print STDERR "The hash is " . Dumper(\%hash) . "\n";


Huh, I wonder if I did that in some sleep deprived state. Either way,
I'll fix it.

Thanks,

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Mon, 26 Jun 2006 17:01:43 +0200
From: =?ISO-8859-1?Q?Andreas_P=FCrzer?= <pue@gmx.net>
Subject: Re: FAQ 3.5 How do I debug my Perl programs?
Message-Id: <4gab6hF1mcn43U1@individual.net>

brian d foy schrieb:
> In article <2vs7m3-i4t.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
> <benmorrow@tiscali.co.uk> wrote:
> 
> 
>>Quoth niall.macpherson@ntlworld.com:
>>
>>>>    The "Data::Dumper" module can pretty-print Perl data structures:
>>>>
>>>>            use Data::Dumper( Dump );
> 
> 
>>There are (apparently) two bugs in the FAQ. Firstly, import arguments
>>need quoting, so it should be
>>
>>    use Data::Dumper qw(Dump);
>>
>>and secondly, Data::Dumper indeed doesn't export a 'Dump' function, so
>>it should be
>>
>>    use Data::Dumper qw(Dumper);
>>    print STDERR "The hash is " . Dumper(\%hash) . "\n";
> 
> 
> 
> Huh, I wonder if I did that in some sleep deprived state. Either way,
> I'll fix it.
> 
> Thanks,
> 

Just a thought, shouldn't the OO-version of Data::Dumper be also
included in this FAQ, like in:

use Data::Dumper;
print "The hash is ".Data::Dumper->Dump([\%hash],[mybighash])."\n";

BTW, maybe this was even where the above Dump-import came from??

Greetings,

Andreas Pürzer

-- 
perl -mAcme::JAPH


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

Date: Mon, 26 Jun 2006 08:33:35 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 4.30 How do I capitalize all the words on one line?
Message-Id: <260620060833355115%brian.d.foy@gmail.com>

In article <1qWdnZHvJPl-bQbZnZ2dnUVZ_qqdnZ2d@rcn.net>, thundergnat
<thundergnat@hotmail.com> wrote:

> PerlFAQ Server wrote:

> >             $string =~ s/ (
> >                                      (^\w)    #at the beginning of the line
> >                                        |      # or
> >                                      (\s\w)   #preceded by whitespace
> >                                        )
> >                                     /\U$1/xg;

> Misses words with leading punctuation. e.g. "this", 'that' & (other)

No solution is perfect, and even your solutions have problems.

You can't just use a word boundary, either, for the reasons listed in
the answer. 

Any answer that tries to do it in a single substitution is probably
going to be inadequate.

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: 26 Jun 2006 10:06:47 -0700
From: "Deepu" <pradeep.bg@gmail.com>
Subject: Re: Hash of Arrays
Message-Id: <1151341607.805355.290880@c74g2000cwc.googlegroups.com>

Thank you all for helping me out on Hash of array of arrays. I was able
to print out without 'undef' as the array was starting at 1 always and
not 0.



Mumia W. wrote:
> Deepu wrote:
> > [...]
> > if ($_ =~ /^\s*(\S+\t+blk:\s+\S+)\s+pg:\s+(\S+)/) { <--- Line 1
> >
> >     push @{ $transitions{ $ARGV } }, [] if /STATEMAIN/;
> >
> >
> >     if ( /STATEMAIN/ .. /RESET/ || eof ) { <--- Line 2
> >
> >
> >         push @{ $transitions{ $ARGV }[ -1 ] }, $1; #### $_ changed to
> > $1
> > [...]
> >
> > In the array STATEMAIN and RESET is undef after the changes, why is
> > this?? Thanks for helping me on this.
> >
>
> Whenever a successful match occurs, and no capturing was done, the match
> variables are reset.
>
> On line 2, when /STATEMAIN/ (or /RESET/) is successful, the match
> variables $1 and $2 are reset. IOW (in other words), the data captured
> from line 1 is lost at line 2, so you need to save the values in other
> variables before you get to line 2.



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

Date: Mon, 26 Jun 2006 12:26:25 -0400
From: "Brian" <brian.gaber@pwgsc.gc.ca>
Subject: How to read from a file with both text and binary
Message-Id: <44a00c6c$1@orange>

I am processing print job files.  They all contain a Start banner with plain 
text then following the banner comes the data to be printed.  This data can 
either be plain text or PCL (binary).  I need to be able to determine what 
format the data is in because the processing is different.  I tried using -T 
and -B on the file, but Perl returns -T as TRUE, I guess becuase of the 
plain text header.  The PCL always starts with the string ^[E^[... so I 
tried searching for that, but to no avail with the following code:

while ( <SRCFILE> ) {
   if ( $_ =~ /\^\[E\^\[/ ) {  # Does this line contain ^[E^[
      $pclFlag = 1;
      print " PCL File detected\n";
   }
}

Here is an example of part of a print job file containing PCL data:

* PRINT TIME:    13:30:38 
*
* PRINT DATE:    23 JUN 2006 
*
* PRINT NAME:    TA104002 
*
* SYSTEM:        MVSA 
*
* 
*
**START*****START*****START*****START*****START*****START*****START*****START**
^[E^[&u300D^[*v1O^[*v0N^[*c00001D^[)s64W@^B)$7^A^^¦^U^BÿªÃðÄðÇãñðãñåñððó÷^[*c0E^[(s17W^D^N^A^A^Ax^[*c1E^[(s17W^D^N^A^A^Ax^[*c2E^[(s17W^D
^N^A^A^Ax^[*c3E^[(s17W^D^N^A^A^Ax^[*c4E^[(s17W^D^N^A^A^Ax^[*c5E^[(s17W^D^N^A^A^Ax^[*c6E^[(s17W^D^N^A^A^Ax^[*c7E^[(s17W^D^N^A^A^Ax^[*c8E^[
(s17W^D^N^A^A^Ax^[*c9E^[(s17W^D^N^A^A^Ax^[*c10E^[ 




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

Date: 26 Jun 2006 10:12:16 -0700
From: "tuser" <tuser3@gmail.com>
Subject: Re: How to read from a file with both text and binary
Message-Id: <1151341935.963512.13840@i40g2000cwc.googlegroups.com>

Brian wrote:
> I am processing print job files.  They all contain a Start banner with pl=
ain
> text then following the banner comes the data to be printed.  This data c=
an
> either be plain text or PCL (binary).  I need to be able to determine what
> format the data is in because the processing is different.  I tried using=
 -T
> and -B on the file, but Perl returns -T as TRUE, I guess becuase of the
> plain text header.  The PCL always starts with the string ^[E^[... so I
> tried searching for that, but to no avail with the following code:
>
> while ( <SRCFILE> ) {
>    if ( $_ =3D~ /\^\[E\^\[/ ) {  # Does this line contain ^[E^[
>       $pclFlag =3D 1;
>       print " PCL File detected\n";
>    }
> }
>
> Here is an example of part of a print job file containing PCL data:
>
> * PRINT TIME:    13:30:38
> *
> * PRINT DATE:    23 JUN 2006
> *
> * PRINT NAME:    TA104002
> *
> * SYSTEM:        MVSA
> *
> *
> *
> **START*****START*****START*****START*****START*****START*****START*****S=
TART**
> ^[E^[&u300D^[*v1O^[*v0N^[*c00001D^[)s64W@^B)$7^A^^=A6^U^B=FF=AA=C3=F0=C4=
=F0=C7=E3=F1=F0=E3=F1=E5=F1=F0=F0=F3=F7^[*c0E^[(s17W^D^N^A^A^Ax^[*c1E^[(s17=
W^D^N^A^A^Ax^[*c2E^[(s17W^D
> ^N^A^A^Ax^[*c3E^[(s17W^D^N^A^A^Ax^[*c4E^[(s17W^D^N^A^A^Ax^[*c5E^[(s17W^D^=
N^A^A^Ax^[*c6E^[(s17W^D^N^A^A^Ax^[*c7E^[(s17W^D^N^A^A^Ax^[*c8E^[
> (s17W^D^N^A^A^Ax^[*c9E^[(s17W^D^N^A^A^Ax^[*c10E^[

I have taken your print job file literally, i.e. the sequence "^[E^["
literally means 5 characters:
character "^", followed by another character "[", followed by "E", then
followed by another "^", and a final "["

 .=2E.and, no surprise, the match "...if ( $_ =3D~ /\^\[E\^\[/ )..." works
fine.

However, I suspect that the 2-character sequence "^[" is not to be
taken literally, but really stands for one single control character
(possibly an octal "\033").

You could try the following instead:
if ( $_ =3D~ /\033E\033/ )



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

Date: Mon, 26 Jun 2006 14:29:53 GMT
From: "Oliver Wong" <owong@castortech.com>
Subject: Re: languages with full unicode support
Message-Id: <BbSng.15374$B91.5146@edtnps82>


"Oliver Bandel" <oliver@first.in-berlin.de> wrote in message 
news:1151276031.641318@elch.in-berlin.de...
>
> Xah Lee wrote:
>
>>
>> As far as i know, Java and JavaScript are languages with full, complete
>> unicode support. That is, they allow names to be defined using unicode.
>
> Can you explain what you mena with the names here?

    As in variable names, function names, class names, etc.

    - Oliver 



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

Date: Mon, 26 Jun 2006 08:16:34 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Making the simple impossible and the impossible unthinkable...
Message-Id: <slrne9vnhi.jvh.tadmc@magna.augustmail.com>

xfx.publishing@gmail.com <xfx.publishing@gmail.com> wrote:

> Subject: Re: Making the simple impossible and the impossible unthinkable...


Please put the subject of your article in the Subject of your article.

Folks that are interested in web scraping will read articles whose
subject mentions web scraping.

They are likely to skip reading articles whose subject cannot be
determined by the Subject.


> I'm trying to get a Perl script with LWP to get information from AOL
> profiles.


>>From what I can tell there's some weird and utterly pointless
> Javascripting going on. I set up a logger on my XP box (first free HTTP
> logger I could find, so XP it was -- 


   Web Scraping Proxy

      http://www.research.att.com/~hpk/wsp/


> but I'm doing the code under
> Debian Linux just so you know) and I'm getting cookies being sent that
> I don't have -- which is giving the strong impression that some
> Javascript somewhere is making these cookies up on the fly. This gives
> me the strong impression that AOL takes the opposite philosophy of
> Perl, and possibly has occasional meetings where people get together
> and decide 'We don't have enough code -- we need more code to do the
> same thing. Let's try and complicate things more.' I bet they have
> buzzwords like 'complexify'. It's asinine to do so much stupid crap
> just to set up login validation.


It is an AOL site.

The sun rises in the East.

So what's new?  :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 26 Jun 2006 07:22:30 -0700
From: krakle@visto.com
Subject: Re: Making the simple impossible and the impossible unthinkable...
Message-Id: <1151331743.441022.143840@p79g2000cwp.googlegroups.com>


xfx.publishing@gmail.com wrote:
> It's asinine to do so much stupid crap
> just to set up login validation.

Isnt that the point? And isnt that the reason you cannot access their
site with a script?



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

Date: Mon, 26 Jun 2006 10:59:31 -0700
From: Arvin Portlock <nomail@sorry.com>
To: "John W. Krahn" <krahnj@telus.net>
Subject: Re: Need Search::Binary examples
Message-Id: <44A02083.2090206@sorry.com>

> You should *ALWAYS* verify that the file opened correctly.

> Even though the
> stat() showed that the file exists that does not mean that you would 
> be able
> to open it.  You should also include the $! and/or $^E variables to 
> indicate
> exactly why the file could not be opened.
>
> Also, the string '0' is false so if you had a file named '0' you would not
> find it.  Use the defined() function to properly test whether a variable
> contains a value.
>
> if ( defined $textfile ) {
>     if ( open STATFILE, '<', $textfile ) {
>
Thanks for the feedback. I do have a bad habit of not
checking the status of a file open. Mostly because I
just don't like programs dieing on my users. I know about
$! but $^E is new to me. I'll check it out. Thanks also
for pointing out the string '0' bug. For some reason I
have had problems with defined() working as advertised so
typically shy away from it aside from checking for the
existence of hash keys. Don't ask me what the problem
was exactly, I simply remember having problems with it.
When it's critical I actually resort to something like:
if ($var or $var eq '0'). An ugly personal idiom that
I'd just as soon drop. I'll try and use defined () from
now on and possibly post here someday if I have problems
with it that I can't figure out.

I'm also going through and doing a few more optimizations
as they occur to me. For example I believe I don't gain
anything by sorting my random numbers. Hmm, there was one
other that I thought of but has gone out of my mind now.

Arvin



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

Date: 26 Jun 2006 08:39:58 -0700
From: jm-1@remotekontrol.com
Subject: Please help Perl Newbie understand this statement
Message-Id: <1151336398.850461.229940@r2g2000cwb.googlegroups.com>

Hi

I have not programmed before and I am doing my best to get to grips
with Perl in order to decode and modify a backup script. Could anyone
please explain the following line in plain english to me? I understand
that what we are saying is "While the file handle <CONFIG> is
available, chomp the newline character of off each line as we read it"
and then I am lost. Sorry to sound so thick! I am working my through
the tutorials but I am under pressure to get this script working. I
have pasted the entire script at the bottom of this message.

while (<CONFIG>)
{
 chomp;
  if (m/^\w/)
  {
   ($key, $data) = split /=/, $_;
    $array{$key} = $data;
  }
}

Thanks for any help

Andy

#!/usr/bin/perl

use Expect;
use IO::Socket;

#Declare the varibles

my ($hour, $min, $sec, $now, $remoteip, $port, $connected, $ping);
my (@ports, @lines, %status);

#Delete know hosts file for ssh
$command = "/bin/rm -f /root/.ssh/known_hosts";

system($command);

#Open config file.

##if (!(open(CONFIG, "pix_backup.cfg")))
#{
 # die "Emergency: Error: Cannot open configuration file";
#}

#Read contents of config file into a hash

#while (<CONFIG>)
#{
  #chomp;
 # if (m/^\w/)
  #{
   # ($key, $data) = split /=/, $_;
   # $array{$key} = $data;
  #}
#}

#Initialise variables read from the config file

my @ports = ("22");

$outputdir = $array{outputdir};
$firewall = $array{firewall};
$username = $array{username};
$password = $array{password};

# Get name of host list file from command line

#GetOptions ('f=s' => \$config_file);

# Decrypt host config file.

$config_file = "/var/scripts/host.lst";
#$ccrypt_key = "*************************";

#$command = "ccrypt -q -K $ccrypt_key -d $config_file.cpt";

#system($command);

#Open host config file.

if (!(open(HOSTS, $config_file)))
{
  die "Emergency: Error: Cannot open host file";
}

# Read contents of config file into an array

@firewalls = <HOSTS>;

# EnCrypt host config file

#$command = "ccrypt -q -K $ccrypt_key -e $config_file";

#system($command);

# Loop through all the hosts in the config file to grab all the configs

for ($i=0; $i < @firewalls; $i++)
	{

$string = $firewalls[$i];

chomp($string);

# Split out host to work on

@host = split /,/, $string;

# Set all the host variables

$Hostname = $host[0];
$HostIP = $host[1];
$UserName = $host[2];
$Password = $host[3];
$Enable_Password = $host[4];


$command = "perl /var/scripts/pix_get.pl -h $Hostname";

system($command);

##print $data;

} # End For

print "\n[FINISHED]\n\n"



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

Date: Mon, 26 Jun 2006 16:13:11 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Please help Perl Newbie understand this statement
Message-Id: <rITng.4684$Yk.281@trnddc06>

jm-1@remotekontrol.com wrote:
> I have not programmed before and I am doing my best to get to grips
> with Perl in order to decode and modify a backup script. Could anyone
> please explain the following line in plain english to me? I understand
> that what we are saying is "While the file handle <CONFIG> is
> available,

Nope. That line means "While the file that is referenced by the file handle 
CONFIG has not reached EndOfFile (i.e. while there are still lines 
available)" loop through each line in sequence."

> chomp the newline character of off each line as we read it"
> and then I am lost.

> while (<CONFIG>)
> {
> chomp;
>  if (m/^\w/)

If the current line starts with a word character
       "\w  Match a "word" character (alphanumeric plus "_")"
then

>  {
>   ($key, $data) = split /=/, $_;

Split the current line at any equal sign "=", store the first part in $key, 
store the second part in $data, ignore any other parts.

>    $array{$key} = $data;

And store $data in the hash named %array at the data point $key. BTW: using 
%array for a hash is somewhat misleading.

jue 




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

Date: 26 Jun 2006 15:55:26 GMT
From: xhoster@gmail.com
Subject: Re: Problem with Multi- threaded Server
Message-Id: <20060626115544.947$wz@newsreader.com>

"janicehwang1325@yahoo.com" <janicehwang1325@yahoo.com> wrote:
> Thanks for the debuggin guidelines. Here are some results for my
> testing:
>
> 1. Threaded server works fine without SSL.
> 2. DBI doesn't cause a problem for threaded server (either enable or
> disable DBI does not cause the problem with the condition WITHOUT SSL)
> 3. Threaded server fails when use with SSL


Have you read and understood the parts about close and SSL_no_shutdown in
the IO::Socket::SSL docs?

I can't get SSL to install, so I can't test it, but I suspect this is
likely the problem.


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Mon, 26 Jun 2006 07:37:54 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regexp problem
Message-Id: <slrne9vl92.jvh.tadmc@magna.augustmail.com>

Mark Healey <dont@like.spammers> wrote:

> Like most open source perldoc sucks.


So long!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 26 Jun 2006 15:48:07 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Regular Expression Generator
Message-Id: <e7ovo0.1e0.1@news.isolution.nl>

jeremyje@gmail.com schreef:

> Is there a library or a way to generate an appropriate regular
> expression for any given input string?
> (remove quotes for examples)
> For example: "1234567890abcdef is in hex9"
> Regex Generator returns: [0-9|A-F]{16} [a-z]{2} [a-z]{2} [0-9|a-z]{3}
>
> Or anything that does some sort of similar processing?

I once created a Visual Basic-function that derived a mask from the
lines of a file. All the lines were supposed to have the same length,
and all characters were printable, so that made it a lot easier.

It would return a string of the same length. Special character values
were used for character sets, like 0x01 for [A-Z], 0x02 for [a-z], 0x03
for [A-Za-z], 0x04 for [0-9], 0x05 for [0-9A-Z], 0x07 for [0-9A-Za-z],
etc. It even recognized EBCDIC-numericals. It could also show a '@' for
alpha and a '#' for numeric.

A graphical character like ',' would mean that all lines in the file had
a ',' in that position. All in all it was very handy to get a quick idea
of what a fixed record file was about.

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

Date: Mon, 26 Jun 2006 13:13:26 +0200
From: Dirk Thierbach <dthierbach@usenet.arcornews.de>
Subject: Re: Termination and type systems
Message-Id: <20060626111326.18B1.0.NOFFLE@dthierbach.news.arcor.de>

David Hopwood <david.nospam.hopwood@blueyonder.co.uk> wrote:
> Marshall wrote:
>> David Hopwood wrote:

>>> A type system that required an annotation on all subprograms that
>>> do not provably terminate, OTOH, would not impact expressiveness
>>> at all, and would be very useful.

>> Interesting. I have always imagined doing this by allowing an
>> annotation on all subprograms that *do* provably terminate. 

Maybe the paper "Linear types and non-size-increasing polynomial time
computation" by Martin Hofmann is interesting in this respect.
From the abstract:

  We propose a linear type system with recursion operators for inductive
  datatypes which ensures that all definable functions are polynomial
  time computable. The system improves upon previous such systems in
  that recursive definitions can be arbitrarily nested; in particular,
  no predicativity or modality restrictions are made.

It does not only ensure termination, but termination in polynomial time,
so you can use those types to carry information about this as well.

> If the annotation marks not-provably-terminating subprograms, then it
> calls attention to those subprograms. This is what we want, since it is
> less safe/correct to use a nonterminating subprogram than a terminating
> one (in some contexts).

That would be certainly nice, but it may be almost impossible to do in
practice. It's already hard enough to guarantee termination with the
extra information present in the type annotation. If this information
is not present, then the language has to be probably restricted so
severely to ensure termination that it is more or less useless.

- Dirk


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

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 V10 Issue 9384
***************************************


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