由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 这个 perl 输出的数字为什么自动加了换行?谢谢!
相关主题
一道多线程的面试题 (转载)还是PERL问题
perl questionperl problem
请 教 : 关 于 writing to a file 用 Perl for CGI一个 perl 的 print 的初级问题
再 次 请 教 : 关 于 writing to a file 用 Perl for CGI脚本问题求教
一个perl bug,求救,谢谢!HTML print an image
这个perl的简单小程序为什么不work? (转载)What language I should use?
How to print \t in perl one-liner?如何控制输出的颜色?
50伪币:请教perl代码差错的问题!多谢啦!Fortran question: FORMAT(3HXY=3I)
相关话题的讨论汇总
话题: print话题: perl话题: what话题: 换行
进入Programming版参与讨论
1 (共1页)
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

1 (共1页)
进入Programming版参与讨论
相关主题
Fortran question: FORMAT(3HXY=3I)一个perl bug,求救,谢谢!
Fortran question in PLC?这个perl的简单小程序为什么不work? (转载)
也问个regular expression的问题How to print \t in perl one-liner?
又一个GDB的问题:关于显示数据50伪币:请教perl代码差错的问题!多谢啦!
一道多线程的面试题 (转载)还是PERL问题
perl questionperl problem
请 教 : 关 于 writing to a file 用 Perl for CGI一个 perl 的 print 的初级问题
再 次 请 教 : 关 于 writing to a file 用 Perl for CGI脚本问题求教
相关话题的讨论汇总
话题: print话题: perl话题: what话题: 换行