Re: regex matches Chinese characters

2018-07-26 Thread Shlomi Fish
Hi Lauren, On Fri, 27 Jul 2018 11:28:42 +0800 "Lauren C." wrote: > greetings, > > I was doing the log statistics stuff using perl. > There are chinese characters in log items. > I tried with regex to match them, but got no luck. > > $ perl -mstrict -le 'my $char="汉语"; print "it is chinese" if

Re: regex matches Chinese characters

2018-07-26 Thread Lauren C.
oops that's perfect. thanks Shlomi. On 2018/7/27 星期五 PM 1:26, Shlomi Fish wrote: Hi Lauren, On Fri, 27 Jul 2018 11:28:42 +0800 "Lauren C." wrote: greetings, I was doing the log statistics stuff using perl. There are chinese characters in log items. I tried with regex to match them, but got

regex matches Chinese characters

2018-07-26 Thread Lauren C.
greetings, I was doing the log statistics stuff using perl. There are chinese characters in log items. I tried with regex to match them, but got no luck. $ perl -mstrict -le 'my $char="汉语"; print "it is chinese" if $char =~ /\p{Han}+/' $ perl -mstrict -mutf8 -le 'my $char="汉语"; print "it is

Re: confidence under BEGIN{}

2018-07-26 Thread Kent Fredric
On 27 July 2018 at 05:21, Andy Bach wrote: > > or, as Perl treats the "::" as a path denoter: > $ perl -e 'use test::mytest; mytest::hello()' > hello > > or: > $ perl -mtest::mytest -e 'mytest::hello()' > hello > > find ./test/mytest.pm via @INC's "." Note: neither of those examples work on Perl

Re: confidence under BEGIN{}

2018-07-26 Thread Lauren C.
Thanks Andy. there is another member on this list pointed me a more graceful way, use lib '/path/..'; Thus I don't need to remember special variables like @INC etc. Thanks anyway for kind helps. On 2018/7/27 星期五 AM 1:21, Andy Bach wrote: $ ls test/ mytest.pm > I try to

Re: confidence under BEGIN{}

2018-07-26 Thread Andy Bach
$ ls test/ mytest.pm > I try to include it but got failed. $ perl -le 'use mytest' Can't locate mytest.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .)