Do you know how to tie a hash to a disk file thus read by another process?
Currently my solution is writing the data to a JSON file and read it from the
other program.
Thank you.
[OT] maybe you want to change IDE to vi/vim since you are using Perl. :)
发件人: James Kerwin
日期: 2018年7月30日 星期一 下午9:19
至:
主题: Eclipse/Epic/PadWalker for Perl
Hi all,
I appreciate this isn't a place for the Eclipse IDE, but maybe some of you may
have an answer.
I installed Eclipse Photon, E
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 matc
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
;
}
1;
# cat test/mytest.pm <http://mytest.pm>
package mytest;
sub hello
{
print "hello\n"
}
1;
$ perl -e 'BEGIN {push @INC, "test";} use mytest; mytest::hello()'
hello
or, as Perl treats the "::" as a path denoter:
$ perl -e 'use test::myt
Hi Morning,
I have a package file in "./test" dir.
$ 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/
yes I also found a more direct way,
use Image::Resize;
$image = Image::Resize->new('large.jpg');
$gd = $image->resize(250, 250);
thanks for everyone.
On 2018/7/25 星期三 PM 1:51, Илья Рассадин wrote:
You can resize image with Perl. For example, Imager library can do the
thing. See
https://metacp
to do the work:
system "convert lauren.jpg -resize 300x300 lauren.jpg"
But I think it's not good, since as you said, a shell is always being
called.
How to write it with pure perl way?
regards.
On 2018/7/24 星期二 PM 11:31, Uri Guttman wrote:
On 07/24/2018 08:35 AM, Lauren C. wrot
Hi,
$ perl -le 'system "df -h"'
$ perl -le 'system "df","-h"'
The both two styles work fine.
what's the difference between them and which is better usage?
thanks.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.pe
I think reading the official tutorial from begin is not that comfortable
to a newbie. I bought a book "Learning Perl, 6th Edition" for studying
step by step. thanks.
On 2018/7/18 星期三 AM 9:08, Uri Guttman wrote:
also i always recommend reading the entire perl FAQ as there are many
regex tips a
I did read them, but got no deep impression unless I met the issue. :)
Uri Guttman 写道:
On 07/17/2018 08:46 PM, Lauren C. wrote:
Thanks Gil. I think i know the difference of "\w+" and "\w*" now.
lauren, did you read the perlretut document? if not, you should. it
covers
nchored ("^" - zero-width "at the beginning of the string"
must be at the begining of the RE) your RE would fail too:
$ perl -le '$x="/path/"; print 1 if $x=~m{^path/}'
because the RE starts w/ "p" and the $x starts with slash.
On Tue, Jul 17
Thanks Gil. I think i know the difference of "\w+" and "\w*" now.
Gil Magno 写道:
2018-07-17 19:56:59 +0800 Lauren C.:
Hello,
I want to match:
/path/
/path/123
/path/abc
but /path/?xxx should not be matched.
This works:
$ perl -le '$x="/path/abc"; p
Hello,
I want to match:
/path/
/path/123
/path/abc
but /path/?xxx should not be matched.
This works:
$ perl -le '$x="/path/abc"; print 1 if $x=~m{path/\w+}'
1
this works too:
$ perl -le '$x="/path/?abc"; print 1 if $x=~m{path/\w+}'
But it doesn't work for this case:
$ perl -le '$x="/pa
Hi Uri,
I was reading this page:
https://www.rexegg.com/regex-lookarounds.html
the content of "Mastering Lookahead and Lookbehind" make me confused.
(?=foo)
(?<=foo)
(?!foo)
(?but seriously, regexes are a key feature in perl and most modern
languages. it is hard to do any text or data processi
07-12 at 19:35 +0800, Lauren C. wrote:
My web is powered by Apache and PHP,its access log seems as blow,
xx.xx.xx.xx - - [12/Jul/2018:19:29:43 +0800] "GET
/2018/07/06/antique-internet/ HTTP/1.1" 200 5489 "https://miscnote.ne
t/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_1
OK I see, thanks Gil.
I think the main problem is I don't know much about regex.
I will re-learn them this day.
On 2018/7/12 星期四 PM 10:02, Gil Magno wrote:
2018-07-12 20:50:22 +0800 Lauren C.:
thanks for the kind helps.
do you know what the expression in { } stands for?
^(\S+) - -
Thanks Jim. that explains clearly.
On 2018/7/12 星期四 PM 10:00, Jim Gibson wrote:
On Jul 12, 2018, at 5:50 AM, Lauren C. wrote:
thanks for the kind helps.
do you know what the expression in { } stands for?
^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+
Here is a breakdown:
^
thanks for the kind helps.
do you know what the expression in { } stands for?
^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+
On 2018/7/12 星期四 PM 8:37, Илья Рассадин wrote:
"m{ pattern }" is regular expression to parse log string.
It's equal to just "/ pattern /". Using different delimiter is
conven
thanks Magno. i will check it.
On 2018/7/12 星期四 PM 8:13, Gil Magno wrote:
Hi, Lauren
The m{...} is a regular expression (regexp). If you not familiar with
regexps in Perl, I advise you to read these pages:
-http://perldoc.perl.org/perlintro.html#Regular-expressions
-http://perldoc.perl.org/per
Hello,
My web is powered by Apache and PHP,its access log seems as blow,
xx.xx.xx.xx - - [12/Jul/2018:19:29:43 +0800] "GET
/2018/07/06/antique-internet/ HTTP/1.1" 200 5489 "https://miscnote.net/";
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/6
21 matches
Mail list logo