perl-Please read Note from the founder Kazuhiro Osawa Yappo users.jp
30 November, 18:04, by Yappo, machine translated from Japanese
Worldwide Perl Blogging
Totally
311 feeds,
9627 posts.
30 November, 18:04, by Yappo, machine translated from Japanese
30 November, 02:28, by Daisuke Maki, machine translated from Japanese
28 November, 19:47, by tokuhirom, machine translated from Japanese
Came this year. The season of Advent Calendar!
Technical people about the advent calendar does not need to explain anymore I do not I?
If people do not know if I wrote an entry in 2008 Okureyo read!
Apparently present, as there are five tracks this year! A cover!
I do and I want other people if apiece! Who JPerl Advent Calendar now, people lack the dives, this remains as dangerous! What Kanji so, I have to create more and more chat!
It may be registered in more than one track! Perl, regardless of the worst I can! Acme also:: Oppai sexual harassment because it is forbidden!
Nice to meet you!
Hungry!
25 November, 10:06, by tokuhirom, machine translated from Japanese
Sometimes I hear that you are unfamiliar with the story writing plug Amon2, I would like to explain that strange.
Basically, just plug-in is a Perl module, not a problem according to the terms of a single. Is that it has a class method called 'init'. That's it.
package MyPlugin;
sub init {
}
1;
This is valid for one plug.
Well, There is no use making a plug-in so it does nothing, try adding a little feature.
package MyPlugin;
sub init {
my ($ class, $ context) = @ _;
$ Context-> add_trigger (
AFTER_DISPATCH => sub {
my ($ self, $ res) = @ _;
$ Res-> header ('X-Framework' => "Amon2 / $ Amon2:: VERSION");
}
);
}
1;
This is a fine plugin. Is as simple as tapping the trigger AFTER_DISPATCH.
If Hayashitai or method is as follows: do I.
package MyApp:: Plugin:: Web:: BrowserDetect;
use HTTP:: BrowserDetect;
use Amon2:: Util;
sub init {
my ($ class, $ c, $ conf) = @ _;
Amon2:: Util:: add_method (
$ C,
'Browser',
sub {
$ _ [0] -> {browser} | | = HTTP:: BrowserDetect-> new (
$ _ [0] -> req-> env-> {'HTTP_USER_AGENT'}
);
}
);
}
1;
In addition, the third argument of the init is hashref that can be passed as follows.
__PACKAGE__-> Load_plugin ('+ MyApp:: Plugin:: Web:: BrowserDetect', + {configuration => 'Here'});
And oh, what's it. Just plug-in, so come and simple configuration hashref containing the name of the context class, then please enjoy the value of meta-programming perl, and making it simple.
As for plug-ins, and I think I do not publish to CPAN Once you have more and more viable in general (I have received better reviews from such PrePAN).
Unlike a plug-in Agen Catalyst! Say it solved.
21 November, 07:04, by tokuhirom, machine translated from Japanese
After all, "It is not an implementation of such come now!" "It is not an interface such!" The bottom line even as we Tteiu "Do we need this module because" There are many modules that have not been described at Tteiu.
The integral above all, "I need a module that situation why" "What would be useful if the mean and use this module," "superior to existing modules are something" good to describe the place and.
In particular, "superior to the existing module" is important, and from overseas Perl Mongers it does not describe "Nantoka it: I can do Kantoka" full of comments about or like. Take from the country.
I thought crap.
20 November, 19:00, by tokuhirom, machine translated from Japanese
But over time I Oita from the previous tutorial in creating the application's start with Amon2 + Teng abruptly larger. The Teng of the types of libraries, called O / R Mapper, is to give easy access to the DB.
Well, start by preparing well anyway.
As already contain cpanm,
% Cpanm Amon2 Amon2:: Setup:: Flavor:: Teng Teng
Install in Amon2.
% Amon2-setup.pl - flavor = Large, Teng MyBBS
Because you've got skeletons
% Cd MyBBS
As, enter the directory for the project.
% Cpanm - installdeps.
If you are installing the module dependency.
% Plackup app.psgi-R lib
Ice as part starts the server process.
When you access the browser, making it look like the home page.
For now, let's create a simple board. The ideal in the door.
Since the front page template tmpl / pc / index.tt, 書換Emashou Gossori it first.
You will gain if I'll like this anyway. View the form in the upper part, near the bottom to show what was actually posted.
[% WRAPPER 'include / layout.tt'%]
<form method="post" action="/entry/create">
<fieldset>
<div> <textarea name="body"> </ textarea> </ div>
<div> <input type="submit" value="Post New Entry" class="btn primary" /> </ div>
</ Fieldset>
</ Form>
[% END%]
Now save the contents of the database in this forum. This time is made by using a Teng O / R Mapper. Because the database uses mysql, open the sql / mysql.sql, you may want to write as follows.
CREATE TABLE IF NOT EXISTS sessions (
id CHAR (72) PRIMARY KEY,
session_data TEXT
);
CREATE TABLE IF NOT EXISTS entry (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
body VARCHAR (255)
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
I think the first table from the beginning that Kakare.
Let's configure the mysql database subsequently.
mysqladmin-uroot create mybbs
Creates a database named on the command line mybbs depression and so on. If you set a password, please perform a setting such as at any time.
mysql-uroot mybbs <sql / mysql.sql
Keep the schema as an in-depth.
Writes to the database connection settings in the config / development.pl. This file is the configuration file, so just a perl script, write the logic to love. What can safely Once you have the last to return a hash reference. Configuration file is determined by the environment variables, config / $ ENV {PLACK_ENV}. Is a file named pl. The default is set to development.
Please try to set something like this:.
+}
'DBI' => [
"Dbi: mysql: database = mybbs",
'Root',
''
{Mysql_enable_utf8 => 1}
]
};
Now, as people are set in the finished now, let's write the code finally.
"Lib / MyBBS / PC / C / Entry.pm" to open the file, write as follows.
package MyBBS:: PC:: C:: Entry;
use strict;
use warnings;
use utf8;
sub create {
my ($ class, $ c) = @ _;
if (my $ body = $ c-> request-> param ('body')) {
$ C-> db-> insert (
'Entry' => {
body => $ body,
}
);
}
return $ c-> redirect ('/');
}
1;
This time MyBBS:: PC:: C:: Entry:: From I defined a method called create, this method is mapped to the URL / entry / create. Methods defined in this manner, when using the Large Flavor that is meant to be automatically mapped to the URL. For the implementation of this area, please look at the lib / MyBBS / Web / Dispatcher.pm. Also, what is the method which maps to the URL, you can check messages when you start plackup.
Let's look at the contents in finer. $ C before but also have a context object. This object MyBBS:: is an instance of the Web, MyBBS:: Web is a child class of MyBBS.pm. About this operation is done through an object.
$ C-> request is an object representing an HTTP request. Used when dealing with information regarding the HTTP request. This method Amon2:: Web:: Returns the instance of the Request. When called to see the contents of the HTTP request. Here the value of the parameter to get the 'body'. $ C-> request from a method frequently used, $ c-> abbreviations are also provided that the req. Amon2:: Web:: Request is Plack:: Because the child class Request, if you find information on available methods for this class Plack:: and you should read the documentation for the Request.
$ C-> db method returns an instance of Teng. This is a feature of the method has been Amon2 solid writing in lib / MyBBS.pm without. Concerning operations in the database is done through this MyBBS basically.
$ C-> db-> insert method is a method to issue an INSERT statement in SQL.
INSERT INTO entry (body) VALUES ('hogehoge');
Such a query is issued for.
$ C-> Amon2 and methods referred to redirect ('/'):: Web:: Response object is generated. Amon2 world, the controller is all Amon2:: Web:: Response (Plack:: Response) has to return an instance. Just received the request sends a response. That in this case
302 Moved Permanently Location: http://localhost:5000/
Will generate a response like.
Now, type in the past can now be
18 November, 08:02, by Daisuke Maki, machine translated from Japanese
14 November, 10:00, by tokuhirom, machine translated from Japanese
The prediction that will come under more and more people use the carton, and reduce dependence on a change. Amon2:: I think the only incompatible change or become different in dist Lite. Any:: pm Narimasun to ground late in the carton and installation has been installed in the context of the Moose-Moose is faster idea to uninstall Moose (E. Feel carton also be installed in late If the default mirror " Http://Cpan.metacpan.org/ "What I think may be appropriate given the $ ENV {PERL_CARTON_MIRROR} may not be a cause.
7 November, 10:54, by tokuhirom, machine translated from Japanese
Not buy a put with a hash in perl code Berobero Given the speed, etc., it is often said that such *. po, we believe that we benefit from it because anyone can change the GUI tools like POEdit.
http://www.poedit.net/screenshots.php
For now,. Retrieved serve existing translation tools anyway if you put that big po, are easy to manage because you feel *. po.
The Hatena Nokkari the shoulders of giants.
30 October, 15:07, by ktat, machine translated from Japanese
While hoping I go, I think I was far away, I decided to go see.
I was living in the east because of Tokyo, to the venue, it took about 80 minutes. Transportation costs 780 yen. Realize the distance w in time and money
Lost that venue was easy, it's my sense of direction in the rare Ikemashita to hesitate.
Hachioji.pm to eat and drink is basically the glue that turned around that LT is a good first food and drink and chat ... or rather, the food and drink from start to finish, in the middle feeling like LT. And at first many people (my first time), and a time there was a self-referral.
LT, long ago we started from 2h.
Launch the VNC client on something iPad Yarra notebook PC, and watch how everyone did a presentation. Some people in the paper.
Looking into the presentation look Tteiu everyone is something good I.
But while eating and drinking so, What did note. Later went drinking from five o'clock yesterday, a little sleepy (per cent
LT, because they said there was a minute or two, I'm with the article as short as possible, some people were comparatively long in Freedom.
Following topics are left to the head. And I also contains a non-LT, the time series is not sure (I drank too much to eat first, but I Did not Had comparatively very drunk). Incidentally, the LT is your problem, "â â Sai thought of me today," was.
LT on me, I put below.
Web Application Testing with Scraping Framework
An example configuration file is Owakon YAML, Config:: So Any, Is Anything.
Test:: WWW:: Mechanize say What use is, well, w Please keep preaching
# What I was told old FSWiki, but I think it Kayotsu FSWiki still used.
Mr. and Ms. kyanny @ @ ytnobody, peeled documents and over (like Encode, Toka object-oriented) are told about, but ... If you look happy ... ( Http://D.hatena.ne.jp/Ktat/About # p5 I wrote).
Off, too old ....é å¼µRou ....
Anyway, Hachioji.pm are quite sociable I feel good with. I have drunk from the well æ»Rou LT, èKarou the reaction becomes positive mood that do not care
30 October, 02:15, by ZIGOROu, machine translated from Japanese
It perldoc and M- Pod:: Strip can be on.
For example,
$ Perldoc-MPod:: Strip AnyEvent
It is feeling like. Since the source was hard to read too much of the pod AnyEvent, I now easier to read.
Perhaps even better, let us know 下Saimashi know if anyone could be so simple and there is a way or.
28 October, 02:36, by ZIGOROu, machine translated from Japanese
Lion's and still very much under EV-4.03 is not like I can not install.
llvm-it's due to a bug in gcc,
$ Perl Makefile.PL CC = gcc
And could be installed as?
24 October, 11:21, by gfx, machine translated from Japanese
Since the demand is up from many, I would like to develop a Japanese language document Xslate. Japanese documents so far coherent Perl Hackers Hub not only about what I contributed to, because there is no reference said.
The goal is to align for thoroughly believes that this year.
Planned anyway: Http://Xslate.org/Ja/
21 October, 18:57, machine translated from Japanese
Now, as history had a feeling this story was put on the glue is completely evil people can not be dead weight on irc, has undertaken the day because there was no handshake meeting. On that day, or stick waving glittering things people can do something again this weight, and you'll have a bottle of tequila on stage at the auditorium of the food should be banned, we speak in front of a very elegant atmosphere submitted by. Seriously, in that Evolution is theme, you ask will be introduced in it that you work and how do Perl monger from the perspective of managers like yourself, spread the tail interested in the manager, the Perl increasingly working with Empire everybody to be happy, and soon got it yet subjected presumptuous I think I will also do good by giving back. , And convey what I say, Mr. miyagawa engineer and evolve in an interview with combat mode, trick evaluate Mr. Maki, and I gave you an example of evolution in manager mode. So far, my manager is great not think it's important to the field of engineering companies is definitely a need for both. I think that's a goal Haari manager as a career path, so I think what has to be evaluated. But the young man say to young people and students will want to experience the variety, if you're considering an extension of a manager's career further, writing a lot of code in various young , I think we should operate the system with a lot of variety. It does not always come alive when you do become experienced managers, managers with no experience in such unfamiliar and I think the opposite. And, Perl also to meet various people, I think Not necessarily good, and I would like to participate in the community rapidly. I experienced a period of three days held YAPC, The Perl community has worked across a wonderful meeting. So the resulting technology and passion, is always nice when the network manager. We think there was a meeting of the Perl community ties, and also given an opportunity like this yourself. I want young people exposed to such opportunities aggressively. I would like to thank the volunteers who prepare and JPA or great festival last time. Thank you. I ♡ Perl
Oh, the book is presented in this presentation.
20 October, 11:32, by tokuhirom, machine translated from Japanese
Module, something unexpected: It Build! Now Module::'s Build! I was feeling Tteiu, Module today: decided to use the Build.
Module:: Spending Up Spending on Build, M all modules of the past:: M from I:: he can move to the Toka B is a low annual YAPC Kwalitee and the distant future that's easy Hey I'll chatter and more it is DIS, M:: I put in the mechanism of shipit easy to check kwalitee more like B, in strange places, including the rather, re-Omoitachi previous modules and suddenly Shiteyarou packaging, did.
pmsetup - What do the upgrade, M:: Kanji you can migrate to B. . Ikanji so dull to manage MANIFEST.SKIP Ichiichi Toka Toka gitignore, it was strange to be Yoshinani. Was a nice touch. I think for some time. Yeah. Testing Toka xt /, depending on what differs from what I can say to Mendokusai was strange as well that Yoshinani.
So yeah Anyway Module:: I gradually migrate to Build. Except that guy is either Yoppodohen since it is generally 問題Na, and more.
He is still xs it finds.
18 October, 11:43, by tokuhirom, machine translated from Japanese
M:: If you talk to that I'll banquet subtle but recently I, I had felt so fine and fold conveyed something halfway. But it bullets.
has become a Owakon inc / by the presence of test_requires / configure_requires
People using the CPAN shell does not support configure_requires are getting a good age to ignore anymore. People using CPAN.pm CPAN shell, please use the latest version. Toka will not have one but can not upgrade CPAN.pm CPAN modules trying to install.
State has been already mentioned report also provides basic Toka CPAN Testers
M:: and then you also think I can do some respects the situation that drove the evolution forced by the presence of I, Module:: Nikki because some terms and conditions of stagnation and so by the Build dagolden , It is a deviant. EU:: MM or so recently released me chan mst, EU:: Janee I supposed to direct the MM! Has been or will feel it.
17 October, 12:19, by Yappo, machine translated from Japanese
17 October, 10:04, by gfx, machine translated from Japanese
YAPC:: Asia Tokyo 2011 cheers for good work!
Although I could not attend, Perl dojo had joined the air somehow I feel you were writing some of the TL tracking problems.
Looking at the response rate issues and the way Perl dojo, for example, "cpanm and" what is the surprise result of the removal or Nakattari only 50% of the percentage of questions answered correctly. If you 育Tere and to take such detailed statistics of each issue of the respondents state Toka, It is going to be more interesting. Alternatively, you can try it would be interesting to Toka Toka dojo dojo Python Ruby because it is an open-source code of the system, I think raising rewarding system.
This year we have also springs rich in a variety of topic ideas than ever. Once I do something next year, Advent Calendar and no different to a note of excitement gets cold, I think it is up to!
Anyway cheers for good work! I enjoyed!
16 October, 17:03, by Yappo, machine translated from Japanese
16 October, 13:10, by tokuhirom, machine translated from Japanese
In the perspective of the participants say, personally
A particularly interesting around.
I Suitsuerian is regrettable that many people are working away on something. Once published in the fun I think there were more people Toka reject.
Festival Goya about freely, Yamato Road, I think still is not very high ability as a banquet hall
And Kanji.
Later, Parker was no return of the first day on the road.
16 October, 08:33, by D, machine translated from Japanese
16 October, 03:08, by ZIGOROu, machine translated from Japanese
I released my first slide.
You can convert to a PDF slide projector suddenly 映Razu to know if I blame PowerPoint for Mac Hey, maybe there is a place you may not be able to maximize your ugly.
As a member of the steering this time, we have staff actually using the annual banquet and novelty stuffed Bancho.
That's what I have accumulated in the stomach as much as possible and shall utilize the lessons learned to cook is a banquet last year, I pretty I spare. . . Feeling completely run out of beer in that matter, I thought the problem was a difficult balance.活Kashitai this point I think that next year also.
The contents of the slides that I also want to supplement somewhere.
Hasten, staff members and volunteers involved in the operation of the JPA. Speaker and thank you for a nice presentation, thanks to everyone who is coming.
However, I was perfectly fine Yu Chan breath problem.
Cheers for good work.
16 October, 02:12, by ktat, machine translated from Japanese
Nevertheless, participation was only the second day. I also åºTakatta first day.
I turned to the private sponsors, I'm about to go I was going to at least banquet. Chatter from the meeting into the night, gave up.
Tetara views on Twitter, I was doing something interesting Tokaiu PerlDojo, participate.
What's funny answers to problems gfx? After the question and discovered that his problem is not read. I'm sorry m (__) m
@ __Gfx__ : @ Ktat Add_To_Items problem statement ($ value, \ @ array ) and has, right that it be rewritten?
2011-10-15 01:44:22 via Echofon to @ Ktat
After receiving the tsukkomi,
@ __Gfx__ : @ Ktat pull-Addition of Supplemental welcomes req!
2011-10-15 01:50:32 via Echofon to @ Ktat
It was said, fork the perldojo.
Then tested, because I wanted pull request, from the installation of Ark, and that if the dependent modules.
... And later discovered that only works in Perl 5.12.
Gah.
In so unavoidable, the system compiles Perl 5.14, etc. have been installed within the module's dependency on fine night.
Something to sleep, not go to the first day, I carried out the method by making participants feel the problem.
Purll request of the minutes and said, about 5 issue (?) Was chosen so far is that I 3.
, And saw where that would not know much attacking, # 1 challenge - at the time was 15. Good (what
The rest are staying at the review. What is feeling sorry late in quality. m (__) m
But when I try to select a problem, I thought difficult.
So, one day was disappointing, but I talk to see that care is recorded when it becomes available.
So, there is also something to death before problems pull request, Did up until about 6:00. Then, slept some time, about 8:40 èµ·Kitara.
I hear the talk of Mr. kazuho, thought over and survived, and prepare to get ready, Go to YAPC!
Commentary on the vital point of programming in UNIX.
I also have a size of pipe, in terms of security, open '| - The Janaku call', IPC:: Please tell such use Toka Open3.
Towards the end, there is talk of stopping the process when subjected to SIGNAL, I thought that the situation was similar Konaida implementation.
You find something suspicious strings and monitor the logs are written to the hand, which, with the fork, File:: In the Tail, continue reading the file in a separate process, a shady character string that something is a vast Tteiu.
Log files are rotated so that, with nothing and have trouble reading the file again when the rename. However, the process is not so continue to read the file, not other things. So at a certain time and interrupt ALRM, the end of the treatment ALRM, nor was it charged to Tokaiu ALRM.
What, at HUP to throw the child in a separate process to monitor, where it ... Why do not you reread Sele (Oi
... Or, well, keep at it, could be helpful to talk.
Generation of the memcached cache will check the return value, Toka be retried, and I made a cash worker.
Toka what to do with the cache of DNS, geeky talk about the cache.
I think it was a good story great.
But this kind of talk, talk does not matter so much significant only in the large-scale, implementing it is I could not hear me who do not much. Including me.
Thin framework. Defeat the safe side. Not just to be safe é¢åèKu.
The Tteiu framework, and ultimately thin, but the design guidelines, said that.
Now, just to extend the WAF I'm making Amon2 so
15 October, 10:03, by gfx, machine translated from Japanese
Sub:: made by Toka Spy, but somehow not open evenings
In short "bless I do not want to put a property on the reference code," What is that I'll.
It can be in the law I InsideOut. I have closed if the interface is as follows function Hash:: FieldHash just use.
#! Perl-w use 5.12. 0; use Hash:: FieldHash qw (fieldhash); use Guard qw (guard); fieldhash my% guard_of; sub guard_of { my ($ thing) = @ _; return $ guard_of {$ thing}; } { my $ value = 'Hello'; my $ closure = sub {$ Value}; $ Guard_of {$ closure} = guard {say "destroyed!"}; say guard_of ($ closure); } say 'end.'; __END__ Guard = SCALAR (0x10082c008) destroyed! end.
You can just use as a method to call if absolutely autobox. Encourage each type there is only space but does not name.
#! Perl-w use 5.12. 0; use Hash:: FieldHash qw (fieldhash); use autobox; use Guard qw (guard); fieldhash my% guard_of => 'guard', 'CODE'; { my $ value = 'Hello'; my $ closure = sub {$ Value}; $ Guard_of {$ closure} = guard {say "destroyed!"}; say $ closure -> guard; } say 'end.'; __END__ (Same result).
15 October, 09:18, by tokuhirom, machine translated from Japanese
https://github.com/tokuhirom/Test-CallCount
In such Kanji, Class:: Method:: If you inject the externally before method modifier Modifiers, you can count the number of times.
8 October, 08:13, by gfx, machine translated from Japanese
We can get to come to San Francisco. While enjoying the experience is valuable, YAPC:: Now you are here during the period of Asia.
Thus YAPC:: Talk Asia "Xslate Master Course" will be canceled. YAPC:: Asia blog I think you know so that you may already have already announced.
Restructuring of the document is scheduled for Xslate just as well to have a Japanese version of the document by the end, "Xslate Master Course" We are trying to publish somewhere Nothing was scheduled to announce.
The people were looking forward to, but sorry, thank you for your understanding.
8 October, 08:05, by gfx, machine translated from Japanese
I have a little over time, has released version 5.15.3 which is the development of Perl.
This is not a major change, which was introduced in 5.15.2 have been less restrictive of the reference code for the acquisition of intrinsic functions. Specifically, the reference could not be called from code built-in functions that take arguments in 5.15.2, so I had to work and assigned to the prototype when compiling typeglob always, 5.15.3 the reference code can also be called via the built-in functions take arguments.
#! Perl use 5.15. 3; use strict; use warnings; my $ length = \ & CORE:: length; say $ length -> ('foo'); # -> 3 my $ substr = \ & CORE:: substr; say $ substr -> ("bar", 1, 2); # -> ar __END__
Not completely but there are no limits, each () push () and some can not still call such a code reference directly. Also, print () grep (), and other special functions with prototypes * 1 is impossible to take a code reference.
This change makes it easier to call built-in functions from XS. Past is very difficult to call the built-in functions from XS, unavoidably sub myuc{ uc($_[0]) } but it just was making such a wrapper, the wrapper is no longer needed this extra is. I look forward to the regular release.
See Perldelta.pod for Details.
* 1 : built-in functions that can not override the words
2 October, 12:48, by ktat, machine translated from Japanese
github I put on.
Is divided into several parts of the text file (Not actually split returns an object to read the divided parts.)
Each part will be felt starting at the beginning and ending at the end of the line. That is not divided in the middle of the line.
Toka Toka used to use to split a very large CSV file. Mon's likely I already had it made by non-Nde.
my $ s = Text:: Parts-> new (file => "file.txt"); my @ parts = $ s -> split (num => 4); # num => count割Ritai. size => number of bytes available割Ritai foreach my $ part (@ parts) { my $ l = $ part -> getline; # or <$ part> # ... }
Used in the feeling.
$ Part will have a start and end position of the part of the file, then open & seek the file when you create an object, later, <$ fh> while, the termination of the part that reaches the final position The feeling is simple.
Indeed likely, if you want to split the CSV file, as follows.
my $ s = Text:: Parts-> new (file => "file.txt",, eol => "\ r \ n", parser => Text:: CSV_XS-> new ({binary => 1, eol => "\ r \ n"})); my @ parts = $ s -> split (num => 4); foreach my $ part (@ parts) { my $ columns = $ part -> getline_parser; # ... }
$ Columns are, Text:: Because the return value of getline CSV_XS, Perth and then an array reference.
Text:: If CSV_PP, very much broken to pass a CSV file (aaa ", there is a mismatch column quoting like), and they read it until end of file, check_line_start => Please pass the option 1. With this option and, from the back to the beginning and pass it to getline.
But the column that contains a newline Toka CSV, the format could be so broken, it will not work with version PP. Well, I also successful version of XS, happened to be talking Tteiu.
The parser, the parser can pass whatever it receives the file handle. For example, a parser might be better at Toka log.
Method object passed to the parser is used by default, I turned to getline. If you want to change, please pass the method name parser_method option.
In addition, each divided into rows of exactly what, but rather will split minutes 割Ritai the file size divided by the number.
But if only one line is very long and it may, if divided into four
The size of the first part - the part of the next size to try on file size / 4 - The size of the next part of experiment with the size / 3 remaining - experiment with size / 2 remaining.
And adjusted as, and to be passed to the first division number (even if you pass in the size, because it calculates the number of divisions from the file size is the same).
28 September, 16:03, by tokuhirom, machine translated from Japanese
I fold my testing on a daily basis recently.
[Premise]
It is dull and I have broken bukkake or someone else to change a little edge, write test cases without. For someone else mentioned here that also includes his future.
I did not, for example is around the API. I do not fiddle around with it in your browser Pochipochi, dullness! Now What.
You can feel free to add a test, can test us. What's more important than it is.
When you thought to add, "I do not know how to add," tend to be a situation where I think it is also important as people try to write a variety of pre-test each component. Toka tests for a class of O / R Mapper, Toka test model, test the controller Toka, Toka testing JSON API. .
We move in a development environment Ukigumo. This test is safe even if someone broke bukkake. And increase the number of teams come about, then you will also move the test person, not moving all the tests are not always in their (the time-consuming.)
Full-time to run the way the current test is 36 seconds.
ExtUtils:: Sales Zainode Toka been using blib / when used in the original MakeMaker, have done the following hack to Makefile.PL. It is not necessary to copy it to the Toka blib / Web applications. The move in blib / in production, you will not be installed.
# Sub MY Zainode parentheses to prove a direct hit can be copied and sold in blib / make test and that use raw:: test_via_harness {
"\ Tprove-r t"
}
# Sub MY charm made for extra files to prevent Toka pm_to_blib:: top_targets {
<<"..."
all::
\ T
pure_all::
\ T
subdirs::
\ T
config::
\ T
...
}
mysqladmin-uroot create myapp mysqldump-uroot-d myapp-dev | mysql-uroot myapp
I hope you felt. Test:: I have and I use mysqld, will start the test Ikansen heavier.
run only once between the make test, I think there Kedomo hack like, in a development environment I need to insure it is none of miles separate mysqld already standing, What is Kanji.
. I feel like a big following in proverc. App:: Prove:: Plugin:: If you are writing plug-ins for people prove Tteiu SchemaUpdater, an intelligent development environment consists of a schema it Piko to the test database. I have managed better the schema really fine, because people tend to frequent and sudden ALTER typing without updating the schema file, such defeat in Kanji.
"- Exec = perl-Ilib-I.-Mt:: Util" - Color -Pt:: lib:: App:: Prove:: Plugin:: SchemaUpdater
What you write a test, I think I know What that says how I have written first. So it is vital for many struggle.
For example, create a test user data, from What's it like frequent patterns,
my $ user = create_user (name => 'John');
In feeling like, it is important ゃっとつくれるようにしておくというのが cheesy. There are about eight such methods that guy doing now feel.
LWP:: LWP to mocking the UserAgent:: Protocol:: but I have a Tteiu PSGI, MUST NOT processed by the handler's gotta PSGI Spending all this and allows for access to flow like the original LWP I rather inconvenient, I created a hand-hack the class.
mock_http (); and What to do, only to hook the URL of the service, call the *. psgi. Now, LWP to normal:: Test and UserAgent:: WWW:: HTTP based testing will be freely available and by using Mechanize.
Feel free to add a test, I thought about creating a safe environment for the development.
28 September, 12:07, by tokuhirom, machine translated from Japanese
http://github.com/tokuhirom/File-Zglob
File:: Find:: Well fine I Toka Kedomo Rule,
File:: Find:: Rule-> file-> in ('lib') -> name ('*. pm')
Recall is difficult to form dormant Tteiu hard. It is not not user friendly.
What is going Uttara Patsudedetekurujanaidesuka lib /**/*. pm Dattara shell. It is to beat that way.
Not that I made. File:: is Zglob.
use File:: Zglob;
my @ files = zglob ("lib /**/*. pm");
I just have depression and so on. If you forget this interface. What I can I buy regularly at the shell.
I think it very useful little script in Toka, please come try it.
[Velocity]
Relations have been implemented in the PP, so I think you problem is to use sophisticated casual and slower than bsd_glob glob. File:: Find:: Rule is more fast.
[Aside]
The gauche-sys has been ported to glob. We think out some of them have formed Ppoku has been closed thanks to the functional code profusely.
[2] aside
Karekore from about three years after I wanted to make this module. I feel that is a really long time ago I thought you were led to make in a good story there's such a dear Tteiu Dekazu Hosan Akasaka underground.
Did Dekiagarimashita in about three days to interrupt sleep for some time. The most time consuming work google the function name is gauche.
[3] aside
Although I initially was going to incorporate the body Perl, the code itself is Ikansen hard to play with because I is not C code from OpenBSD. ** How can I get exactly the same processing Toka I think you know I can do now.
I get the body of capturing and easier to understand what it was thanks to the Perl code that can challenge the mind is comparatively easy for anyone but you.
24 September, 02:02, by ktat, machine translated from Japanese
Parallel:: ForkManager the 訳Shimashita (it was easy because only the difference from 0.7.5 's translation of nekoka).
, And if there is more than one error log file, tail a log file (File:: Use the Tail) while you find a Error, Tteiu script to do anything.
For example, if I thus feel it is! (Per cent
(In general, I was the first Big fine Toka update data regularly, not big enough Tokaiu distributed in multiple servers (or Teiu, and not the server such budgetary ..) Yeah, tea takes about 5 to 6h and do obediently But also, I think I like the process I use in about 1h 済Mashitai I do like smoked processing copper - Data from the Web / FTP (File s) to come up with, and Perth, and stick to the DB and array).
#! / Usr / bin / perl use strict; use warnings; use File:: Tail; use Proc:: PID:: File; use Parallel:: ForkManager; main (); sub main { my $ name = $ 0; $ Name = ~ s {/} {-} g; my $ pidfile = Proc:: PID:: File-> new (name => $ name, dir => "/ tmp /"); # Proc:: PID:: File multiple checks to ensure work processes if (not $ pidfile -> alive) { $ Pidfile -> touch; tail_error_log ($ pidfile); } } sub tail_error_log { my $ pidfile = shift; my% error; my @ files = </ var / log / httpd / * error_log>; my $ parent_pid = $ $; local (@ SIG {qw / INT TERM HUP /}); $ SIG {TERM} = $ SIG {INT} = sub {$ Pidfile -> release; exit (1)}; # Occasionally because I use it to run in cron, it was exit HUP $ SIG {HUP} = sub {$ Pidfile -> release; exit;}; # Since this process end, the process requires only the number of files my $ pm = Parallel:: ForkManager-> new (scalar @ files); foreach my $ file (@ files) { my $ past_log_ctime = (stat $ file. '.1') [10]; # .1 log's epoch time; print "start tail-f $ file \ n";
22 September, 13:52, by tokuhirom, machine translated from Japanese
According to perldoc-f return
Subroutine, eval, with the value given in EXPR do FILE, and then return. Evaluation of EXPR is a list depending on how the return value is used, scalar context will be invalid. Context also vary from run (please see wantarray). If EXPR is not specified, the empty list in list context, in a scalar context returns the undefined value. And (of course) does not return void context. http://perldoc.jp/func/return
If that is, in fact Kaeremasu a return from eval.
But back in the return from eval that surprised when they saw so little, the service is not recommended Kedomo.
21 September, 00:00, by holidays-l, machine translated from Japanese
The normal use of tiarra is "(→ tiarra yourself) → IRC server the same machine," I think that that is, taking the log of the IRC server to the main house "→ Everybody (IRC server ← tiarra) machine as" the configuration of the has become, Log:: has been logged in the Channel.
But (and whether caused by the configuration of the above clearly do not know,) System using ControlPort:: and to speak with SendMessage, Log:: me to record it Channel. (Did trouble long before the fact)
System:: SendMessage-> Log saw something looking at the arguments Dumper control_requested:: I was so call a Channel, Log forcibly:: Channel-> I called the message_arrived. Toka very appropriate sender (IrcIO:: Did rammed into the argument as it's from you or to new Mendoi *). Good children do not imitate.
$ Svn diff module / System / SendMessage.pm Index: module / System / SendMessage.pm ================================================== ================= --- Module / System / SendMessage.pm (revision 39 028) + + + Module / System / SendMessage.pm (working copy) @ @ -56,6 +56,13 @ @ Auto:: Utils:: sendto_channel_closure ( $ Chinfo-> fullname, $ command, undef, undef, undef, 0 )->($ Text); + $ This-> _runloop-> mod_manager-> get ('Log:: Channel') -> message_arrived ( + Tiarra:: IRC:: Message-> new ( + Command => $ command, + Params => [$ chinfo-> fullname, $ text] +) + $ This-> _runloop-> {sockets} -> [1] +); } } if ($ matched) {
21 September, 00:00, by holidays-l, machine translated from Japanese
Apparently System:: SendMessage will only be sent to 送Renairashii channel. IRC (specification) I feel so disconnected processes can send NICK tiarra also addressed. Yattsuke I'm Really, make-believe.
NOTIFY System:: NICK send you specify a comma-separated part of the Channel SendMessage.
Child may be ignored because I do not understand well the mask Toka mischief.
Index: module / System / SendMessage.pm ================================================== ================= --- Module / System / SendMessage.pm (revision 39 028) + + + Module / System / SendMessage.pm (working copy) @ @ -58,6 +58,17 @ @ )->($ Text); } } + If (! $ Matched) { + My% nick; + $ Nick {$ _} = 1 for split /, / msx, $ mask; + Foreach my $ person ($ server-> person_list) { + If (exists $ nick {$ person-> nick}) { + + + $ Matched; + Auto:: Utils:: sendto_channel_closure ($ person-> nick, $ command, + Undef, undef, undef, 0 )->($ text); +} +} +} if ($ matched) { my $ reply = ControlPort:: Reply-> new (200, 'OK'); $ Reply-> MatchedChannels ($ matched);
14 September, 18:01, by tokuhirom, machine translated from Japanese
Module:: When I write by using Makefile.PL Install, What I think may change the command to run make test. Command before running the test something and I know how.
When doing a project now in hand, prove without a Makefile.PL in the original. I was doing it in oysters Makutsu proverc, I wanted to move on the first prove, that way it binds.
sub MY:: test_via_harness { "\ T prove-r t" }
Makefile.PL to put at the bottom of the What.
id: Xaicron made Module:: Install:: I have it in a TestTarget, because this is too difficult for many people, not a last resort.
The other made Toka Zaishi pm_to_blib, because ovulation test webapp, so you better Tsukuran.
# Sub MY charm made for extra files to prevent Toka pm_to_blib:: top_targets {
<<"..."
all::
\ T
pure_all::
\ T
subdirs::
\ T
config::
\ T
...
}
In addition, M:: There is a theory that's easier done with B base.
12 September, 23:20, by ktat, machine translated from Japanese
What about two months ago, id: Tokuhirom has been based on the Framework of the company's Amon2 creation.
It is easy to feel Amon2 extended to maintenance the Flavor is pretty dull, in that same if I was better company and I use inheritance (but also uses Flavor). OR mapper id: Nekokak Mr. Teng, the template id: gfx 's Text:: Xslate.
Such a state can not publish the time being because the mind, and I talk like this to (the same as the actual code Dattari, or like some completely different story to get into a point.) Suppose, we write the namespace Teiu MyWAF.
I do not know well be fragmented because the code ... you.
id: tokuhriom 's own commentary
http://d.hatena.ne.jp/tokuhirom/20110712/1310422559
id: hiratara Amon2's read the source of
http://d.hatena.ne.jp/hiratara/20110823/1314085436
In Amon2, resulting in at app.psgi amon2_setup.pl,
MyApp:: Web-> to_app ();
If and, in to_app, MyApp:: just called the dispatch of the Web.
If, MyAPpp:: If you want a different name and the Web, you can change the name here.
In the same library multiple servers, when told to write psgi multiple Toka is such Yamo needs.
Also, when you dispatch the Tteiu separate the class path
Because of the triggers that BEFORE_DISPATCH, among them, to determine the path, you can separate processing paths for each dispatch.
__PACKAGE__-> Add_trigger (
BEFORE_DISPATCH => sub {
my ($ c) = @ _;
$ C -> message;
$ C -> {_dispatcher_class} = 'MyApp:: Web:: Dispatcher:: User';
if ($ c -> req-> env-> {PATH_INFO} = ~ m {^ / (admin)}) {
$ C -> {_dispatcher_class} = 'MyApp:: Web:: Dispatcher:: Admin';
}
# ...
});
sub dispatch {
my $ c = shift;
$ C -> {_dispatcher_class} -> dispatch ($ c);
}
Like.
Amon2:: Web:: Dispatcher:: Lite, but I like that you can put hooks on each pass, the only trigger BEFORE_DISPATCHER is (do not they?) And think a little tricky.
For example, when writing the login process Toka, I do write a trigger? Like.
Amon2:: Web:: Dispatcher:: Lite are doing it, because only then I export the functions to inherit, making your own is easy to imitate.
In the method I use export to inherit Teiu dispatch (right, dispatch method being used in a dispatch written in code above), Amon2:: Web:: Dispatcher:: The Lite, less feeling.
* {"$ Caller \:: dispatch"} = sub {
my ($ klass, $ c) = @ _;
if (my $ p = $ router -> match ($ c -> request-> env)) {
return $ p -> {code} -> ($ c, $ p);
} Else {
return $ c -> res_404 ();
}
};
Change this code a bit, What do I say to add a hook and place a particular path if the path to check the patterns are passed to functions such as get / post. MyWaf of:: Web:: Dispatche
9 September, 20:13, by tokuhirom, machine translated from Japanese
Ukigumo because it is designed as a primary goal of the Fuwa is loose, if properly set up a server, ready to use on their favorite time of project personnel.
Well, now I wanted something that made the guy so feel free to use and set up something to feel.
Nde client and server sides are completely separate, you can do with client-side implementation of their choice, there is no need to go on the server administrator. In that it will probably be easier. Because I say I do not want to manage. No, but you, Yaritaijan minimum of fuss as possible. I have to make it super easy to set up, it can be installed quickly level rather dotcloud Toka.
In the client-side or that I start using it Kedomo how, very simple, just send an HTTP Request is one piece as follows. Projects and registration is required. are made to find_or_create. Unpeaceful Nde loose.
#! / Usr / bin / perl use strict; use warnings; use utf8; use LWP:: UserAgent; my $ ua = LWP:: UserAgent-> new (); $ Ua -> post ('http://localhost:9052/api/v1/report/add', [ status => 1, # status code: SUCCESS: 1, FAIL: 2, N / A: 3 project => 'MyProj', # project name branch => 'master', # branch name vc_log => <<'...', # optional commit 80202d0952c6f7d9aeb6dc24a12484e47e212c28 Author: Tokuhiro Matsuno <tokuhirom@gmail.com> Date: Tue Sep 6 10:11:08 2011 +0900 do not index production.pl ... body => <<'...', # test report body t/00_compile.t .. 1 .. 1 ok 1 - use Acme:: Failing; ok t/01_fail.t ..... not ok 1 - oops .. 1 .. 1 # Failed test 'oops ..' # At t/01_fail.t line 6. # Looks like you failed 1 test of 1. Dubious, test returned 1 (wstat 256, 0x100) Failed 1 / 1 subtests Test Summary Report ------------------- t/01_fail.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files = 2, Tests = 2, 0 wallclock secs (0.04 usr 0.01 sys + 0.05 cusr 0.02 csys = 0.12 CPU) Result: FAIL ... revision => '80202d0952c6f7d9aeb6dc24a12484e47e212c28 ', # revision hash / number repo => 'git: / / github.com / tokuhirom / Acme-Failing.git', # repository uri ]);
Unpeaceful Nde loose, but some days I think you can create chat strange projects when such is now adequately Nde erasable, I liked not well am I supposed Lucchese appropriately.
https://github.com/ukigumo/Ukigumo-Client/
Ukigumo:: Redeeming the Client, the client-side part of this
I did until about us, but rather should always use this well, so if I hit Crelle the API. What I just have to have an easier 一応 libraries that use API.
Iutara, I can just about crowded. Very Very easy. This ぺろってかくところなんでしょうけど Sanduhe Dattara hirose31 in shell script, I was impossible at low power shell script. Ukigumo:: Client'm long and I just write I'm doing a script that the loaf about this. . I level a bit shocked that closed over the shorter than expected and I will write you write or say simple.
#! / Usr / bin / perl use strict; use warnings;
8 September, 03:08, by D, machine translated from Japanese
#! Perl exec "/ bin / ls"
#! Perl
END {do_interesting_stuff ()}
exec "/ bin / ls"
4 September, 12:14, by ktat, machine translated from Japanese
If you think I eat profusely batch processing memory, orz Did you get the files was because something Okkii
Spitting out the file once, so if you want to use later to open, on the LWP,
my $ ua = LWP:: UserAgent-> new (); $ Ua -> get ('http://example.com/big_file.gz', ': content_file' => '/ path / to / big_file.gz');
For Furl, use the option write_file. Here is a file handle.
my $ f = Furl-> new (); open my $ fh, '>', $ filename; $ F -> request (url => 'http://example.com/big_file.gz', write_file => $ fh);
Furl:: I have the documentation of HTTP, I exit the document Furl?
# If you write to a file, I'll do some talking in Tteiu curl / wget.
Incidentally, you can not read the files gzip, PerlIO:: via:: Toka use gzip.
http://search.cpan.org/ ~ majensen/PerlIO-via-gzip-0.021/lib/PerlIO/via/gzip.pm
# Alternatively, I'll also talk Tteiu I do gunzip.
Incidentally, while the reading process, LWP:: that UsearAgent,: content_cb. And it Furl, write_code.
LWP:: UserAgent is in the following examples.
http://blog.livedoor.jp/dankogai/archives/51141631.html
Furl documentation for an example of the progress bar, I will.
http://search.cpan.org/ ~ tokuhirom/Furl-0.37/lib/Furl.pm # FAQ
25 August, 09:14, by tokuhirom, machine translated from Japanese
http://mtl.recruit.co.jp/blog/2011/08/ye2011-day3.html
use v5. 14;
The meaning of "Anything newer than 5.14.0 would be great!" That was
use v5. 16;
From "I want a Perl 5 that works like 5.16" about having an alternative to this is obviously a very big change.
In short, the future is that the lexical context is made to the incompatible change. However, in that the changes are not made to be dramatic, and follows the stream past the Perl 5 compatibility. However, the unusable or features in v5.30 were left for compatibility so far. But use v5.14; can use perl and still would take. Such is something. Specifically, it will be sucky Hazuseru specifications based on the historical reason that Toka such a package separator 'and you will become the default utf8.
This strategy, I think 30 years will compete language Perl5 organized Huh.
See slide for more information or obra, YAPC:: I do I hear a obra's talk on Asia.
21 August, 15:38, by gfx, machine translated from Japanese
5.15.2 has been released a development version of Perl.
Has to take a subroutine reference built-in function in this version.
use 5.15. 2; # automatically turns on strict my $ time = \ & CORE:: time; say $ time ->(); # 1313908276
Also, time is and __LINE__ __FILE__ () Now that is interpreted as a built-in function that takes the same argument, the following is also possible.
use 5.15. 2; # automatically turns on strict my $ file = \ & CORE:: __FILE__; say $ file ->(); # foo.pl
Built-in function reference, however, the following limitations.
So much in fact that can only can give an alias to the built-in functions. Perhaps this is the goal seems to have built out the module function to eliminate the difference between a subroutine extra built-in functions.
It is an interesting feature anyway.
See Also: perldelta for 5.15.2
20 August, 18:23, by gfx, machine translated from Japanese
Binary serialization format MessagePack implementation of Perl Data:: MessagePack easier to transition from JSON.pm to add new features and redesigned interface and a * 1 .
More specifically, has changed as follows.
With the support of the property and in particular instances, global variables so far $Data::MesagePack::PreferInteger written as follows: integer preference was controlled by packing.
# Old-style (but non-promotion can still) { local $ Data:: MessagePack:: PreferInteger = 1; my $ packed = Data:: MessagePack-> pack ($ data); } # New style { my $ mp = Data:: MessagePack-> new; $ Mp -> prefer_integer (1); my $ packed = $ mp -> encode ($ data); }
Support for compatible interface JSON.pm also make it easier to compare the actual code. Please try to consider this opportunity come.
* 1 : In addition, backward compatibility is maintained naturally.
18 August, 02:00, by Yappo, machine translated from Japanese
18 August, 01:51, by D, machine translated from Japanese
16 August, 22:13, by Yappo, machine translated from Japanese
16 August, 09:25, by tokuhirom, machine translated from Japanese
The Demashi the Catalyst 5.90001, our local version is dependent on the Plack. This project is very PSGI be said in that release a single milestone. HTTP:: three years after being first released Engine, often hard work everyone! Impressed! (3 years ago (hopefully) a joke (like 10 years ago, the site text))
This is why, as I do not recommend the use of Catalyst at all is, I recommend to use is Amon2!
15 August, 12:31, by Yappo, machine translated from Japanese
12 August, 06:03, by Daisuke Maki, machine translated from Japanese
Below, " The Future Of Perl5 "that summarizes the contents of his presentation at OSCON 2011 by Dr. Jesse Vicent Andy Lester. I thought it a good entry in my eyes dim future roadmap of Perl5, was free translation Japanese translation.
(Here)
Lead the development of Perl5 (pumpking) at OSCON this year's Jesse Vincent said, " Perl 5.16 and then "it made a presentation that describes the future path of Perl5. SlideShare is a big part of this slide , we recommend that you try to read us too. I am a developer mailing list perl5 Perl5-porters have not subscribed to a few more years, while this presentation as a legacy to the environment but continue to use Perl5, what we do for technological innovation I think us great article once again highlights what has been done by the developers to experiment with.
In addition, Pumpking What exactly is a development lead and responsibility for such an opinion of the decision of the developers here and there. Jesse has previously had also Pumpking the person responsible for its own release of Perl, is now a role release process has been revised to allow a wider range of people participate and become a separate community.
Highlights of what the slide is as follows:
Perl5 is not being released when certain changes are made, turned into a timed release system releases are made periodically.
An odd minor version development version (eg: 5.13.x), is stable even if (for example: 5.14.x), policy that will continue as before
But the current stable version is Perl 5.14.1, 5.15.0 has been released just fine even 5.12.4
Before (Note: I believe that was before Perl 5.12.x) is not working for release of Perl that used to take three weeks alone make a pumpking. Now everything is documented, and processes that have been completed in several hours. Release was in turn responsible to the maintainer of many people on a volunteer basis. Larry (Note: Larry Wall, creator of Perl) says "there must be a hero Pumpking era is over."
Now further accelerate the development release of Perl5, and now we will need a way to recover from them if you make a mistake in reverse
Perl5 should be changed to enable more effective operation than the current default values. Note that the default value is also assumed control of the operation, including those as follows (Note: As of use strict, or switch the default pragma
Perl5 should evolve to work in all environments. All the OS, every browser is the target of all handsets
Changes to the core Perl5 should be fine to support old code. To impose defensive coding to protect yourself from changes in body Perl5 Perl5 us programmers do not (Note: Perl5 is the language equivalent to one of the few who care far backwards compatibility basically)
Perl5 runtime should be streamlined. Some of the old module is disconnected from the core, has been moved to the CPAN. These not have been deprecated and is only just that the core is in different.
In addition, Perl and streamlined in this way should be to release two versions of Perl modules that are bundled them all
Body language test suites, bug fixes, should be classified on the type of validation and implementation.
One of the things you can do to bring these things as much as possible as quickly donated to fund maintenance of the core Perl5
10 August, 08:50, by gfx, machine translated from Japanese
There are two interesting Test:: More extentions:
Test:: Flatten overrides subtests () to display the subtest title first, flatten subtest () not to be nested, and add colors to titles. In addition, it fixes test numbers when tests fork in subtests.
Test:: Name:: FromLine provides unnamed tests with informative names automatically. I wish it is the default in Test:: More.
Those two modules are cool but meaningful only in development, so I hesitate to depend on them in my CPAN modules.
If Test:: More was pluggable, I'd enjoy those extensions!
4 August, 12:20, by Yappo, machine translated from Japanese