Skip to content

Instantly share code, notes, and snippets.

@semifor
Created April 19, 2021 22:54
Show Gist options
  • Save semifor/a99a7180c881fb59a9219df4917cea33 to your computer and use it in GitHub Desktop.
Save semifor/a99a7180c881fb59a9219df4917cea33 to your computer and use it in GitHub Desktop.
How do you enable postderef in the debugger?
$ perl -d
Loading DB routines from perl5db.pl version 1.49
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
use 5.22.1;
use warnings;
use feature 'postderef';
no warnings 'experimental::postderef';
my $array = [ qw/foo bar baz/ ];
say join '-', $array->@*;
1;
main::(-:6): my $array = [ qw/foo bar baz/ ];
DB<1> c 9
foo-bar-baz
main::(-:9): 1;
DB<2> p $array->@*
Array found where operator expected at (eval 7)[/usr/share/perl/5.22/perl5db.pl:737] line 2, at end of line
at (eval 7)[/usr/share/perl/5.22/perl5db.pl:737] line 2.
eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
print {$DB::OUT} $array->@*;
' called at /usr/share/perl/5.22/perl5db.pl line 737
DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110
DB::DB called at - line 9
(Missing operator before ?)
at (eval 7)[/usr/share/perl/5.22/perl5db.pl:737] line 2.
eval 'no strict; ($@, $!, $^E, $,, $/, $\\, $^W) = @DB::saved;package main; $^D = $^D | $DB::db_stop;
print {$DB::OUT} $array->@*;
' called at /usr/share/perl/5.22/perl5db.pl line 737
DB::eval called at /usr/share/perl/5.22/perl5db.pl line 3110
DB::DB called at - line 9
syntax error at (eval 7)[/usr/share/perl/5.22/perl5db.pl:737] line 2, near "->@*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment