-
-
Save olegwtf/2422736 to your computer and use it in GitHub Desktop.
use utf8; | |
my $мама = 'рама'; | |
sub мой($) { | |
print "я мою ", shift, "\n"; | |
} | |
мой($мама); |
root@83:/test# git clone git://gist.github.com/2422765.git/test# ls
Cloning into 2422765...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
root@83:
2422765
root@83:/test# cd 2422765//test/2422765# ls
root@83:
1с.pl
root@83:/test/2422765# chmod +x 1с.pl/test/2422765# ls
root@83:
1с.pl
root@83:/test/2422765# ./1с.pl/test/2422765#
./1с.pl: line 1: use: команда не найдена
./1с.pl: line 3: my: команда не найдена
./1с.pl: line 4: syntax error near unexpected token (' ./1с.pl: line 4:
sub мой($) {'
root@83:
1С головного мозга
!/usr/bin/perl
use strict;
use utf8;
use open qw(:std :utf8);
my $мама = 'рама';
sub мой($) {
my $субьект=shift;
print "я мою ".$субьект."\n";
}
print мой($мама);
а что за CS ?
Из perldoc perlrun
-C [number/list]
The -C flag controls some of the Perl Unicode features.
As of 5.8.1, the -C can be followed either by a number or a list of option letters. The letters, their numeric values, and effects are as
follows; listing the letters is equal to summing the numbers.
I 1 STDIN is assumed to be in UTF-8
O 2 STDOUT will be in UTF-8
E 4 STDERR will be in UTF-8
S 7 I + O + E
Говоря по-русски переводит STDIN, STDOUT и STDERR в режим поддержки utf8. Иначе будут варнинги. Ну или как ты сделал.
круто, про -CS не знал, спасибо
действительно, это удобнее чем
use open qw(:std :utf8);
нехилый бредняк