开发者

how to add a commented line in pdl2 shell

I am using pdl2, the interactive perl pdl shell, and I want to add comments in lines to document the next code line so I can review my interactive session later on.

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.

Is it possible to add comments in a pdl2 shell?

PS: can someone with 1500 reputation 开发者_运维百科add a pdl2 tag?

[UPDATE]

OK, '#' is indeed the comment sigil as I thought but seems that you can not start a line with # unless you put a sp (or semething) before. ?! is that a 'feature'?

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>


From 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 answer: use # this is a comment (with a leading space)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