Why can't my Perl script in ~/bin find relative file paths?
- by sid_com
#!/usr/bin/env perl
use warnings;
use strict;
use XML::LibXML;
my $parser = XML::LibXML->new;
my $file = './example.xml';
my $doc = $parser->parse_file( $file );
print ref( $doc ), "\n";
When I move this script and the example.xml-file to /home/me/ then the script works.
When I move the script and the example.xml-file to /home/me/bin/ then the script doesn't find the example.xml-file.
Is this some special-feature of the bin-directory?