[Moscow.pm] perl 6 vs utf8

mi ya.ru
6 22:38:21 PDT 2011


   ,      :

my $fh_out = open 'test', :w;

my $fname = shift @*ARGS;
my $file = open $fname, :r;

for $file.lines -> $line{
    $fh_out.say( $line.flip );
}

close $fh_out;


06.07.2011, 21:52, "Ruslan Zakirov" <ruz  bestpractical.com>:
> 2011/7/6   <mi  ya.ru>;:
>
>>   ,   !!! perl6  -    
>>     
>>       
>> ,     
>
> while (defined my $line ...)
>
>> 06.07.2011, 18:29, "Ruslan Zakirov" <ruz  bestpractical.com>;:
>>> 2011/7/6 Ruslan Zakirov <ruz  bestpractical.com>;;:
>>>> ,
>>>>
>>>> - :
>>>>
>>>> my $fh_out = open 'test', :w;
>>>>
>>>> my $fname = shift @*ARGS;
>>>> my $fh_in = open $fname, :r;
>>>> while ( my $line = $fh_in.get ) {
>>>>  $fh_out.say( $line.flip );
>>>> }
>>>   close:
>>>
>>> close $fh_out;
>>>> 2011/7/6   <mi  ya.ru>;;:
>>>>> Hi Moscow-pm
>>>>>  , -    (  ,     -),    perl6 (racudo)
>>>>>          utf8, 
>>>>>
>>>>> use utf8;  # encoding="utf-8"
>>>>> use strict;
>>>>>
>>>>> open my $fh, '>:utf8', 'test';
>>>>>
>>>>> my $filename = shift;
>>>>> open my $foofh, '<:utf8', "$filename"
>>>>> or die "Can't open $filename: $!\n";
>>>>>
>>>>> my $out;
>>>>> while (<$foofh>) {
>>>>>  my ($line) = $_;
>>>>>  chomp($line);
>>>>>  $out = scalar reverse $line;
>>>>>  print $fh $out, "\n";
>>>>> }
>>>>> close $foofh;
>>>>>
>>>>> close $fh;
>>>>> --
>>>>>  
>>>>> --
>>>>> Moscow.pm mailing list
>>>>> moscow-pm  pm.org | http://moscow.pm.org
>>>> --
>>>> Best regards, Ruslan.
>>> --
>>> Best regards, Ruslan.
>>> --
>>> Moscow.pm mailing list
>>> moscow-pm  pm.org | http://moscow.pm.org
>> --
>>  
>> --
>> Moscow.pm mailing list
>> moscow-pm  pm.org | http://moscow.pm.org
> --
> Best regards, Ruslan.
> --
> Moscow.pm mailing list
> moscow-pm  pm.org | http://moscow.pm.org

--
 


Moscow-pm