Хочу создать строку из N пробелов. Можно ли это сделать эффективнее чем в цикле добавлять по пробелу? (сишную вставку писать не хочу) Может быть есть готовая функция? ;-)
;-) В свое время Белявский каждый второй мой вопрос встречал словами "Коля, купис себе Вюрблюда"
Проблема в том, что я его последовательно читать не смогу, а для ряда задач, для которых поисковая фраза неочивидна, так же и не очевиден и метод поиска в Вюрблюде... :-/
Поэтому увы, время от времени у меня возникают такие странные воросы. Слава богу что сейчас очень редко ;-)
Я ее не только купил, но и попытался почитать... В течении страницы читал рассуждения американского автора на тему, как его жена готовит русский борщ и не кладет в него при этом свеклы... А потом мне надоели, и я читать бросил ;-)
Binary ``%'' computes the modulus of two numbers. Given integer operands $a and $b: If $b is positive, then $a % $b is $a minus the largest multiple of $b that is not greater than $a. If $b is negative, then $a % $b is $a minus the smallest multiple of $b that is not less than $a (i.e. the result will be less than or equal to zero). Note that when use integer is in scope, ``%'' gives you direct access to the modulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will execute faster.
Binary ``x'' is the repetition operator. In scalar context or if the left operand is not enclosed in parentheses, it returns a string consisting of the left operand repeated the number of times specified by the right operand. In list context, if the left operand is enclosed in parentheses or is a list formed by qw/STRING/, it repeats the list. If the right operand is zero or negative, it returns an empty string or an empty list, depending on the context.
no subject
Date: 2007-06-16 09:23 am (UTC)А в каком месте об этом можно почитать?
no subject
Date: 2007-06-16 09:40 am (UTC)no subject
Date: 2007-06-16 09:50 am (UTC)В свое время Белявский каждый второй мой вопрос встречал словами "Коля, купис себе Вюрблюда"
Проблема в том, что я его последовательно читать не смогу, а для ряда задач, для которых поисковая фраза неочивидна, так же и не очевиден и метод поиска в Вюрблюде... :-/
Поэтому увы, время от времени у меня возникают такие странные воросы. Слава богу что сейчас очень редко ;-)
no subject
Date: 2007-06-16 10:20 am (UTC)no subject
Date: 2007-06-16 10:23 am (UTC)Я ее не только купил, но и попытался почитать... В течении страницы читал рассуждения американского автора на тему, как его жена готовит русский борщ и не кладет в него при этом свеклы... А потом мне надоели, и я читать бросил ;-)
no subject
Date: 2007-06-16 10:36 am (UTC)а вот как раз её-то можно и не читать линейно :)
no subject
Date: 2007-06-16 01:40 pm (UTC)Multiplicative Operators
Binary ``*'' multiplies two numbers.
Binary ``/'' divides two numbers.
Binary ``%'' computes the modulus of two numbers. Given integer operands $a and $b: If $b is positive, then $a % $b is $a minus the largest multiple of $b that is not greater than $a. If $b is negative, then $a % $b is $a minus the smallest multiple of $b that is not less than $a (i.e. the result will be less than or equal to zero). Note that when use integer is in scope, ``%'' gives you direct access to the modulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will execute faster.
Binary ``x'' is the repetition operator. In scalar context or if the left operand is not enclosed in parentheses, it returns a string consisting of the left operand repeated the number of times specified by the right operand. In list context, if the left operand is enclosed in parentheses or is a list formed by qw/STRING/, it repeats the list. If the right operand is zero or negative, it returns an empty string or an empty list, depending on the context.
print '-' x 80; # print row of dashes