Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
$dirPath = "/path/do/Dir";
opendir DIR,"$dirPath" or die "Error Message:$!\n";
@filesToRead = (grep/somePattern/i,readdir DIR);
closedir DIR;
if (@filesToRead) {
for ($i=0;$i<=(scalar @filesToRead);$i++) {
Several Options can go here, depending on your OS.
}
} else {
print "Error Message.\n";
}
$dirPath = "c:/d_melanogaster/";
opendir DIR,"$dirPath" or die "Error Message:$!\n";
@filesToRead = (grep/N/i,readdir DIR);
closedir DIR;
open(DEST,">destination.fil") or die "cant open destination.fil";
if(@filesToRead) {
for(@filesToRead){
open(SRC,$_) or die "cant open $_";
while(<SRC>) {
print $_;
}
close SRC;
}
}else{
print "Error Message.\n";
}
use strict;
use warnings;
my $dirPath = 'c:/d_melanogaster/';
opendir DIR, $dirPath or die "Error Message: $!\n";
my @filesToRead = (grep/N/i,readdir DIR);
closedir DIR;
open(DEST,">>", "your/path/to/outputfile") or die "cant open destination.fil: [red]$![/red]";
for(@filesToRead){
open(SRC,$_) or die "cant open $_: [red]$![/red]";
print DEST <SRC>;
close SRC;
}
use strict;
use warnings;
my $dirPath = 'c:/d_melanogaster/';
opendir DIR, $dirPath or die "Error Message: $!\n";
my @filesToRead = (grep/N/i,readdir DIR);
closedir DIR;
open(DEST,">>", "your/path/to/outputfile") or die "cant open destination.fil: $!";
for(@filesToRead){
open(SRC,[red]$dirpath.[/red]$_) or die "cant open [red]$dirpath[/red]$_: $!";
print DEST <SRC>;
close SRC;
}
so the reason, the first attempts fail is because I did not specify the path to my directory?