Re: deal with string

2008-09-26 Thread Rob Dixon
org chen wrote: > > 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 $str

any errors in this perl module?

2008-09-26 Thread Manasi Bopardikar
Hi, Just wanted to show you a small piece of code I have written.Are there any apparent issues here? package TWiki::Plugins::DumbPlugin; use strict; use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $debug $pluginName $NO_PREFS_IN_TOPIC ); $VERSION = '0.1'; $RELEASE = '0.1'; $SHORTDESCR

RE: send die "" to a file

2008-09-26 Thread Stewart Anderson
> -Original Message- > From: Li, Jialin [mailto:[EMAIL PROTECTED] > Sent: 26 September 2008 06:16 > To: aa aa > Cc: beginners@perl.org > Subject: Re: send die "" to a file > > On Thu, Sep 25, 2008 at 11:55 PM, aa aa <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > I try to open several fi

Re: any errors in this perl module?

2008-09-26 Thread Amit Saxena
On Fri, Sep 26, 2008 at 2:26 PM, Manasi Bopardikar < [EMAIL PROTECTED]> wrote: > Hi, > > Just wanted to show you a small piece of code I have written.Are there > any apparent issues here? > > > > package TWiki::Plugins::DumbPlugin; > > use strict; > > use vars qw( $VERSION $RELEASE $SHORTDESCRIP

Re: send die "" to a file

2008-09-26 Thread Randal L. Schwartz
> "aa" == aa aa <[EMAIL PROTECTED]> writes: aa> Hi, aa> I try to open several files, if one of them failed, my program will die and then send the died information to a file. aa> eg. aa> open(AA, "a.txt") or die "can't open file a.txt\n"; aa> But I want to this string "can't open file

Re: send die "" to a file

2008-09-26 Thread Jeff Pang
2008/9/26 aa aa <[EMAIL PROTECTED]>: > > 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

Re: any errors in this perl module?

2008-09-26 Thread Jeff Pang
2008/9/26 Manasi Bopardikar <[EMAIL PROTECTED]>: > Hi, > > Just wanted to show you a small piece of code I have written.Are there > any apparent issues here? > Just my thought: You have neither a new method nor any exported subroutines. It's not convenient for the caller to run those routines.

How to create a timezone converter application in Perl !

2008-09-26 Thread Amit Saxena
Hi all, Recently I came across a scenario where I need to convert the time from one timezone to another. Though that time, I used few websites for the same but I want to know how to do the same in Perl. The text below will give the kind of input & output my program requires. Basically I want th

Re: How to create a timezone converter application in Perl !

2008-09-26 Thread Rob Dixon
Amit Saxena wrote: > > Recently I came across a scenario where I need to convert the time from one > timezone to another. > > Though that time, I used few websites for the same but I want to know how to > do the same in Perl. > > The text below will give the kind of input & output my program req

Re: How to create a timezone converter application in Perl !

2008-09-26 Thread Amit Saxena
On Fri, Sep 26, 2008 at 7:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Amit Saxena wrote: > > > > Recently I came across a scenario where I need to convert the time from > one > > timezone to another. > > > > Though that time, I used few websites for the same but I want to know how > to > > do th

RE: How to create a timezone converter application in Perl !

2008-09-26 Thread Thomas Bätzler
Amit Saxena <[EMAIL PROTECTED]> asked: > Recently I came across a scenario where I need to convert the > time from one timezone to another. > > Though that time, I used few websites for the same but I want > to know how to do the same in Perl. See http://search.cpan.org/~drolsky/DateTime-0.4304

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: Hash sort order

2008-09-26 Thread 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 which is a hash reference > But how could

FW by [EMAIL PROTECTED] : Undelivered Mail Returned to Sender

2008-09-26 Thread Michelle Konzack
Becaue I am on GSM and sometimes spamed (mean my server is realy busy) the Mailinglist setup sucks in all directions... And since I get per day between 500 and 1 MAILER-DAEMON messages I have found this message accidently in the spamfolder. - Forwarded message from Mail Delivery Syste

Re: Hash sort order

2008-09-26 Thread Mr. Shawn H. Corey
On Fri, 2008-09-26 at 18:02 +0300, Vyacheslav Karamov wrote: > Hi All! > > I'm parsing XML using XML::Parser::Expat > > ... > $self->{parser}->setHandlers( > Start=>\&OnStartElement, > End=>\&OnEndElement, > C

Non standard entity conversion

2008-09-26 Thread V.Ramkumar
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. use HTML::Entities::

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 which is a hash

Re: Hash sort order

2008-09-26 Thread Mr. Shawn H. Corey
On Fri, 2008-09-26 at 18:49 +0300, Vyacheslav Karamov wrote: > But if subroutine has only 2 parameters (i.e. tag has no attributes) > > %attrs = @_; > > gives the warning. > It doesn't on my machine. Try: my %attrs = @_ || (); -- Just my 0.0002 million dollars worth, Shawn Linux is

Re: Hash sort order

2008-09-26 Thread Jenda Krynicky
From: Vyacheslav Karamov <[EMAIL PROTECTED]> > I'm parsing XML using XML::Parser::Expat > > ... > $self->{parser}->setHandlers( > Start=>\&OnStartElement, > End=>\&OnEndElement, > Char=>\&OnCharacters); > > ..

Learning process How? & Why?

2008-09-26 Thread Jack Gates
These first four lines are how every Perl script I write starts. #!/usr/bin/perl -T use strict; use warnings; use diagnostics -verbose; my ($oldfile) = $ARGV[0] =~ /^([-a-zA-Z0-9._\/]+)$/; die "bad old filename" unless $oldfile; my ($newfile) = $ARGV[1] =~ /^([-a-zA-Z0-9._\/]+)$/; die "bad new f

Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
s!(<|)!$1\L$2\E!g; or s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; The RE above captures and replaces all HTML tags with lowercase as desired except for any tag that has only one letter such as , or It will get the , and It properly ignores the tag What is the correct way to write the above RE

Re: Hash sort order

2008-09-26 Thread Rob Dixon
Vyacheslav Karamov wrote: > > I'm parsing XML using XML::Parser::Expat > > ... > $self->{parser}->setHandlers( > Start=>\&OnStartElement, > End=>\&OnEndElement, > Char=>\&OnCharacters); > > ... > sub OnStartE

Re: Learning process How? & Why?

2008-09-26 Thread John W. Krahn
Jack Gates wrote: These first four lines are how every Perl script I write starts. #!/usr/bin/perl -T use strict; use warnings; use diagnostics -verbose; my ($oldfile) = $ARGV[0] =~ /^([-a-zA-Z0-9._\/]+)$/; die "bad old filename" unless $oldfile; my ($newfile) = $ARGV[1] =~ /^([-a-zA-Z0-9._\/]

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Rob Dixon
Jack Gates wrote: > > s!(<|)!$1\L$2\E!g; > or > s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > > The RE above captures and replaces all HTML tags with lowercase as > desired except for any tag that has only one letter such as , > or > > It will get the , and > > It properly ignores the tag > >

Re: Help understanding why the RE does not totally work

2008-09-26 Thread John W. Krahn
Jack Gates wrote: s!(<|)!$1\L$2\E!g; or s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; The RE above captures and replaces all HTML tags with lowercase as desired except for any tag that has only one letter such as , or It will get the , and It properly ignores the tag What is the correct way

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 01:20:29 pm Rob Dixon wrote: > Jack Gates wrote: > > s!(<|)!$1\L$2\E!g; > > or > > s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > > > > The RE above captures and replaces all HTML tags with lowercase > > as desired except for any tag that has only one letter such as > > , or

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 01:23:23 pm John W. Krahn wrote: > Jack Gates wrote: > > s!(<|)!$1\L$2\E!g; > > or > > s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > > > > The RE above captures and replaces all HTML tags with lowercase > > as desired except for any tag that has only one letter such as > > ,

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 12:48:14 pm Jack Gates wrote: > s!(<|)!$1\L$2\E!g; > or > s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > > The RE above captures and replaces all HTML tags with lowercase > as desired except for any tag that has only one letter such as > , or > > It will get the , and > >

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Rob Dixon
Jack Gates wrote: > On Friday 26 September 2008 01:20:29 pm Rob Dixon wrote: >> Jack Gates wrote: >>> s!(<|)!$1\L$2\E!g; >>> or >>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; >>> >>> The RE above captures and replaces all HTML tags with lowercase >>> as desired except for any tag that has only one lett

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Rob Dixon
Jack Gates wrote: > On Friday 26 September 2008 01:23:23 pm John W. Krahn wrote: >> Jack Gates wrote: >>> s!(<|)!$1\L$2\E!g; >>> or >>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; >>> >>> The RE above captures and replaces all HTML tags with lowercase >>> as desired except for any tag that has only one

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 02:52:45 pm Rob Dixon wrote: > Jack Gates wrote: > > On Friday 26 September 2008 01:20:29 pm Rob Dixon wrote: > >> Jack Gates wrote: > >>> s!(<|)!$1\L$2\E!g; > >>> or > >>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > >>> > >>> The RE above captures and replaces all HTML tag

Re: Help understanding why the RE does not totally work

2008-09-26 Thread John W. Krahn
Rob Dixon wrote: Jack Gates wrote: s!(<|)!$1\L$2\E!g; or s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; The RE above captures and replaces all HTML tags with lowercase as desired except for any tag that has only one letter such as , or It will get the , and It properly ignores the tag What i

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 03:00:15 pm Rob Dixon wrote: > Jack Gates wrote: > > On Friday 26 September 2008 01:23:23 pm John W. Krahn wrote: > >> Jack Gates wrote: > >>> s!(<|)!$1\L$2\E!g; > >>> or > >>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > >>> > >>> The RE above captures and replaces all HTML

Re: Help understanding why the RE does not totally work

2008-09-26 Thread John W. Krahn
Jack Gates wrote: On Friday 26 September 2008 12:48:14 pm Jack Gates wrote: s!(<|)!$1\L$2\E!g; or s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; The RE above captures and replaces all HTML tags with lowercase as desired except for any tag that has only one letter such as , or It will get the , and

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Rob Dixon
Jack Gates wrote: > On Friday 26 September 2008 02:52:45 pm Rob Dixon wrote: >> Jack Gates wrote: >>> On Friday 26 September 2008 01:20:29 pm Rob Dixon wrote: Jack Gates wrote: > s!(<|)!$1\L$2\E!g; > or > s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > > The RE above captures and

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Rob Dixon
John W. Krahn wrote: > Rob Dixon wrote: >> Jack Gates wrote: >>> s!(<|)!$1\L$2\E!g; >>> or >>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; >>> >>> The RE above captures and replaces all HTML tags with lowercase as >>> desired except for any tag that has only one letter such as , >>> or >>> >>> It wi

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 03:11:48 pm Rob Dixon wrote: > That's fine, I shall stop trying to help you altogether. You are > very rude and don't want to accept correction. > > Rob You are the rude one. You don't read what is written and you ignore simple requests that are in plain sight. Becaus

Re: Help understanding why the RE does not totally work

2008-09-26 Thread Jack Gates
On Friday 26 September 2008 03:12:12 pm John W. Krahn wrote: > Jack Gates wrote: > > On Friday 26 September 2008 12:48:14 pm Jack Gates wrote: > >> s!(<|)!$1\L$2\E!g; > >> or > >> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; > >> > >> The RE above captures and replaces all HTML tags with > >> lowercase a

Re: Non standard entity conversion

2008-09-26 Thread Sandy lone
That was somewhat strange. For better solution you may ask to this module's author. On Fri, Sep 26, 2008 at 9:46 PM, V.Ramkumar <[EMAIL PROTECTED]> wrote: > > Tool output: > Ḥ Ḥ >     > > Expected output: > Ḥ &Hdb; >     > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm