in reply to Re: The Backslash Challenge
in thread The Backslash Challenge

Nice trick!

Interestingly, it doesn't work for me. In the debugger, I'm getting

cont: Can't find string terminator "\" anywhere before EOF at (eval 13)[/usr +/lib/perl5/5.26.1/perl5db.pl:738] line 2. at (eval 13)[/usr/lib/perl5/5.26.1/perl5db.pl:738] line 2. eval '' called at /usr/lib/perl5/5.26.1/perl5db.pl line 738 DB::eval called at /usr/lib/perl5/5.26.1/perl5db.pl line 3140 DB::DB called at -e line 1

And if I run it in a script instead, the output is _, not \ :-o

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^3: The Backslash Challenge
by LanX (Saint) on Mar 25, 2021 at 11:05 UTC
    > cont:

    A backslash at EOL marks a multiline statement in DB. I had a trailing whitespaces to avoid this, but the C&P from cmd.exe erased them. :( Fixed now!

    > And if I run it in a script instead, the output is _, not \ :-o

    both lines? lemme check...

    ...

    Argh! Seems that the context of the debugger is initializing a "crucial thing" which can't be taken for granted :(

    update

    yes a use DB; at the start of the script is "fixing" it.

    Actually that could be a source of a Heisenbug.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      > yes a use DB; at the start of the script is "fixing" it.

      Not only the DB. English works, too :-o

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]