Re: foreach and next

2012-04-09 Thread Vyacheslav
:50 AM + 4/9/12, Vyacheslav wrote: I enabled RaiserError, then script die. ... my %attr = ( PrintError => 0, RaiseError => 1 ); Use: RaiseError => 0 instead so that your script will not raise an exception and die. Then check $dbh->err. -- To unsubscribe, e-mail: beginners-unsu

Re: foreach and next

2012-04-08 Thread Vyacheslav
ct to MySQL server on 'db1' (111) at ./dbcheck.pl line 72 I test with $dbh->err, but the script all the same die. 08.04.2012 18:40, Dr.Ruud пишет: On 2012-04-08 17:10, Vyacheslav wrote: using eval helped me. You should not use exceptions for normal code flow. Read the DBI docs

Re: foreach and next

2012-04-08 Thread Vyacheslav
Thanks all. using eval helped me. 08.04.2012 09:43, Shlomi Fish пишет: Hi Vyacheslav, On Sun, 08 Apr 2012 06:12:53 + Vyacheslav wrote: Hello all. My english bad and i have a problem. I am connected to databases in a cycle foreach and the script die, if one of database is not available

foreach and next

2012-04-07 Thread Vyacheslav
Hello all. My english bad and i have a problem. I am connected to databases in a cycle foreach and the script die, if one of database is not available. #!/usr/bin/perl use strict; use warnings; use DBI; use DBD::mysql; foreach $db (&hostdb("$project")) { my $server = "$db"; my $dbname = "in

Re: perl and pattern

2012-02-22 Thread Vyacheslav
Hello there. Thank you. Deal with all 22.02.2012 05:11, John W. Krahn пишет: Shlomi Fish wrote: On Tue, 21 Feb 2012 23:47:39 +0400 Vyacheslav wrote: I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; That's good. my $

perl and pattern

2012-02-21 Thread Vyacheslav
Hello. I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; my $number = 0; my $_ = 0; print "Enter number:"; chomp($number = <>); if ( $number = /[0-9]/) { print "you number $number\n" } ./firsh.pl Enter number: 23 I thought, what print

Re: Regarding reg. exp.

