Спасибо Денис, еще чуть чуть поменяем ,
use 5.8.4;
use strict;
use warnings;
use Test::More;
my ( $start, $end, $sysid, $ver, $tradetype );
( $start, $end ) = ( 1, 10 );
my $test = make_string( $start, $end, $sysid, $ver, $tradetype );
is( $test, "1,10,,,\n", "make index string" );
is( make_string( 0, 0, 0, 0, 0, ), "0,0,0,0,0\n", "test number" );
sub make_string {
my @input = @_;
my @input_init = map { !defined($_) ? '' : $_ } @input;
my $rezult = join q{,}, @input_init;
return $rezult . "\n";
}
16.11.2011, 20:56, "Denis Evdokimov" <[email protected]>:
> make_string(0, 0, 0, 0, 0, )
>
> 16 ноября 2011 г. 20:53 пользователь Nikolay Mishin <[email protected]> написал:
>> все решилось, написанием такого кода
>>
>> use 5.8.4;
>> use strict;
>> use warnings;
>> my ( $start, $end, $sysid, $ver, $tradetype );
>> ( $start, $end ) = ( 1, 10 );
>> my $test = make_string( $start, $end, $sysid, $ver, $tradetype );
>> print $test;
>>
>> sub make_string {
>> my @input = @_;
>> my @input_init = map { $_ || '' } @input;
>> my $rezult = join q{,}, @input_init;
>> return $rezult . "\n";
>> }
>>
>> 16.11.2011, 20:16, "Nikolay Mishin" <[email protected]>:
>>> да, но все равно проблема у меня в том, что в perl v5.8.4
>>> $perl -e 'use warnings;my ($a,$b);$c=$a.$b;print $c'
>>> Use of uninitialized value in concatenation (.) or string at -e line 1.
>>> Use of uninitialized value in concatenation (.) or string at -e line 1.
>>>
>>> 16.11.2011, 20:03, "Alexandr Gomoliako" <[email protected]>:
>>>
>>>> On Wed, Nov 16, 2011 at 5:39 PM, Nikolay Mishin <[email protected]> wrote:
>>>>> $EMPTY = q{};
>>>>> $message = $EMPTY; #best
>>>> И вот это perlcritic приводит к такому корявому коду? :)
>>>>
>>>> --
>>>> Moscow.pm mailing list
>>>> [email protected] | http://moscow.pm.org
>>>
>>> --
>>> Nikolay Mishin
>>
>> --
>> Nikolay Mishin
>> --
>> Moscow.pm mailing list
>> [email protected] | http://moscow.pm.org
>
> --
> Moscow.pm mailing list
> [email protected] | http://moscow.pm.org
--
Nikolay Mishin
--
Moscow.pm mailing list
[email protected] | http://moscow.pm.org