Can't get desired o/p with this code

2008-11-04 Thread Anirban Adhikary
Dear List I am trying to check some modules are installed or not in the system and if modules are installed then trying to check their version number is according to our requirement or not. use strict; use warning; my @mod_info=("DBD::Oracle","abc","DBI","Parallel::ForkManager",); my $module; my $

Segfault with Term::ReadLine::GNU

2008-11-04 Thread Jorge Almeida
Term::ReadLine::GNU just stopped working: $ perl -e 'use Term::ReadLine; $t=Term::ReadLine->new("test");' Segmentation fault OS is linux, kernel 2.6.25. Perl version is 5.8.8 (on a Pentium 4). Term::ReadLine::GNU is version 1.17 (I also tried 1.16, no difference). I had to reinst

Need a context diff that is not line based

2008-11-04 Thread Bob McConnell
I have several text files of prose that I need to do context diffs on. However, these files have been through various editors and the line sizes have been changed multiple times, so a line based tool will not work. I really need a word based diff that can ignore white space changes and show just th

printing line numbers

2008-11-04 Thread Gowri Chandra Sekhar Barla, TLS, Chennai
Hi all I don't want print the line numbers For the following 1) Starting with . 2) Labels label: not for 1: Example Ghjgg Hjh .. Abcb: ggghj 1: G Output should be 1 Ghjgg 2 Hjh . 3 hhjkhjkh Abcb: 4 ggghj 5 1: 6 g Thanks and regards Gowri DISCLAIMER: ---

Re: substitute multiple spaces with just one

2008-11-04 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Tue, 2008-11-04 at 16:30 +0100, Rob Coops wrote: What you want to be doing is this: $temp =~ s/\s+/ /g; Actually to substitute multiple spaces with just one: $temp =~ s/ +/ /g; Or as some prefer: $temp =~ s{ [ ]+ }{ }gx; Not if speed is an issue: $ perl -le'

Re: substitute multiple spaces with just one

2008-11-04 Thread John W. Krahn
Sharan Basappa wrote: Hi, Hello, I have string that has one or more spaces. I would like to replace them with a single space. $ perl -le' my $temp = "0 1 2 34"; print $temp; $temp =~ tr/ //s; print $temp; ' 0 1 2 34 0 1 2 3 4 The simple code below replaces the spaces fine,

Re: substitute multiple spaces with just one

2008-11-04 Thread Mr. Shawn H. Corey
On Tue, 2008-11-04 at 16:37 +0100, Rob Coops wrote: > On Tue, Nov 4, 2008 at 4:35 PM, Sharan Basappa <[EMAIL PROTECTED]>wrote: > > Thanks. BTW, a variable ($x = " ") instead of actual space would do, right? > > > > Yeah that should work just fine. It is better to call it $SPACE: my $SPACE = " ";

Re: substitute multiple spaces with just one

2008-11-04 Thread Mr. Shawn H. Corey
On Tue, 2008-11-04 at 16:30 +0100, Rob Coops wrote: > What you want to be doing is this: $temp =~ s/\s+/ /g; Actually to substitute multiple spaces with just one: $temp =~ s/ +/ /g; Or as some prefer: $temp =~ s{ [ ]+ }{ }gx; Or even: $temp =~ s/\x20+/\x20/g; The reason for not using the fi

Re: substitute multiple spaces with just one

2008-11-04 Thread Rob Coops
On Tue, Nov 4, 2008 at 4:35 PM, Sharan Basappa <[EMAIL PROTECTED]>wrote: > > You are completely right. :-) > > > > What you want to be doing is this: $temp =~ s/\s+/ /g; > > The reason for that is simple, \s is used to match a space or multiple > > spaces, it is not used to print a space that is a

Re: substitute multiple spaces with just one

2008-11-04 Thread Sharan Basappa
> You are completely right. :-) > > What you want to be doing is this: $temp =~ s/\s+/ /g; > The reason for that is simple, \s is used to match a space or multiple > spaces, it is not used to print a space that is actually done by the ' ' > (space). It might seem a little strange at first but just

Error compiling DBD-Oracle-1.22 with cygwin

2008-11-04 Thread james.agun
Hi, I am having problems with cygwin/dbd-oracle 1. I have installed cygwin 2. I have installed DBI-1.607 3. I am trying to compile DBD-Oracle-1.22 This is the step creating the issue --> $ perl Makefile.PL Oracle version 9.2.0.1 (9.2) OCI directory not found, please install OCI in C:/xxx/Oracle92

Re: substitute multiple spaces with just one

2008-11-04 Thread Rob Coops
On Tue, Nov 4, 2008 at 4:21 PM, Sharan Basappa <[EMAIL PROTECTED]>wrote: > Hi, > > I have string that has one or more spaces. I would like to replace > them with a single space. > The simple code below replaces the spaces fine, but does not > substitute with a space. > > $temp = "0 1 2 34";

substitute multiple spaces with just one

2008-11-04 Thread Sharan Basappa
Hi, I have string that has one or more spaces. I would like to replace them with a single space. The simple code below replaces the spaces fine, but does not substitute with a space. $temp = "0 1 2 34"; <-> version 1 $temp =~ s/\s+/\s/g; $temp = "0 1 2 34"; <-> version 2 $temp =~ s

Re: debugger exiting

2008-11-04 Thread Telemachus
On Tue Nov 04 2008 @ 4:11, Rob Dixon wrote: > > Rob Dixon wrote: > If I had things my way there would never be any use of Perl as a command-line > tool. Isn't this throwing out the baby with the bathwater? Here's a random, real, recent example of why I'm not giving up Perl on the command line. I

Re: debugger exiting

2008-11-04 Thread Sharan Basappa
> My final comment is that $temp is an awful name for a variable under almost > any > circumstances. > I do agree. More often than not, if I dont have a meaningful name for a variable it is mainly because the problem and solution are not worked out clearly in mind. -- To unsubscribe, e-mail: [EM

Re: Help with Split

2008-11-04 Thread Rob Coops
On Tue, Nov 4, 2008 at 6:12 AM, <[EMAIL PROTECTED]> wrote: > I have a string: " Confirming: yes Supplier > Telephone: 213-923-0392" > > I want to split the string so that i can capture yes in $conf and > 213-923-0392 in $tele. > > TIA for all the help, > > -ss > > > -- > To unsub

Re: Help with Split

2008-11-04 Thread Peter Scott
On Mon, 03 Nov 2008 21:12:40 -0800, sanju.shah wrote: > I have a string: " Confirming: yes Supplier > Telephone: 213-923-0392" > > I want to split the string so that i can capture yes in $conf and > 213-923-0392 in $tele. > > TIA for all the help, What have you tried so far? W

Help with Split

2008-11-04 Thread sanju . shah
I have a string: " Confirming: yes Supplier Telephone: 213-923-0392" I want to split the string so that i can capture yes in $conf and 213-923-0392 in $tele. TIA for all the help, -ss -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: Reg : Browser Back Button

2008-11-04 Thread op
Hello, On Nov 3, 12:45 pm, [EMAIL PROTECTED] (Andrew Curry) wrote: > Actually using javascript it is possible although probably not > recommended and again can not be guaranteed to work on all browsers. even with javascript you can't catch a back-button click as such. You can catch it via the unl

Re: debugger exiting

2008-11-04 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > I have said several times that the shortcut behaviour of the logical operators > is ugly and unfamilar to non-Unix users (yes, I know C does it, but that is a > deficiency) Beg your pardon??? Or maybe ... what exactly do you mean by "shortcut behaviour"? Yo