Re: DBI error

2008-07-21 Thread Amit Saxena
On Tue, Jul 22, 2008 at 9:18 AM, Panda-X <[EMAIL PROTECTED]> wrote: > Hi, > > I've got this error, anything I can do ? > > "Can't locate auto/DBI/data_source.al in @INC " > > Code : > > use DBI; > my @dataSource = DBI -> data_source ( "mysql" ) ; > > and if I change the as this : > >u

DBI error

2008-07-21 Thread Panda-X
Hi, I've got this error, anything I can do ? "Can't locate auto/DBI/data_source.al in @INC " Code : use DBI; my @dataSource = DBI -> data_source ( "mysql" ) ; and if I change the as this : use DBI; my $dbh = DBI -> connect ( "dbi:mysql", $adm, $pass ) ; I got this error :

parsing a large excel file

2008-07-21 Thread ANJAN PURKAYASTHA
to all, i have installed Spreadshee::ParseExcel to parse some large excel data files. Here is the problem I'm facing. I need to parse data from columns M to P and rows 10 to 43000. Now I know that there is a PrintArea method that can print an area of a worksheet specified in (start row, start col,

google suggest

2008-07-21 Thread Andrew.Tsvetinskiy
hI2all.I have found working script of google suggest script! but in php... could you give me working in perl? or maybe found error in my? php -- real_escape_string($_POST['queryString']) if(strlen($queryString) >0) { $query = $db->query("SELECT value FROM countries WHER

RE: OO method query

2008-07-21 Thread Thomas Bätzler
Dermot <[EMAIL PROTECTED]> asked: > I am trying my hand at creating an package and am a bit > unsure about some of the inner working of what I've done. I recommend http://books.perl.org/book/171 > Q3) In new, can I allow for the object create being done with > more argument like my $page = new

Re: regular expression to exclude a phrase

2008-07-21 Thread Rob Dixon
Octavian Rasnita wrote: > > I wanted to test something like: > > Match only if the string contains somewhere a "ab" in it but it doesn't > contain "ab" between < and >. > > For example: > > "zzz <> ttt> ab" - matches > "z ab xx" - matches > "zzz ab <>ab> tt" - doesn't match > "ab " - doesn'

Re: Strange sorting, need some help

2008-07-21 Thread Gunnar Hjalmarsson
Amit Saxena wrote: On Mon, Jul 21, 2008 at 2:11 AM, Rob Dixon <[EMAIL PROTECTED]> wrote: If you were using the <=> operator to compare non-numeric strings you would get a warning, but any scalar value is a valid string so you will get no warnings if you compare numeric values with the cmp oper

OO method query

2008-07-21 Thread Dermot
Hi, I am trying my hand at creating an package and am a bit unsure about some of the inner working of what I've done. I have a new method sub new { my $class = shift; my $self = {}; $self->{type} = undef; bless($self, $class); return $self; } I also have a 'types' hash which is outsi

Re: Strange sorting, need some help

2008-07-21 Thread Amit Saxena
On Mon, Jul 21, 2008 at 2:11 AM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Tobias Eichner wrote: > > > > I'm currently dealing with a sample program I try to understand. Here it > is: > > > > --- > > > > #!/usr/bin/perl > > > > use strict; use warnings; use diagnostics; > > > > # Array to sort > >

AW: Strange sorting, need some help

2008-07-21 Thread Tobias Eichner
@rob: Thank you for your hints :-) __ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://lear

Re: regular expression to exclude a phrase

2008-07-21 Thread Rob Coops
So building something like this in 1 regex: "zzz <> ttt> ab" - matches "z ab xx" - matches "zzz ab <>ab> tt" - doesn't match "ab " - doesn't match That took me a while to work out but it can be done: #!/usr/local/bin/perl use strict; use warnings; my @data; $data[0] = "zzz <> ttt> ab"; $data[1

Re: regular expression to exclude a phrase

2008-07-21 Thread Octavian Rasnita
From: "Rob Coops" <[EMAIL PROTECTED]> > You could simply say this: > if ( ! m/ab/ ) { > #make the world go round > } > Or assuming you are looping thru a list you could say something like: > foreach my $item ( @list ) { > next if ( $item =~ m/ab/ ); > #make the world go round > } I also had this p

Re: regular expression to exclude a phrase

2008-07-21 Thread Rob Coops
You could simply say this: if ( ! m/ab/ ) { #make the world go round } Or assuming you are looping thru a list you could say something like: foreach my $item ( @list ) { next if ( $item =~ m/ab/ ); #make the world go round } I personaly like the second one better because of the readability but

Re: regular expression to exclude a phrase

2008-07-21 Thread Dr.Ruud
zhihuali schreef: > I was wondering if there's a way to specify "not including this > phrase" in perl regexp. > Like such two strings: > axbcabcd > axbcacbd > > If I say "not including the letter a or the letter b" (=~/[^a^b]/) > then neither of them will be matched. The [^a^b] doesn't mean what

RE: Perl DBI->Connect: how to detect a a lost connection

2008-07-21 Thread Stewart Anderson
Ravi Malghan wrote: > Hi: I have a script which connects to a database when it starts up > > $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;", > "$username", "$password", {AutoCommit => 1}); > > followed by a while loop which runs a query for this connection at 60 secon

Re: Arithmetic operation inside substitution

2008-07-21 Thread Dr.Ruud
"Amit Koren" schreef: > $string="blah 10 20"; > I need to add 5 to the 10, and add 7 to the 20. #!/usr/bin/perl use strict; use warnings; my %add = ( 10 => 5, 20 => 7, ); while ( ) { s/ ( [0-9]+ ) / exists($add{$1}) ? $add{$1} : $1 /xge; print; } __D