how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -


i learning perl. trying in debugger define variable, here-document. not know how enter same code in perl script, in debugger. due new lines present inside eot, makes hard in interactive debugger.

here small example. have script:

>cat ex1.perl  #!/usr/bin/perl -w $s =<<'eot'; first line second line eot  print $s 

now run , gives expected output:

>perl ex1.perl first line second line 

now want same in debugger. tried this:

>perl -de0 loading db routines perl5db.pl version 1.39_10   db<1> $s =<<'eot';\   cont: first line\   cont: second line\   cont: eot can't find string terminator "eot" anywhere before eof @ (eval 6) [/usr/share/perl/5.18/perl5db.pl:732] line 2.  @ (eval 6)[/usr/share/perl/5.18/perl5db.pl:732] line 2.     eval 'no strict; ($@, $!, $^e, $,, $/, $\\, $^w) = @db::saved;package      main; $^d = $^d | $db::db_stop; $s =<<\'eot\'; first line second line eot; ' called @ /usr/share/perl/5.18/perl5db.pl line 732     db::eval called @ /usr/share/perl/5.18/perl5db.pl line 3090     db::db called @ -e line 1 

i not think using \ correct even, if not use \ debugger complain. not sure how enter eot text in debugger.

is there way type in same thing in perl script, using debugger? wanted test things more in debugger on eot.

i using

>perl --version  perl 5, version 18, subversion 2 (v5.18.2) built  x86_64-linux-gnu-thread-multi 

notice ; after eot in command that's run? that's causing problem. we'll need fool debugger.

  db<1> $s = <<'eot';\    cont: abc\    cont: def\    cont: eot\    cont: 1     db<2> x $s 0  'abc def ' 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -