v****c 发帖数: 32 | 1 for($i=0;$i<15; ++$i){
print "$i ";
}
=================================
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
d****p 发帖数: 685 | 2 It is unlikely the case unless the print function has been overridden
somewhere else. Or your console treats ' ' as "\n"? |
v****c 发帖数: 32 | 3 In principle, it shouldn't work out like that. But it gives me the same
result every time. I am using linux perl interpretor.
Anybody can help me test the following please: |
t****t 发帖数: 6806 | 4 01234567891011121314
【在 v****c 的大作中提到】 : In principle, it shouldn't work out like that. But it gives me the same : result every time. I am using linux perl interpretor. : Anybody can help me test the following please:
|
l********s 发帖数: 358 | 5 I get the result as follows:
01234567891011121314 |
c**t 发帖数: 2744 | 6 you must overwrite $\ somehow.
【在 v****c 的大作中提到】 : for($i=0;$i<15; ++$i){ : print "$i "; : } : ================================= : 0 : 1 : 2 : 3 : 4 : 5
|
v****c 发帖数: 32 | 7 谢谢大家!我再重新登陆看看。
【在 c**t 的大作中提到】 : you must overwrite $\ somehow.
|
d****p 发帖数: 685 | 8
This is the answer :-). Just found the link below FYI.
http://www.perl.com/pub/a/2004/06/18/variables.html
What About $\?
Many paragraphs back I mentioned both $/ and $\ as being the input and
output record separators. But since then I've just gone on about $/. What
happened to $\?
Well, to be honest, $\ isn't anywhere near as useful as $/. It contains a
string that is printed at the end of every call to print. Its default value
is the empty string, so nothing gets added to data that you displa
【在 c**t 的大作中提到】 : you must overwrite $\ somehow.
|
v****c 发帖数: 32 | 9 decamp:
谢谢!:)
value
【在 d****p 的大作中提到】 : : This is the answer :-). Just found the link below FYI. : http://www.perl.com/pub/a/2004/06/18/variables.html : What About $\? : Many paragraphs back I mentioned both $/ and $\ as being the input and : output record separators. But since then I've just gone on about $/. What : happened to $\? : Well, to be honest, $\ isn't anywhere near as useful as $/. It contains a : string that is printed at the end of every call to print. Its default value : is the empty string, so nothing gets added to data that you displa
|