Jonathan Lloyd
- Website: www.lifegames.org
- About: I blog about Perl.
Recent Actions
-
Commented on Why you don't need File::Slurp…
I would be curious for you to add Damien Conway's Perl6::Slurp to your comparison....
-
Commented on Method::Signatures: where and when
Thank you for your efforts! Method::Signatures is a key part of my Moose toolbox. Very much appreciated....
- Posted An Excuse to Get Outside (Team Building via RC Helicopter) to Jonathan Lloyd
-
Posted Preventing Collisions with Perl cron jobs to Jonathan Lloyd
Imagine you are a brilliant developer who just created a Perl script that takes form submissions from your website and imports them to your ticketing system. Well done! Now you want to set this script to run periodically so that as new requests come in they are automatically submitted to your…
-
Commented on Hello World
Welcome! Any new Perl blogger is good for the community. I look forward to your future posts....
-
Commented on Why does your site not link to perl.org?!
Great article. You are right on! I plan to add this link to all our web properties....
-
Commented on Dynamic Forms with HTML::FormFu
Great article! Never even knew this module existed -- but now I may use it on an upcoming project....
-
Posted Perl 6 IRL (In Real Life) to Jonathan Lloyd
A couple of weeks ago a ran into a real life situation where Perl 6 was able to greatly simplify my life. I was in the process of importing some Canadian postal codes from a PDF document where the data was presented like this:
A0A-A0R,D13
A1A-A1G,D11
A1H-A1M,D13…
Comment Threads
-
Leon Timmermans commented on
Why you don't need File::Slurp…
mmap should be faster than sysread -s or read -s, and there exist a portable module for it.
There is, and I wrote it ;-). Was planning to blog about that too at some point. It's close but not exactly the same as slurping.
-
George Greer commented on
Why you don't need File::Slurp…
I use a one-liner slurp at $WORK. I am sooo tired of copy+pasting it into scripts when I start them (and perhaps remembering which is the most recent if I've changed it lately). I would much prefer it be as easy as a module.
-
Nick Patch commented on
Why you don't need File::Slurp…
If I recall, File::Slurp had issues with the PerlIO
:encodinglayer and required manual decoding of the slurped data instead, which is why I have avoided it. Not sure if this is still an issue. -
Leon Timmermans commented on
Why you don't need File::Slurp…
If I recall, File::Slurp had issues with the PerlIO :encoding layer and required manual decoding of the slurped data instead, which is why I have avoided it. Not sure if this is still an issue.
Looking at the code, that's still an issue. I hadn't realized that, but that's a rather serious issue.
It also doesn't quite handle :crlf correctly either. This is a mess :-(
-
Leon Timmermans commented on
Why you don't need File::Slurp…
Functionally it's identical to
read_file(binmode => ':raw'), otherwise it's perfectly portable.Because File::Slurp can be rewritten in XS if speed is the overriding concern (and it will be faster than your 2-lines).
And it would not be faster than what I just posted. It really wouldn't. It's speed limited by the actual IO, that's the whole point.
Because File::Slurp is self-documenting.
All …
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.