Skip Menu |

This queue is for tickets about the IPC-DirQueue CPAN distribution.

Report information
The Basics
Id: 21312
Status: resolved
Priority: 0/
Queue: IPC-DirQueue

People
Owner: Nobody in particular
Requestors: amling [...] uiuc.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: IPC::DirQueue bug?
Date: Mon, 4 Sep 2006 03:30:34 -0500
To: bug-IPC-DirQueue [...] rt.cpan.org
From: Keith Amling <amling [...] uiuc.edu>
As of IPC::DirQueue 0.07, I find that in an empty directory: Show quoted text
> $ perl -e 'use IPC::DirQueue; my $q = IPC::DirQueue->new({"dir" => "q"}); $q->visit_all_jobs(sub { });' > Can't use an undefined value as an ARRAY reference at /usr/lib64/perl5/vendor_perl/5.8.8/IPC/DirQueue.pm line 1216.
The bailing line is attempting to interpret the return from get_dir_filelist_sorted as an array ref, and it seems for an empty queue there is no returned array ref: Show quoted text
> sub get_dir_filelist_sorted { > my ($self, $dir) = @_; > > if (!opendir (DIR, $dir)) { > return (); # no dir? nothing queued > } > # have to read the lot, to sort them. > my @files = sort grep { /^\d/ } readdir(DIR); > closedir DIR; > return \@files; > }
Should that "return ()" maybe be a "return []"? Keith
From: JMASON [...] cpan.org
Show quoted text
> Should that "return ()" maybe be a "return []"?
yes, it definitely should. Thanks! that's now in svn... Sending lib/IPC/DirQueue.pm Transmitting file data . Committed revision 6840.
marking resolved