koleti has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl
use LWP::Simple;
my $url = "http://www.hprd.org/edownload/HPRD_FLAT_FILES_090107";
my $file1 = "HPRD_FLAT_FILES_090107.tar";
# get the data
is_success(getstore($url, $file1))
or die "Mark probably broke the server again!\n";
use Archive::Tar;
my $tar = Archive::Tar->new;
$tar->read('HPRD_FLAT_FILES_090107.tar',1);
$tar->extract();
$output = "arch.txt";
# open file
open(FILE, "<\HPRD_FLAT_FILES_090107\PROTEIN_Architecture.txt") or die("Unable to open file");
open(OUTPUT1, ">$output") or die("Unable to open file");
# read file into an array
@hprdArchi = <FILE>;
foreach $line (@hprdArchi){
if ($line =~ s/^/'/ and $line =~ s/\t/','/g and $line =~ s/$/'/){
print OUTPUT1 " $line ";
}
}
the error i am getting is
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem opening file
by moritz (Cardinal) on Jan 10, 2008 at 17:39 UTC | |
by Fletch (Bishop) on Jan 10, 2008 at 18:00 UTC | |
by hipowls (Curate) on Jan 10, 2008 at 21:00 UTC | |
by koleti (Novice) on Jan 10, 2008 at 19:10 UTC | |
by Fletch (Bishop) on Jan 10, 2008 at 19:29 UTC | |
|
Re: problem opening file
by graff (Chancellor) on Jan 11, 2008 at 02:59 UTC |