Error on Perl Module File-Find-Rule when run .pl/and create exe

Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 07:20:11 von Ramkumar

Hi List,

I am facing module error when run the perl file.

I am using perl version 5.8.8

Module File-Find-Rule installed on site area in my system.

Part of my Perl code:
======================
use File::Find::Rule;
my @img_file;
tie @img_file, 'Array::Unique';

@imgfolder = File::Find::Rule->file()->name('*.*')->in($imagepath);

foreach my $temp(@imgfolder)
{$temp=~s/\Q$imagepath\/\E//gi;push(@img_folder,$temp);}
my $flag;
for(my $i=0; $i<=scalar(@img_file);$i++)
{
for(my $j=0; $j<=scalar(@img_folder);$j++)
{
if(@img_file[$i] eq @img_folder[$j])
{$flag=1;}
}
if($flag==0){push(@difference,@img_file[$i]);}
$flag=0;
}

Error While run:
=================
invalid top directory at C:/Perl/lib/File/Find.pm line 592

Note:
======
On this same path, module 'C:\Perl\lib\File\Find.pm' available. Also the
same Perl ran before some days back, but I am facing the error.

Please anyone suggest how to solve this one.

Regards,

Ramkumar
R&D - Software Engineer


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 09:01:10 von Bill Luebkert

Ramkumar wrote:
>
> Hi List,
>
> I am facing module error when run the perl file.
>
> I am using perl version 5.8.8
>
> Module File-Find-Rule installed on site area in my system.
>
> Part of my Perl code:

Rewrite your code with use strict and use warnings at the top
and run it before posting it. Then we can help if you get
errors.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 09:31:05 von Ramkumar

Hi,

I used strict and warnings at top of my program as you told, and found some
warnings and I have fixed all even, I am getting the same error "invalid top
directory at C:/Perl/lib/File/Find.pm line 592"

Regards,
Ramkumar

-----Original Message-----
From: Bill Luebkert [mailto:dbecoll@roadrunner.com]
Sent: Tuesday, October 06, 2009 12:31 PM
To: ramkumar@premediaglobal.com
Cc: activeperl@listserv.ActiveState.com
Subject: Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

Ramkumar wrote:
>
> Hi List,
>
> I am facing module error when run the perl file.
>
> I am using perl version 5.8.8
>
> Module File-Find-Rule installed on site area in my system.
>
> Part of my Perl code:

Rewrite your code with use strict and use warnings at the top and run it
before posting it. Then we can help if you get errors.


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 10:22:12 von Bill Luebkert

Ramkumar wrote:
> Hi,
>
> I used strict and warnings at top of my program as you told, and found some
> warnings and I have fixed all even, I am getting the same error "invalid top
> directory at C:/Perl/lib/File/Find.pm line 592"

OK, now post the script exactly as you ran it after fixing the errors
and we'll see if we can help.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 10:30:06 von Gaurav Vaidya

Hey there,

2009/10/6 Ramkumar :
> Error While run:
> =================
> invalid top directory at C:/Perl/lib/File/Find.pm line 592
So, there's an error somewhere inside File::Find. Note that the error
is _inside_ File/Find.pm; this suggests that Perl managed to find
File/Find.pm without any problems.

In the code segment you gave us, this is the only line where
File::Find seems to be used:
> @imgfolder = File::Find::Rule->file()->name('*.*')->in($imagepath);

So there might be something wrong somewhere there. What about
$imagepath? What is that set to?

cheers,
Gaurav
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 10:45:48 von Bill Luebkert

Gaurav Vaidya wrote:
> Hey there,
>
> 2009/10/6 Ramkumar :
>> Error While run:
>> =================
>> invalid top directory at C:/Perl/lib/File/Find.pm line 592
> So, there's an error somewhere inside File::Find. Note that the error
> is _inside_ File/Find.pm; this suggests that Perl managed to find
> File/Find.pm without any problems.
>
> In the code segment you gave us, this is the only line where
> File::Find seems to be used:
>> @imgfolder = File::Find::Rule->file()->name('*.*')->in($imagepath);
>
> So there might be something wrong somewhere there. What about
> $imagepath? What is that set to?

That's why I asked him to redo the script and make sure there
were no non-logic errors. Then we can debug the logic from a
clean compile.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 11:28:44 von Ramkumar

Hi,

It has many line in my file, very big program.

If I comment these two lines, #use File::Find::Rule; and
#@imgfolder =
File::Find::Rule->file()->name('*.*')->in($imagepath);
It is working fine (except this functionality).


Note: $imagepath is assigned user argument, as my $imagepath=$ARGV[3];

The purpose of the above functionality is to find out "unused images
in Image path and Not available images" used in XML.

Error:
invalid top directory at C:/Perl/lib/File/Find.pm line 592

Regards,
Ramkumar

-----Original Message-----
From: Bill Luebkert [mailto:dbecoll@roadrunner.com]
Sent: Tuesday, October 06, 2009 1:52 PM
To: ramkumar@premediaglobal.com
Cc: activeperl@listserv.ActiveState.com
Subject: Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

Ramkumar wrote:
> Hi,
>
> I used strict and warnings at top of my program as you told, and found
> some warnings and I have fixed all even, I am getting the same error
> "invalid top directory at C:/Perl/lib/File/Find.pm line 592"

OK, now post the script exactly as you ran it after fixing the errors and
we'll see if we can help.


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Antwort: RE: Error on Perl Module File-Find-Rule when run .pl/and

am 06.10.2009 11:41:20 von Torsten.Werner

Hi,
activeperl-bounces@listserv.ActiveState.com schrieb am 06.10.2009 11:28:44:
> Note: $imagepath is assigned user argument, as my $imagepath=$ARGV[3];

Could it be that you have a problem with encoding? Do you use non-ASCII
characters in $ARGV[3]?
Can you reproduce the problem with a simple argument (no spaces, 7 bit
ASCII only)?

Bye
Torsten

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 06.10.2009 14:05:34 von Bill Luebkert

Ramkumar wrote:
> Hi,
>
> It has many line in my file, very big program.
>
> If I comment these two lines, #use File::Find::Rule; and
> #@imgfolder =
> File::Find::Rule->file()->name('*.*')->in($imagepath);
> It is working fine (except this functionality).
>
>
> Note: $imagepath is assigned user argument, as my $imagepath=$ARGV[3];
>
> The purpose of the above functionality is to find out "unused images
> in Image path and Not available images" used in XML.
>
> Error:
> invalid top directory at C:/Perl/lib/File/Find.pm line 592

We don't need the whole program, just the test case you posted earlier
and that you've fixed and tested locally along with the failure that
you have already described.

Just give us a clean compiling test case that reproduces the problem -
it doesn't have to be any bigger than the previous example. Then we
can try it and see what we get. Also post your Perl
version/build/platform.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 07.10.2009 00:35:31 von Bill Luebkert

PS: I ran this on XP Pro, Perl 5.8.8 B820 and it didn't get any
errors and filled the array with a list of modules in $imagepath
recursively:

use strict;
use warnings;
use Array::Unique;
use File::Find::Rule;
use Data::Dumper; $Data::Dumper::Indent=1; $Data::Dumper::Sortkeys=1;

my @img_file = ();
tie @img_file, 'Array::Unique';

my $imagepath = shift || './pm'; # default to PM dir
my @imgfolder = File::Find::Rule->file()->name('*.*')->in($imagepath);
print Data::Dumper->Dump([\@imgfolder], [qw(@imgfolder)]);

# remaining code deleted as unlikely cause of problem

__END__

A bad $imagepath just yields an empty array, so unless it's a
problem specific to 5.10 (or whatever build you may be on), I
don't see it. Maybe you could try that and give us your OS
and Perl build.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Error on Perl Module File-Find-Rule when run .pl/and create exe

am 07.10.2009 08:01:51 von Ramkumar

Hi Bill Luebker,

Thanks for your kind response and our list. I got solved. Actual problem in
input arguments. Thanks all again.

Regards,
Ramkumar


-----Original Message-----
From: Bill Luebkert [mailto:dbecoll@roadrunner.com]
Sent: Wednesday, October 07, 2009 4:06 AM
To: ramkumar@premediaglobal.com
Cc: activeperl@listserv.ActiveState.com
Subject: Re: Error on Perl Module File-Find-Rule when run .pl/and create exe

PS: I ran this on XP Pro, Perl 5.8.8 B820 and it didn't get any errors and
filled the array with a list of modules in $imagepath
recursively:

use strict;
use warnings;
use Array::Unique;
use File::Find::Rule;
use Data::Dumper; $Data::Dumper::Indent=1; $Data::Dumper::Sortkeys=1;

my @img_file = ();
tie @img_file, 'Array::Unique';

my $imagepath = shift || './pm'; # default to PM dir
my @imgfolder = File::Find::Rule->file()->name('*.*')->in($imagepath);
print Data::Dumper->Dump([\@imgfolder], [qw(@imgfolder)]);

# remaining code deleted as unlikely cause of problem

__END__

A bad $imagepath just yields an empty array, so unless it's a problem
specific to 5.10 (or whatever build you may be on), I don't see it. Maybe
you could try that and give us your OS and Perl build.


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs