Opened 4 years ago

Closed 3 years ago

#1036 closed defect (not a bug)

Debugged scripts can't find modules in the current directory

Reported by: dandv Owned by:
Priority: critical Milestone:
Component: Debugger for Perl 5 Version: 0.72
Keywords: debugger Cc:

Description

When stepping into this script on Windows, Padre doesn't change to the correct directory, because the script can't find a module located in the same directory:

use strict;
use Cwd;

print getcwd(), "\n";  # wrong, getcwd() returns the My Documents directory

require Module;

print Module::foo();

Module.pm exists in the same directory as the script:

package Module;

sub foo { 'bar' }

1;

When run from the command line in c:\programs\perl, the script works as expected and prints

c:/programs/perl
bar

Change History (3)

comment:1 Changed 4 years ago by zenogantner

  • Keywords debugger added

comment:2 Changed 4 years ago by szabgab

  • Component changed from editor to Debugger for Perl 5

comment:3 Changed 3 years ago by bowtie

  • Resolution set to not a bug
  • Status changed from new to closed

dandv

is this still relevant in Debug2

had you considered using

use FindBin qw($Bin);
use lib ("$Bin");
Note: See TracTickets for help on using tickets.