stic wrote: > Yeah, very very thank for help, now it`s making exactly what i want. > but could you please explain what all this one line do? > > push @{ -d "$cesta/$_" ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, $_ for grep > !/\A\.\.?\z/,readdir $OBSAH; > > I`m absolute begginer in perl and can`t decrypt this line:D and i`m very > interested to.
readdir $OBSAH This reads the file names from the directory and as this is in list context it returns a list of all the file names. grep !/\A\.\.?\z/, The list is filtered through grep which only passes through file names that are not equal to '.' or '..'. for This is a statement modifier for "loop". It iterates through the list on the right and puts each file name in the $_ variable. push @{ -d "$cesta/$_" ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, $_ @obsah2 and @obsah3 are the arrays that you want to push the file names into, directories into @obsah2 and non-directories into @obsah3. The conditional operator determines which of the arrays the current file name will be pushed into and a reference to either array is then dereferenced and the current file name is pushed into the correct array. HTH John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>