RE: how to create your own module

2009-03-10 Thread Jenda Krynicky
From: "David Christensen" > itshardtogetone: > > > have my perl installed in c:\perl > > I wish to write my own module ... > > It's easiest to learn Perl on Unix/ Linux/ BSD/ etc. (I prefer Debian > and FreeBSD.) No. It's easiest to learn Perl on whatever OS you are familiar with. While the Un

RE: how to create your own module

2009-03-10 Thread David Christensen
itshardtogetone: > have my perl installed in c:\perl > I wish to write my own module ... It's easiest to learn Perl on Unix/ Linux/ BSD/ etc. (I prefer Debian and FreeBSD.) If you don't have an extra computer to play with, install virtual machine software on your Windows machine and download a

how to create your own module

2009-03-10 Thread itshardtogetone
Hi, I am using windowsXP and I have my perl installed in c:\perl I wish to write my own module and so I wrote a simple module and saved it in c:\perl\site\lib\mymod.pm but when I ran myscript below, nothing was printed out and the error msg was "Global symbol "@a" requires explicit package name a

Re: Regex problem

2009-03-10 Thread Gunnar Hjalmarsson
howa wrote: Hello, Consider the code: #=== use strict; my $a = 'a.jpg'; if ($a =~ /(html|jpg)/gi) { print 'ok'; } #=== Is the brucket "()" must be needed? Parentheses. What happened when you tried without them? And why the /g modifier? Since I am n

Re: Regex problem

2009-03-10 Thread Chas. Owens
On Tue, Mar 10, 2009 at 11:19, howa wrote: > Hello, > > Consider the code: > #=== > > use strict; > > my $a = 'a.jpg'; > > if ($a =~ /(html|jpg)/gi) { >    print 'ok'; > } > > #=== > > > Is the brucket "()" must be needed? Since I am not using back > reference, are

Re: Regex problem

2009-03-10 Thread Jim Gibson
On 3/10/09 Tue Mar 10, 2009 8:19 AM, "howa" scribbled: > Hello, > > Consider the code: > #=== > > use strict; > > my $a = 'a.jpg'; > > if ($a =~ /(html|jpg)/gi) { > print 'ok'; > } > > #=== > > > Is the brucket "()" must be needed? Since I am not using

Regex problem

2009-03-10 Thread howa
Hello, Consider the code: #=== use strict; my $a = 'a.jpg'; if ($a =~ /(html|jpg)/gi) { print 'ok'; } #=== Is the brucket "()" must be needed? Since I am not using back reference, are there a better way? Thanks. -- To unsubscribe, e-mail: beginners-uns

Re: if (match) problem

2009-03-10 Thread Dermot
2009/3/10 Jim Gibson : > On 3/10/09 Tue  Mar 10, 2009  7:59 AM, "Dermot" > scribbled: > >> Hi, >> >> I am not getting the results that I expect from this test and I am not >> sure why. If I run the script below I get: >> >> 1..3 >> Line=???/FOO BAR, Name=Joe Smo M="???" >> ok 1 - handle_name ???/F

Re: if (match) problem

2009-03-10 Thread Jim Gibson
On 3/10/09 Tue Mar 10, 2009 7:59 AM, "Dermot" scribbled: > Hi, > > I am not getting the results that I expect from this test and I am not > sure why. If I run the script below I get: > > 1..3 > Line=???/FOO BAR, Name=Joe Smo M="???" > ok 1 - handle_name ???/FOO BAR > Line=change accordingly /

Re: connecting to multiple hosts using Net::SSH2

2009-03-10 Thread monnappa appaiah
Hi All, I'm facing another problem: Below is the script to login to multiple hosts and then execute the command and give the ouput in text file This script will login to all the hosts in input.txt(this file contains around 137 hosts) but when i run the scriptits giving me outpu

if (match) problem

2009-03-10 Thread Dermot
Hi, I am not getting the results that I expect from this test and I am not sure why. If I run the script below I get: 1..3 Line=???/FOO BAR, Name=Joe Smo M="???" ok 1 - handle_name ???/FOO BAR Line=change accordingly /FOO BAR, Name=Foo bar M="change" ok 2 - handle_name change accordingly /FOO BAR

FW: New Build for AIX Fails in debugger

2009-03-10 Thread Chuck Lyon
Hello, I'm hoping someone can help me identify the problem I'm encountering with a new PERL built with gcc on an AIX box. (I'd also appreciate any help in redirecting the request, if appropriate - TIA) The symptoms are that the debugger doesn't seem to be able to find the source code of the main

perl2exe and DBI, DBD::Oracle modules

2009-03-10 Thread Sarsamkar, Paryushan
Hi All, I have one perl script which connects to oracle db and run some queries and get the job done. The initial code is as followed - --code--- #!/usr/bin/perl use strict; use warnings; use DBI; use DBD::Oracle; --code--- Then I have used perl2exe to generate a file so as to exe

unable to connect to all the hosts using Net::SSH2 module

2009-03-10 Thread monnappa appaiah
Hi all, Below is the script to login to multiple hosts and then execute the command and give the ouput in text file This script will login to all the hosts in input.txt(this file contains around 137 hosts) but when i run the scriptits giving me output for only 5 hosts whereas input file h

Re: Parsing file line by line.

2009-03-10 Thread Telemachus
On Tue Mar 10 2009 @ 4:13, Meghanand Acharekar wrote: > Hi, > > Need some help > How can I parse a file line by line using perl. > > I want to parse a test file having following data format > > *File : user_stats.txt* > 20GB Larry > 14.5MB Bob > 3MBJohn > > so that I can send th

Parsing file line by line.

2009-03-10 Thread Meghanand Acharekar
Hi, Need some help How can I parse a file line by line using perl. I want to parse a test file having following data format *File : user_stats.txt* 20GB Larry 14.5MB Bob 3MBJohn so that I can send this data to a MySQL database table. Can I use while loop (any other loop control)

Re: connecting to multiple hosts using Net::SSH2

2009-03-10 Thread Dermot
2009/3/9 : > Jerald Sheets wrote: >> >> On Mar 8, 2009, at 1:29 PM, Ron Bergin wrote: >> >>> On Mar 4, 4:46 am, que...@gmail.com (Jerald Sheets) wrote: I really think you're doing yourself a disservice by just throwing your program commands on lines, not indenting according to best

Re: connecting to multiple hosts using Net::SSH2

2009-03-10 Thread Dr.Ruud
Gunnar Hjalmarsson wrote: Dr.Ruud: Gunnar Hjalmarsson: Dr.Ruud: Gunnar Hjalmarsson: eval { $ssh2->connect($_) }; if ($@) { warn "Unable to connect host $_: $@" and next; } That is the "old fashioned" way. You really need to use the return value of eval to make sure.

Re: connecting to multiple hosts using Net::SSH2

2009-03-10 Thread Ron Bergin
On Mar 9, 3:37 am, que...@gmail.com (Jerald Sheets) wrote: > On Mar 8, 2009, at 1:29 PM, Ron Bergin wrote: > > > > >> #!/usr/bin/perl -w > > > It's better to use the warnings pragma, instead of the -w switch > > Another note on this... I just perldoc'ed it to see what it had to say: > > DESCRIPTIO