Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

arc (5008)

arc
  (email not shown publicly)
http://aaroncrane.co.uk/
+ -

  Comment: Re:Can we migrate it to blogs.perl.org somehow? (Score 1) on 2010.08.17 11:21

by arc on 2010.08.17 11:21 (#72322)
Attached to: use Perl;

Hi, Pudge. Thanks for running use.perl.org for all these years; it was one of my first introductions to the Perl community.

I’m one of the blogs.perl.org admins, and we’d be very happy to import the existing u.p.o content into b.p.o as a way of keeping it available indefinitely. A dump of the data you mention sounds to me like a good way for us to get started on the import. I’m assuming that, given your blessing, Robert et al over at the Perl NOC would make use.perl.org a CNAME for the b.p.o server; then we’d rig up suitable redirections to make all the old URLs work as well as possible.

If you’d like to talk about any of this off-line, you can reach me as arc at cpan.org.

Read More 15 comments
Comments: 15
+ -

  Comment: Operator overloading to describe pipelines (Score 1) on 2009.02.16 18:24

by arc on 2009.02.16 18:24 (#67415)
Attached to: I think this module should exist

I looked into doing something very much along those lines some time ago (during OSCON::EU 2006 in Brussels, I think).

One of the problems is that callers which do use warnings will get lots of “Useless use of bitwise or (|) in void context” warnings. I considered whether this sort of thing would alleviate the problem:

package Whatever::Name::It::Gets;

use strict;
use warnings;

sub import {
    warnings->unimport(qw<void>);
}

It would, through the surprising scope of *^H, but there’s an obvious disadvantage: you don’t get any other void-context warnings.

I was additionally trying to get <> , and >> to work as redirection operators. That turned out to be even trickier: things like

Pipe('zcat') | [qw<tar x -O>] > $filename;

won’t work because of operator precedence. Perl conveniently warns you about this: “Possible precedence problem on bitwise | operator”; whether that’s actually better than the alternative is debatable in this case.

Finally, I believe it’s also impossible to use pipe as the convenience function name for these purposes:

$ cat foo.pl
use strict;
use warnings;
sub pipe { 1 }
pipe('foo') | pipe('bar');
$ perl foo.pl
Ambiguous call resolved as CORE::pipe(), qualify as such or use & at foo.pl line 4.
Ambiguous call resolved as CORE::pipe(), qualify as such or use & at foo.pl line 4.
Not enough arguments for pipe at foo.pl line 4, near "'foo') "
Not enough arguments for pipe at foo.pl line 4, near "'bar')"
Execution of foo.pl aborted due to compilation errors.

That’s by no means an insuperable objection, of course. For that matter, the other issues can all be worked around to produce a good interface, but it’s particularly annoying that what seems initially to be an ideal interface isn’t apparently implementable.

Read More 11 comments
Comments: 11