Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: script fails but succeeds in debugger

by Anonyrnous Monk (Hermit)
on Dec 20, 2010 at 11:21 UTC ( #877983=note: print w/replies, xml ) Need Help??

in reply to script fails but succeeds in debugger

Can't reproduce the issue, i.e. it works fine for me without the debugger:

#!/usr/bin/perl -w use strict; use Getopt::Long::Descriptive; my ($opt, $usage) = describe_options( 'my-program %o <some-arg>', [ 'server|s=s', "the server to connect to" ], [ 'port|p=i', "the port to connect to", { default => 79 } ], [], [ 'verbose|v', "print extra stuff" ], [ 'help', "print usage message and exit" ], ); print($usage->text), exit if $opt->help;
$ ./ --help my-program [-psv] [long options...] <some-arg> -s --server the server to connect to -p --port the port to connect to -v --verbose print extra stuff --help print usage message and exit

(tested with v5.10.1 (*) built for x86_64-linux-thread-multi)

Update: as the first problem happens here:

sub _validate_with { my (%arg) = validate(@_, { # <-- line 442 name => 1, params => 1, spec => 1, opts => 1, usage => 1, });

and validate() is from Params::Validate, maybe there's some problem with this module? Which version are you using? (0.95 here)

Replies are listed 'Best First'.
Re^2: script fails but succeeds in debugger
by codeacrobat (Chaplain) on Dec 20, 2010 at 12:02 UTC
    Ok it was Params::Validate. A fresh reinstall fixed the issue.

    I still would like to know how to better debug this issue.

Re^2: script fails but succeeds in debugger
by codeacrobat (Chaplain) on Dec 20, 2010 at 11:44 UTC
    Hi. I have the latest version.
    > perl -MParams::Validate -e 'print Params::Validate->VERSION' 0.95


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://877983]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2021-10-27 04:09 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (91 votes). Check out past polls.