Rosetta Code/Run examples: Difference between revisions
m
→{{header|Perl 6}}: Tweaks, comments
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: invert comparison) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Tweaks, comments) |
||
Line 298:
die 'You can select local or remote, but not both...' if $local && $remote;
## INITIALIZATION
my $client = HTTP::UserAgent.new;
Line 319 ⟶ 321:
run('clear');
## FIGURE OUT WHICH TASKS TO RUN
if $run {
Line 349 ⟶ 353:
note "Skipping first $skip tasks..." if $skip;
my $redo;
## MAIN LOOP
for @tasks -> $title {
Line 368 ⟶ 374:
say "Getting code from: http://rosettacode.org/wiki/{ $title.subst(' ', '_', :g) }#%l<language>";
uh-oh("No code found\nMay be bad markup");
$entry = $client.get("{ $url }/index.php?title={ uri-escape $/[0].Str ~ '/' ~ %l<language> }&action=raw").content;
}
Line 416 ⟶ 420:
}
## SUBROUTINES
sub mediawiki-query ($site, $type, *%query) {
|