2008-10-14 Thread Vyacheslav Karamov
[EMAIL PROTECTED] пишет: Because I want comma (,) exactly once -Original Message- From: Vyacheslav Karamov [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2008 4:41 PM To: Sayed, Irfan (Cognizant) Cc: [EMAIL PROTECTED]; beginners@perl.org Subject: Re: Regarding reg. exp. [EMAIL

Re: Regarding reg. exp.

2008-10-14 Thread Vyacheslav Karamov
[EMAIL PROTECTED] пишет: if ($trig_np =~ m/\d,{1}\d|\d\s{1}\d/) this what I did. Hi! Why have you used {1} quantifier? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to compare 2 xml files??

2008-10-10 Thread Vyacheslav Karamov
[EMAIL PROTECTED] пишет: hi, Like in topic. How to comapre xml_files which I create with data from database. I'm comparing table structure and need to know in which table is missing column or the data of column is wrong. In the output I want to have the full information about the difference.of t

Re: positions of matches

2008-10-09 Thread Vyacheslav Karamov
Rob Dixon пишет: Vyacheslav Karamov wrote: I've solved my problem with captures, but I don't understand how to get positions of matches: my $regex = qr { (?i) # Case-insensitive ( [\x{2022}\*]* # Any number of bullet or asterisk characters [1-9]+ # One or more digits 1-9 \s* #

Re: positions of matches

2008-10-08 Thread Vyacheslav Karamov
Rob Dixon пишет: John W. Krahn wrote: Rob Dixon wrote: Vyacheslav Karamov wrote: my @matches = $text =~ /$regex/g; foreach my $arr (@matches) { print "$arr\n" if defined $arr; } You can retrieve the start and end positions of the last successful ma

Re: positions of matches

2008-10-08 Thread Vyacheslav Karamov
Vyacheslav Karamov пишет: Rob Dixon пишет: John W. Krahn wrote: Rob Dixon wrote: Vyacheslav Karamov wrote: my @matches = $text =~ /$regex/g; foreach my $arr (@matches) { print "$arr\n" if defined $arr; } You can retrieve the start and end positions o

Perl IDE

2008-10-07 Thread Vyacheslav Karamov
Hi All! I've found interesting comparison table of Perl editors and IDE http://www.perlmonks.org/?node=Perl%20Development%20Tools -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

help with regexp

2008-10-06 Thread Vyacheslav Karamov
Hi All! I need to capture cite numbers, but I have an extra values. I need to capture cites, not figures, chapters and so on. For example in "[see 9; Figure 7]", only "9" i.e. citation number must be captured. my $regex = qr { (?i)

Re: Regexp: Correct braces

2008-10-03 Thread Vyacheslav Karamov
topic it will lead you to the other pages that hold more information about more fun things you can do with regex's. Regards, Rob On Fri, Oct 3, 2008 at 10:52 AM, Vyacheslav Karamov <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Hi All! I need to cap

Regexp: Correct braces

2008-10-03 Thread Vyacheslav Karamov
Hi All! I need to capture something in braces using regular expressions. But I don't need to capture wrong data: [Some text] - correct (Some text) - also correct [Some text) - wrong (Some text] - also wrong -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: Unicode class for ø

2008-10-03 Thread Vyacheslav Karamov
Vyacheslav Karamov пишет: Mr. Shawn H. Corey пишет: On Thu, 2008-10-02 at 17:09 +0300, Vyacheslav Karamov wrote: Vyacheslav Karamov пишет: Hi All! I making regular expression for mathching authors in some text (English, French or German). Which character class lower-case letters

Re: Unicode class for ø

2008-10-03 Thread Vyacheslav Karamov
Mr. Shawn H. Corey пишет: On Thu, 2008-10-02 at 17:09 +0300, Vyacheslav Karamov wrote: Vyacheslav Karamov пишет: Hi All! I making regular expression for mathching authors in some text (English, French or German). Which character class lower-case letters containing latin letters like

Re: Unicode class for ø

2008-10-02 Thread Vyacheslav Karamov
Vyacheslav Karamov пишет: Hi All! I making regular expression for mathching authors in some text (English, French or German). Which character class lower-case letters containing latin letters like "ø"? For example "Colding-Jørgensen" Sorry, I need an upper-case too.

Unicode class for ø

2008-10-02 Thread Vyacheslav Karamov
Hi All! I making regular expression for mathching authors in some text (English, French or German). Which character class lower-case letters containing latin letters like "ø"? For example "Colding-Jørgensen" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: Passing "class" objects to a function

2008-09-30 Thread Vyacheslav Karamov
Mr. Shawn H. Corey пишет: On Tue, 2008-09-30 at 17:30 +0300, Vyacheslav Karamov wrote: Hi All! I need to pass object to a function. How can I do it? How to make this code work? use Tree::Simple; sub SomeFunc { my $node = @_; foreach my $child ($node->getAllChild

Passing "class" objects to a function

2008-09-30 Thread Vyacheslav Karamov
Hi All! I need to pass object to a function. How can I do it? How to make this code work? use Tree::Simple; sub SomeFunc { my $node = @_; foreach my $child ($node->getAllChildren() ) { ... } } my $tree = Tree::Simple->new("tree", Tree::Simple->ROOT); SomeFunc( $tree ); -

Re: Non standard entity conversion

2008-09-29 Thread Vyacheslav Karamov
V.Ramkumar wrote: Hi List, I am doing entity conversion decimal entity (input xml) 2 named entity(output xml) in perl using HTML::Entities::Numbered. But it's not returning named entity for some decimal entities. If any body have idea to avoid the below issue, please share with me. Ex: Coding.

Making tree in perl

2008-09-29 Thread Vyacheslav Karamov
Hi All! I'm parsing XML with XMPL::Parser::Expat and I need to build XML tree. Ho to make fast and robust one? I could use Tree::Simple CPAN module, but I have very restrictive performance requirements. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: Hash sort order

2008-09-29 Thread Vyacheslav Karamov
Rob Dixon пишет: Vyacheslav Karamov wrote: Are you sure you shouldn't just be using HTML::TreeBuilder? Rob Yes I'm sure because: 1) I need to parse XML, not HTML 2) I have to use XML::Parser::Expat cause it is required that my program will work as fast as possible. So, I t

Re: Hash sort order

2008-09-26 Thread Vyacheslav Karamov
Jeff Pang пишет: 2008/9/26 Vyacheslav Karamov <[EMAIL PROTECTED]>: %attrs = shift if @_ > 2; I doubt this can work correctly. You may need: %attrs = @_; # get the leftover arguments as hash's keys/values or, %attrs = %{+shift}; # get the third argument w

Hash sort order

2008-09-26 Thread Vyacheslav Karamov
Hi All! I'm parsing XML using XML::Parser::Expat ... $self->{parser}->setHandlers( Start=>\&OnStartElement, End=>\&OnEndElement, Char=>\&OnCharacters); ... sub OnStartElement { my $parser = shift; my $el

Re: Need struct

2008-09-25 Thread Vyacheslav Karamov
Paolo Gianrossi пишет: On Thu, 2008-09-25 at 13:00 +0300, Vyacheslav Karamov wrote: Paolo Gianrossi пишет: On Thu, 2008-09-25 at 12:03 +0300, Vyacheslav Karamov wrote: Hi All! I need to parse XML with XML::Parser::Expat and make XML tree with Tree::Simple. But I need to

Re: Need struct

2008-09-25 Thread Vyacheslav Karamov
Paolo Gianrossi пишет: On Thu, 2008-09-25 at 12:03 +0300, Vyacheslav Karamov wrote: Hi All! I need to parse XML with XML::Parser::Expat and make XML tree with Tree::Simple. But I need to store tag value and its attributes. But Tree::Simple->setNodeValue() accepts single scalar (va

Re: Need struct

2008-09-25 Thread Vyacheslav Karamov
Vyacheslav Karamov пишет: Hi All! I need to parse XML with XML::Parser::Expat and make XML tree with Tree::Simple. But I need to store tag value and its attributes. But Tree::Simple->setNodeValue() accepts single scalar (value itself). How to create something like this? struct { $va

Need struct

2008-09-25 Thread Vyacheslav Karamov
Hi All! I need to parse XML with XML::Parser::Expat and make XML tree with Tree::Simple. But I need to store tag value and its attributes. But Tree::Simple->setNodeValue() accepts single scalar (value itself). How to create something like this? struct { $value; %attributes; } $nodeValue

Parsing XML with HTML entities

2008-09-23 Thread Vyacheslav Karamov
Hi All! I need to parse XML file which contain HTML entities like ø I'm using XML::Parser::Expat, but it stops processing when finds such entity. How could I handle this? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.or

Re: Replace ISO entities

2008-09-23 Thread Vyacheslav Karamov
Vyacheslav Karamov пишет: Jeff Pang пишет: 2008/9/22 Vyacheslav Karamov <[EMAIL PROTECTED]>: Hi All! Jow to replace ISO entities (like "é") or four-character Unicode entities (like "Ǖ") with Unicode characters? use Encode; see perldoc Encode, which

Re: Replace ISO entities

2008-09-23 Thread Vyacheslav Karamov
Jeff Pang пишет: 2008/9/22 Vyacheslav Karamov <[EMAIL PROTECTED]>: Hi All! Jow to replace ISO entities (like "é") or four-character Unicode entities (like "Ǖ") with Unicode characters? use Encode; see perldoc Encode, which is a built-in Perl module.

Replace ISO entities

2008-09-22 Thread Vyacheslav Karamov
Hi All! Jow to replace ISO entities (like "é") or four-character Unicode entities (like "Ǖ") with Unicode characters? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Net::SCP

2008-09-22 Thread Vyacheslav Karamov
Dermot пишет: Hi, I installed Net::SCP as I was reminded of the module in a recent post. I need to copy files from one server to another. I generated ssh-keys for a user and I can use scp test.txt myserver:/home/somedude/mytest.txt without passwords when I su to that user but when I run the

Re: activeperl

2008-09-04 Thread Vyacheslav Karamov
frazzmata пишет: I have a machine in my office without internet access. I want to download modules to install on that computer, but I Cant use ppm are there installers that dont require them to be made with some sort of dmake or nmake? of course if necessary I have visual C, so I guess I can do

XML::Parser::Expat example

2008-09-02 Thread Vyacheslav Karamov
Hi All! Could someone give me some examples how to use XML::Parser::Expat? --- WBR, Vyacheslav. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

C-style buffer?

2008-09-02 Thread Vyacheslav Karamov
Hi All! How C-style buffer could be implemented in Perl? I need to download text file into buffer, then find some text in it with regular expression, then store some text *before* the match and then search some text with regular expression again, but starting from the end of the previous match

positions of matches

2008-08-29 Thread Vyacheslav Karamov
Hi All! If I have regular expression and some text. How can I get positions of matches? my $text =

Unit testing

2008-08-22 Thread Vyacheslav Karamov
Hi All! I need to add unit tests to my project which I will start soon. I'm using latest ActivePerl in Win32 (because I have to) and I installed Test::Unit::Lite through ppm.bat. But! When I tried to run example test: #!/usr/bin/perl -w use strict; use warnings; use File::Basename; use File

Can't fork using open

2003-03-05 Thread Vyacheslav Nadvorny
exit; } =The end of the citation==== -- With best regards, Vyacheslav Nadvorny. E-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]