Peter Martini
- Website: twitter.com/PeterCMartini
- About: I like thinking about machines, especially virtual machines like Perl's VM, the Java VM, and kvm/qemu
Recent Actions
-
Commented on Prototypes and the call checker
Zefram pointed me to http://search.cpan.org/dist/Debug-Show/lib/Debug/Show.pm, which is doing what I had in mind. Thanks!...
-
Posted The Chimera Quine; or, the ISO PDF to Peter Martini
Inspired by PoC||GTFO, herewith is a (pseudo) quine written in Perl that generates a copy of itself as a PDF which is also a mountable ISO with that PDF as the sole file.
Copy the script as quine.pl, run it, and you'll get a quine.pdf which can also be mounted as a filesy…
-
Commented on Prototypes and the call checker
@mascip - thanks! It's not quite doing what I was thinking of, but looks like a good playground to confirm the theory....
-
Commented on Spelunking: why 'while(){ }' is my new favorite perl-ism
The docs says WHILE takes an EXPR, but the grammar actually has it as a texpr, which is either an EXPR, or if none is supplied, a true value (1). It's the same block of code that allows for(;;){} to...
-
Posted Spelunking: why 'while(){ }' is my new favorite perl-ism to Peter Martini
Today I saw a post by sartak mentioning a feature I didn't know:
while () { ... }
is legal and acts as an infinite loop.. This is awesome! I occasionally have need for a while(true) loop, and I… -
Commented on Prototypes and the call checker
I started looking through that gist and will have to come back and spend some more time with it; I never would have thought to do something like that in Perl itself, and I'm going to have to dig in...
-
Posted Prototypes and the call checker to Peter Martini
Perl prototypes are fascinating. They enable: making argument count enforceable at compile time; adding an implicit argument; changing how a list of arguments are parsed; changing how individual arguments are parsed; and…
-
Commented on \r, \n, and ... \R ?
Here's the latest discussion (I think): http://www.nntp.perl.org/group/perl.perl5.porters/2013/07/msg204693.html The root idea, which I should have been clearer about, was to have $/ control that kind of matching, and the reason it got shut down (or at least deferred) is the fact...
-
Posted \r, \n, and ... \R ? to Peter Martini
It's common knowledge that on Windows, a line of text generally ends with a \r\n characters sequence, and on a POSIX system a line of text will end with \n.
Less well known is Perl's support for the escape sequence '\R'.
What's \R?
It's definitely not the i…
-
Posted Subroutine Signatures - my Plan (v.1) to Peter Martini
There has been quite a lot of discussion on p5p about subroutine signatures, so I figured I'd lay out my current vision here with as much details as I can. As more of this gets hashed out on p5p, I expect I'll add notes at the bottom (can I do that?) pointing to a blog entry for Subroutine…
Comment Threads
-
Olivier Mengué (dolmen) commented on
Prototypes and the call checker
The link to ex5 is broken.
-
Olivier Mengué (dolmen) commented on
Prototypes and the call checker
Another typo in §2: "takes affect" => "takes effect"
-
Buddy Burden commented on
Prototypes and the call checker
It sounds like you're on the cusp of achieving what I've been trying to do for years with Debuggit. As mascip mentions, Debuggit properly advertises that you can achieve this via:
debuggit("foo is", $foo) if DEBUG >= 2;
but that's just using standard constant folding. What I really want is for this:
debuggit(2 => "foo is", $foo);
to likewise get expunged during the compilation phase. But I haven't seen any way to do it outside source filtering/Devel::Declare magic/new keyword API, none of which seemed worth the hassle. But …
-
Randal L. Schwartz commented on
Spelunking: why 'while(){ }' is my new favorite perl-ism
Well, they're real git commits, for sure. But they are cloned from all the things that preceded git for Perl's version control by an immense effort to accurate capture as much of Perl history as was now possible.
-
MeirG commented on
\r, \n, and ... \R ?
As in Audrey Tang's PerlIO::eol, I would suggest that instead of always substituting \R with \n, why not allow the user to specify to which platform to substitute: Like Audrey's, allow LF/CR/LFCR/NATIVE (or Unix/Mac/Windows/Native). Default would be LF(Unix) to be backward compatible.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.