deal with string

2008-09-25 Thread org chen
Hi, There is an string, if each letter in the string is not belong to [a-z][A-Z][0-9], I want to change it to "+". eg. my $str = "3ijZ()a";if($str !~ /[a-z][A-Z][0-9]/){add code here}print $str; #output will be: 3ijZ++a please help me complete this code. Thanks org _

deal with string

2008-09-25 Thread org chen
Hi, There is an string, if each letter in the string is not belong to [a-z][A-Z][0-9], I want to change it to "+". eg. my $str = "3ijZ()a";if($str !~ /[a-z][A-Z][0-9]/){add code here}print $str; #output will be: 3ijZ++a please help me complete this code. Thanksorg

Re: How to catch error message instead of printing to stderr for rmtree

2008-09-25 Thread Yue Chen
Hi Thank you for the feedback. But I don't see any difference between my script and CPAN's documentation. Actually, I do follow it to write my script. > > > On Fri, Sep 26, 2008 at 12:17 AM, Yue Chen <[EMAIL PROTECTED]> wrote: >> >> Hi >> >> I want to use rmtree to delete a dir and use variables

Re: How to catch error message instead of printing to stderr for rmtree

2008-09-25 Thread Li, Jialin
On Fri, Sep 26, 2008 at 12:17 AM, Yue Chen <[EMAIL PROTECTED]> wrote: > Hi > > I want to use rmtree to delete a dir and use variables to catch the > error message. However, when i am about to delete a dir that does not > belong to me, it still print the error message to stderr. Does anyone > have

How to catch error message instead of printing to stderr for rmtree

2008-09-25 Thread Yue Chen
Hi I want to use rmtree to delete a dir and use variables to catch the error message. However, when i am about to delete a dir that does not belong to me, it still print the error message to stderr. Does anyone have clue? my script: test.pl use File::Path; File::Path::rmtree( '/root', {error =>

Re: send die "" to a file

2008-09-25 Thread Li, Jialin
On Thu, Sep 25, 2008 at 11:55 PM, aa aa <[EMAIL PROTECTED]> wrote: > > Hi, > > I try to open several files, if one of them failed, my program will die and > then send the died information to a file. > > eg. > open(AA, "a.txt") or die "can't open file a.txt\n"; > > But I want to this string "can't

send die "" to a file

2008-09-25 Thread aa aa
Hi, I try to open several files, if one of them failed, my program will die and then send the died information to a file. eg. open(AA, "a.txt") or die "can't open file a.txt\n"; But I want to this string "can't open file a.txt\n" print to a file. Is anyone can help me? org.chen _

Re: regex count

2008-09-25 Thread Stephen Reese
> I don't understand why you're /adding/ the match count $x to the hash value > each > time. Is that why you're getting values that you don't expect? > > If the first column of your output is supposed to be a count (for that source > address, connection, or port) then you should be adding one each

Re: regex count

2008-09-25 Thread Rob Dixon
Stephen Reese wrote: > John W. Krahn wrote: >> >> Have a look at the sample data you posted and you will see where. > > I believe I found where the ']' needs to go but didn't see any extra ' ' > space. > > The $x count seems off. As I see it every time a regex match is made then $x > will increas

Re: regex count

2008-09-25 Thread Stephen Reese
> I don't see where you're printing $x to check. Jay, I probably was not and do not know how to :-). > Assuming you have actually checked $x, though, the important question > isn't whether $x == `grep -c regex /your/log/file`. > > The important question is whether $x == scalar keys %srca. > > If

Re: regex count

2008-09-25 Thread Jay Savage
On Wed, Sep 24, 2008 at 10:55 PM, Stephen Reese <[EMAIL PROTECTED]> wrote: >> Have a look at the sample data you posted and you will see where. >> >> >> John > > I believe I found where the ']' needs to go but didn't see any extra ' ' > space. > > The $x count seems off. As I see it every time a re

Re: Will LINQ be ported to Perl

2008-09-25 Thread Jenda Krynicky
From: hrishy <[EMAIL PROTECTED]> > Will Microsoft LINQ be ported to perl. > > regards > Hrishy Why? I'm not through the examples but so far I did not find anything you can't do just as or even more easily in Perl for years. Jenda = [EMAIL PROTECTED] === http://Jenda.Kryni

Re: Need struct

2008-09-25 Thread Jenda Krynicky
From: Vyacheslav Karamov <[EMAIL PROTECTED]> > 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? > >

Re: Need struct

2008-09-25 Thread Paolo Gianrossi
On Thu, 2008-09-25 at 14:14 +0300, Vyacheslav Karamov wrote: > 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!

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 sto

Re: Need struct

2008-09-25 Thread 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 store tag va

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 (value itsel

Re: Need struct

2008-09-25 Thread 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 (value itself). > How to crea

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 { $value;

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