Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -slw
    
    use strict;
    use warnings;
    
  2. or download this
    opendir DH, "Y://perlscripts2/software/perl2/music" or die $!; # open 
    +current directory
    while($_ = readdir(DH)){
        # don't evaluate special dirs '.' & '..'
        next if $_ eq "." or $_ eq "..";
    
  3. or download this
        if ($_ =~ /\.txt/){
            chomp $_;
    ...
        print "$_"; # print this file/directory's name
        
        }
    
  4. or download this
    #! perl -slw
    use strict;
    ...
    print Dumper \%albums;
    __END__