Re: Modifying StanzaFile

2008-03-14 Thread Kashif Salman
On Fri, Mar 14, 2008 at 8:08 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Kashif Salman wrote: > > I have a config file with stanzas that I need to parse, > > > > > > define name1{ > > variable=value > > variable2=value2 > > .. > > } > > define name2{ > > variable=value

Re: Modifying StanzaFile

2008-03-14 Thread Gunnar Hjalmarsson
Kashif Salman wrote: I have a config file with stanzas that I need to parse, define name1{ variable=value variable2=value2 .. } define name2{ variable=value variable2=value2 ... } use Data::Dumper; my %HoH; { local $/ = "}\n"; while (<>) {

Re: subroutine in here document

2008-03-14 Thread Jenda Krynicky
From: "Kashif Salman" <[EMAIL PROTECTED]> > I know I can create html code using CGI and call a subroutine in there > easily but if i were to use a here document for my html code, can I > call a subroutine in there? > > print< HTML code > <--Can I call foo() in here somehow? > E

Modifying StanzaFile

2008-03-14 Thread Kashif Salman
I have a config file with stanzas that I need to parse, going thorugh CPAN I came across StanzaFile which works on stanzas like so [name] variable=value variable1=value1 ... [name1] variableA=valueA variable1A=value1A But my stanzas look like: define

Re: perldoc doesn't work

2008-03-14 Thread John W. Krahn
Snider wrote: I'm experiencing a strange problem with perldoc on a RHEL 4 box. Basically, I get no output when I run perldoc as a regular user. In other words, I get a blank less output. If I run the command as root I can see the information. I'm kind of stumped as to how to debug this proble

perldoc doesn't work

2008-03-14 Thread Snider
I'm experiencing a strange problem with perldoc on a RHEL 4 box. Basically, I get no output when I run perldoc as a regular user. In other words, I get a blank less output. If I run the command as root I can see the information. I'm kind of stumped as to how to debug this problem. The /tmp dir

Re: subroutine in here document

2008-03-14 Thread Rob Dixon
Kashif Salman wrote: > I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print< Yes you can, but I'd rather not tell you how because it's likely to be the ugliest of several poss

Re: subroutine in here document

2008-03-14 Thread Gunnar Hjalmarsson
Kashif Salman wrote: I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print< Check out the FAQ entry perldoc -q "function calls" -- Gunnar Hjalmarsson Email: http://www.gu

subroutine in here document

2008-03-14 Thread Kashif Salman
I know I can create html code using CGI and call a subroutine in there easily but if i were to use a here document for my html code, can I call a subroutine in there? print

Re: dinamic cgi with perl

2008-03-14 Thread Ken Foskey
On Fri, 2008-03-14 at 15:14 +0100, Pau Marc Munoz Torres wrote: > To solve it i was thinking on introduce a javascript code into my cgi, but i > don't know how to pass the variable info between perl and javascript. AJAX - I ended up hand coding my AJAX from scratch but there is a module that I

Re: Extracting data from a string

2008-03-14 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hello Hello, I have a string that I am trying to parse out into separate variables. I am having problems getting the first field extracted. I want to extract fields using period (.) and underline (_) delimineters. Here is the string aaa_b_c_.ddd The string is c

Extracting data from a string

2008-03-14 Thread andrewmchorney
Hello I have a string that I am trying to parse out into separate variables. I am having problems getting the first field extracted. I want to extract fields using period (.) and underline (_) delimineters. Here is the string aaa_b_c_.ddd The string is contained in $_. Here is my code

Re: Can perl find list of words from a PDF or other document and populate a database?

2008-03-14 Thread Stuart White
Er, no. I will look. Thanks. And, are you saying that if perl can parse the PDF, then populating the database is simple? - Original Message From: Jefferson Kirkland <[EMAIL PROTECTED]> To: Stuart White <[EMAIL PROTECTED]> Cc: beginners@perl.org Sent: Friday, March 14, 2008 10:51:34 A

Info from flat file

2008-03-14 Thread Manoj
I have a log file like this. The part between += are almost similar from which I need to fetch for IP Address and Connection time only for domain perl.com. The perl.com domain may scattered in log. The main intension of my work is that this log keeps a record of the users who visits websites. I hav

RE: Hash & CSV

2008-03-14 Thread Manoj
When using Data: Dumper is taking more time for my 1 lines of CSV file. This solved a few queries...and the benchmark was a new value addition for me. Thanks -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 12:01 PM To: Perl Beginners

Re: CGI warning/error

2008-03-14 Thread Gunnar Hjalmarsson
Kashif Salman wrote: On Fri, Mar 14, 2008 at 11:10 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > The -w switch enables warnings dynamically, and apparently CGI.pm isn't > 'warnings safe'. To get rid of those warnings, you can replace the -w > switch with the warnings pragma, which is

Net::SSH::Perl log in

2008-03-14 Thread Pat Rice
Hi all I'm trying to do the following as a test to get perl to log in to an ssh server. Before anyone asks the password has been changed, but was correct for log in. Code below Thanks in advance. Pat 1 #!/usr/bin/perl 2 use Net::SSH::Perl; 3 4 $scon = Net::SSH::Perl->new

Re: CGI warning/error

2008-03-14 Thread Kashif Salman
On Fri, Mar 14, 2008 at 11:19 AM, Kashif Salman <[EMAIL PROTECTED]> wrote: > On Fri, Mar 14, 2008 at 11:10 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> > wrote: > > Kashif Salman wrote: > > > I got this example code from the book "CGI Programming with Perl" > > > > > > #!/usr/bin/perl -wT >

Re: CGI warning/error

2008-03-14 Thread Kashif Salman
On Fri, Mar 14, 2008 at 11:10 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Kashif Salman wrote: > > I got this example code from the book "CGI Programming with Perl" > > > > #!/usr/bin/perl -wT > > > > use strict; > > use CGI; > > > > my $q = new CGI; > > print $q->header( "text/pla

Re: CGI warning/error

2008-03-14 Thread Gunnar Hjalmarsson
Kashif Salman wrote: I got this example code from the book "CGI Programming with Perl" #!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; print $q->header( "text/plain" ); print "These are the HTTP environment variables I received:\n\n"; foreach ( $q->http ) { print "$_:\n"; p

CGI warning/error

2008-03-14 Thread Kashif Salman
I got this example code from the book "CGI Programming with Perl" #!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; print $q->header( "text/plain" ); print "These are the HTTP environment variables I received:\n\n"; foreach ( $q->http ) { print "$_:\n"; print " ", $q->http( $_

Re: print spanish symbols

2008-03-14 Thread obdulio santana
2008/3/13, Jenda Krynicky <[EMAIL PROTECTED]>: > > From: "obdulio santana" <[EMAIL PROTECTED]> > > 2008/3/12, Jenda Krynicky <[EMAIL PROTECTED]>: > > > > . . I see. Sorry. Properly set is not enough when it comes to Windows. MS > Windblows uses two encodings. For reasons I would love to

Re: reg help: printing line numbers in file

2008-03-14 Thread Rob Dixon
Gowri Chandra Sekhar Barla, TLS, Chennai wrote: > Hi John thanks for replay, script is working fine I am unable to understand following expression s!/\*.*?(?:\*/|$)!!, [snip] Gowri, and everybody, /please/ bottom-post your replies to this list. This has been getting out of hand recently, and

Re: functions: rotate and factorial

2008-03-14 Thread Rob Dixon
Sharan Basappa wrote: > Thanks everybody. I need to use these as a part of algo I am working on. I will get back if I have any comments .. Rotating an array and calculating a factorial are both likely to absorb large amounts of processor time unless your problem is trivial. I'm also intrigued t

Re: Sending XML data file to the XML channel

2008-03-14 Thread Rob Dixon
[EMAIL PROTECTED] wrote: Hi, I want to push XML data file to the XML channel, please find the code snippet for the same. #!/usr/bin/perl use LWP::UserAgent; my $browser = LWP::UserAgent->new; my $url = 'http://xxx.xxx.xxx.xxx:x'; open(FILE,"display.xml"); my @data=;

Re: Can perl find list of words from a PDF or other document and populate a database?

2008-03-14 Thread Jefferson Kirkland
Well, populating the database is a gimmie, but for parsing the PDF document, have you examined all of the PDF modules on CPANto see if they can do what you are asking? Regards, Jeff On Thu, Mar 13, 2008 at 4:17 PM, Stuart White <[EMAIL PROTECTE

Re: QUERY: batch CPAN installation...

2008-03-14 Thread Peter Scott
[top first posting reordered] On Fri, 14 Mar 2008 12:27:17 +0100, eMko wrote: > Andrew Wan wrote: >> I've got a list of CPAN modules that I want to install, over the >> internet. >> >> From experience, I just type cpan, then: install HTML::Clean >> (press RETURN for dependency prompts) install H

dinamic cgi with perl

2008-03-14 Thread Pau Marc Munoz Torres
Hi everybody i got a program that works in a bash environment, and now, i would like to make a cgi with it, the objective for this program is check the integrity of the info provided by some text files and if it finds some error ask you for some info and i would like to be able to introduce it.

Sending XML data file to the XML channel

2008-03-14 Thread shibakkathullah.inayathullah
Hi, I want to push XML data file to the XML channel, please find the code snippet for the same. #!/usr/bin/perl use LWP::UserAgent; my $browser = LWP::UserAgent->new; my $url = 'http://xxx.xxx.xxx.xxx:x'; open(FILE,"display.xml"); my @data=; my $response = $browser->po

Re: QUERY: batch CPAN installation...

2008-03-14 Thread eMko
Hello. This command perl -MCPAN -e"install Wx, Tie::File, Tie::Hash" works well. It is only for instance, because Wx I have installed (and using) and either Tie::File or Tie::Hash comes with Perl. When running perl, the -M parameter tells it to use a package. -e parameter tells it to run som

Per Module Authen::pam Problem

2008-03-14 Thread sandy
Hi, I have an perl programme that change password but not interactively.. the programme run and ends with this message "Authentication token manipulation error" __ #!/usr/bin/perl -w use Authen::PAM; $service = "passwd"; $

Re: functions: rotate and factorial

2008-03-14 Thread Sharan Basappa
Thanks everybody. I need to use these as a part of algo I am working on. I will get back if I have any comments .. On Thu, Mar 13, 2008 at 7:19 PM, obdulio santana <[EMAIL PROTECTED]> wrote: > 2008/3/13, Jenda Krynicky <[EMAIL PROTECTED]>: > > > > > > Date sent: Thu, 13 Mar 2008 18:0

Re: reg help: printing line numbers in file

2008-03-14 Thread John W. Krahn
Gowri Chandra Sekhar Barla, TLS, Chennai wrote: From: John W. Krahn [mailto:[EMAIL PROTECTED] $ echo " /* requesting for the script * more * and more * for printing line number */ Fun_script() { Int a; /* local parameter */ Int b; /* local parameter */ /* adding the