RE: perl newbie trying to start debugger
Over and over I see people recommending that we use perl -d. However, I find it more convenient to use the #/ -d syntax. Idiosyncratic? Maybe. But it's a 10 year idiosyncracy. So the question: why is perl -d good/better? BTW, I found in 5.6... And 5.8... on Solaris that -w and -d do not play nicely. But once I switched to "use warnings" the problems went away.
Re: perl newbie trying to start debugger
On Tue, Apr 24, 2007 at 02:08:05PM +0100, Ben Edwards wrote: > Ime very new to perl. My new job includes maintaining a number of > perl scripts whitch load csv filed into a database. > > I now find the need to start using the debugger, hopefully I am in the > correct place;) Yes, you are indeed. > I have added > > #! /usr/bin/perl -d -e > > to the begining of my script and get Adding -e is just plain wrong, because 'perl -h' says: -e program one line of program (several -e's allowed, omit programfile) > > Default die handler restored. > > Loading DB routines from perl5db.pl version 1.07 > Editor support available. > > Enter h or `h h' for help, or `man perldebug' for more help. > > Can't emulate -e on #! line at ./subs2pubsub_cron.pl line 1. > > I have tried putting 42 at the end of the #! line but get the same error;( As I said above, adding -e within a script is unnecessary since you don't need to advise Perl to include some code since everything is already there. > Any ideas? > Ben Why don't you use 'perl -d
Re: perl newbie trying to start debugger
Ben Edwards wrote: #! /usr/bin/perl -d -e Don't add the '-e' to the shebang line. Generally speaking, you don't want to have the -d on the shebang line either, unless the script is being called in a chain (e.g., command | command | perl_script ) Run your script like so: perl -d script_name
perl newbie trying to start debugger
Ime very new to perl. My new job includes maintaining a number of perl scripts whitch load csv filed into a database. I now find the need to start using the debugger, hopefully I am in the correct place;) I have added #! /usr/bin/perl -d -e to the begining of my script and get Default die handler restored. Loading DB routines from perl5db.pl version 1.07 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. Can't emulate -e on #! line at ./subs2pubsub_cron.pl line 1. I have tried putting 42 at the end of the #! line but get the same error;( Any ideas? Ben -- Ben Edwards - Bristol, UK If you have a problem emailing me use http://www.gurtlush.org.uk/profiles.php?uid=4 (email address this email is sent from may be defunct)