Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Push from filefind into structure

by mbethke (Hermit)
on Feb 03, 2012 at 03:46 UTC ( #951592=note: print w/replies, xml ) Need Help??


in reply to Push from filefind into structure

The problematic line is this:

$self->{found_files} = @found_files;

$self->{found_files} is a scalar and thus provides scalar context to the right side. So @found_files evaluates to the number of its elements, but you'll later treat it like an array reference. Just put a backslash in front of it to take its reference. The array is a copy of the arguments already so saying ... = [ @found_files ]; would do too but do extra needless copying.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951592]
help
Chatterbox?
[FloydATC]: Is CPAN down?!?
[FloydATC]: I get a 404 for www.perl.com/CPAN
[choroba]: http://cpan.org
[FloydATC]: perl -MCPAN and the cpan command uses www.perl.com/CPAN

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-01-24 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (256 votes). Check out past polls.

    Notices?