1

我正在使用 pdl2,交互式 perl pdl shell,我想在行中添加注释以记录下一个代码行,以便稍后查看我的交互式会话。

pdl> # this is a comment
Can't exec "this": No such file or directory at /homes/pmg/pmg-soft/local-perl/local-lib/lib/perl /x86_64-linux/PDL/Perldl2/Plugin/PDLCommands.pm line 51.

是否可以在 pdl2 shell 中添加注释?

PS:声望1500的人可以加pdl2标签吗?

[更新]

好的,'#' 确实是我想的评论符号,但似乎你不能用 # 开始一行,除非你之前放了一个 sp (或类似的东西)。?!这是一个“功能”吗?

pdl> # d
Can't exec "d": No such file or directory at /homes/pmg/pmg-soft/local-perl/local-lib/lib/perl5/x86_64-linux/PDL/Perldl2/Plugin/PDLCommands.pm line 51.
pdl>  # d  # "note the space before the #"
pdl>
4

1 回答 1

2

来自perldoc perldl

  Shell variables
    Shell variables: (*Note*: if you don't like the defaults change them in
    ~/.perldlrc)

    *   $PERLDL::ESCAPE - default value '#'

        Any line starting with this character is treated as a shell escape.
        The default value is chosen because it escapes the code from the
        standard perl interpreter.

Quick-n-dirty 答案:使用 # this is a comment(带前导空格)

于 2011-07-12T10:51:35.893 回答