Perl-LanguageServer icon indicating copy to clipboard operation
Perl-LanguageServer copied to clipboard

Debugging when script reads from <stdin>

Open software-artisan opened this issue 3 years ago • 2 comments

Hi,

I am not able to debug a script that reads from <stdin>. For example, when debugging below script by stepping over the line "$x = <stdin>", the debugger does not accept input from the "debug console" pane. It prints stdout to this pane but doesn't seem to accept <stdin> input. Want to know where to enter this input.

#!/usr/bin/perl
$x = <stdin>;
$y = <stdin>;
$z = $x + $y;
print "the sum of $x and $y is $z\n";

software-artisan avatar Sep 06 '21 20:09 software-artisan

Reading from stdin are not yet implemented. Any contributions are welcome.

richterger avatar Oct 02 '21 21:10 richterger

You can just pass in the stdin value as a file name under arguments in the launch file.

lilbro1062000 avatar Jan 09 '22 09:01 lilbro1062000

https://github.com/richterger/Perl-LanguageServer/pull/166 should fix this

wielandp avatar Feb 06 '23 17:02 wielandp

stdin redirect is implemented in 2.6.0+

richterger avatar Jul 26 '23 18:07 richterger