From: stic <[EMAIL PROTECTED]>
> 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. thanks a lot.
Ahoj,
in a bit less idiomatic Perl it could be.
my @dir_contents = readdir $OBSAH;
# read all files
@dir_contents = grep !/\A\.\.?\z/, @dir_contents;
#or
@dir_contents = grep !/^\.\.?$/, @dir_contents;
# remove the . and .. directory entries
# I'd have to think for a minute myself before I'd remember
# what does the \A and \z mean.
foreach (@dir_contents) {
if (-d "$cesta/) {
push @obsah2, $_
} else {
push @obsah3, $_
}
}
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>