in reply to who can help me for a very interesting perl program
Perl's map does exactly what it says on the tin: it maps one set of values to another (yeah sure, depends on what you mean by map). Hash gets returned at the last line of your else because you call it (you know that single line with only hash on it). unshift is used to to put a value at the beginning of an array. so the line you do not understand can be rephrased as (keeping in mind that we evaluate from right to left):
tmparray being an array of array refs each containing two values: one from new paths and an array_ref.my @tmparray = map{[$_,$hash]} @new_paths; unshift @queue,@tmparray;
|
|---|