Jump to content
xisto Community
Sign in to follow this  
xsize

Perl Programms First, second, ...

Recommended Posts

My 3th Perl Programm

The current dir show...

[br]#!/usr/local/bin/perl[br][/br]# dir path [/br]$sdir='.';[br]opendir(DIR,$sdir) || die "can't opendir $some_dir: $!";[/br]@dots = grep {-d "$sdir/$_"} readdir(DIR);[br]rewinddir(DIR);[/br]@fils = grep {-f "$sdir/$_"} readdir(DIR);[br]foreach (@dots){[/br] print "$_\n";[br]}[/br]foreach (@fils){[br] print "$_\n";[br]}[/br]closedir DIR;[/br]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.