abdan has asked for the wisdom of the Perl Monks concerning the following question:

Why in interactive debug cannot do input:
DB<1> @ln=<STDIN>; <"FILE" DB<2> print "$ln[0] $ln[1]"
How to have it working directly

Replies are listed 'Best First'.
Re: STDIN usage in interactive debug
by haj (Vicar) on Oct 24, 2021 at 08:16 UTC

    In the debugger you can either use debugger commands or valid Perl, but <"FILE" is neither.

    To get the contents of a file into an array, valid Perl isn't that difficult:

    DB<1> open ($in,'<','FILE') DB<2> @ln = <$in> DB<3> close $in

      Or you could even do it all in one line (without needing the close). . .

      DB<1> @lines = do { open( my $fh, '<', 'FILE' ); <$fh> }

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.