A new perl.org
A new design, complete with rewritten content for www.perl.org! Looks fantastic!
The Myth of the Muttering Madman is a project in self-realization.
A new design, complete with rewritten content for www.perl.org! Looks fantastic!
Posted by
snarkyboojum
at
1:20 pm
1 comments
I was reading through the source code for proto over a beer this evening and came across this:
# Read Makefile.in, edit, write Makefile | |
my $maketext = slurp( 'Makefile.in' ); | |
$maketext .= subst( .key, .value ) for | |
'Makefile.in' => 'Makefile', | |
'To be read' => 'Written', | |
'replaces <TOKENS>' => 'defined these', | |
# Maintainer note: keep the following in sync with pod#VARIABLES below | |
'<PERL6>' => $perl6, | |
'<PERL6LIB>' => $perl6lib, | |
'<PERL6BIN>' => $perl6bin, | |
'<RAKUDO_DIR>' => $rakudo_dir; | |
squirt( 'Makefile', $maketext ); | |
# Job done. | |
.say for | |
'', | |
q[Makefile is ready, and you can run 'make'.]; | |
# The opposite of slurp | |
sub squirt( Str $filename, Str $text ) { | |
my $handle = open( $filename, :w ) | |
or die $!; | |
$handle.print: $text; | |
$handle.close; | |
} |
Posted by
snarkyboojum
at
7:05 pm
0
comments