| ◀ | ▶ | |
|---|---|---|
→
Perl runs everywhereNow
JS runs everywhere
「だがJavaScriptとともに生きることは出来る」
Perl runs everywhereNow
Perl runs everywhere
#! /usr/bin/perl
# version 1.1
# if the host+path are in matrix then the redirect is to a single location
# if just the host is in matrix then the redirect is to host+the request uri
# nwk-productred 17.149.160.28 & 17.172.224.28
#
# to distibute this file us /usr/local/scr/distfilex
#
#
#$matrix{"http_host"} = "desturl";
$matrix{"stage-wscar.apple.com:8414"} = "http://stage-wscar.apple.com/cgi-bin/httptest";
#$matrix{"itutest.apple.com:8414"} = "http://stage-wscar.apple.com/cgi-bin/httptest";
# $matrix{""} = "";
# my plan is to get these first.
$matrix{"imac.com"} = "http://www.apple.com/imac/?cid=oas-us-domains-imac.com";
$matrix{"macbookair.com"} = "http://www.apple.com/macbookair/?cid=oas-us-domains-macbookair.com";
$matrix{"speech.apple.com"} = "http://www.apple.com/macosx/";
#…
1;
use Benchmark qw/:all/;
cmpthese timethese 100,
{
node => sub { `node cheat.js` },
perl => sub { `perl cheat.pl` },
php => sub { `php cheat.php` },
python => sub { `python cheat.py` },
ruby => sub { `ruby cheat.rb` },
};
Rate php node python ruby perl
php 19.4/s -- -3% -42% -91% -93%
node 20.0/s 3% -- -40% -90% -93%
python 33.7/s 74% 68% -- -84% -88%
ruby 208/s 975% 940% 519% -- -27%
perl 286/s 1374% 1326% 749% 37% --
% cat cheat.* console.log(496165411); 496165411 print 496165411, "\n"; print(496165411) puts 496165411
perl Makefile.PL make make test make installcpan, cpanplus, even cpanminus
use v5.12; use utf8; binmode STDOUT => ':utf8'; my $s = "🐍"; say $s; say sprintf "%04X", ord $s; say length $s;
var s = "🐍"; print(s); print(s.charCodeAt(0).toString(16)); print(s.length);
Perl is just syntax. CPAN is THE language - clkao
$_->answer for @questions;