MonkPaul has asked for the wisdom of the Perl Monks concerning the following question:
which then when executed calls up Project1.cgi. Im new to this game so i need some help.... I cant seem to open the file the user chooses. the code for Project 1 is given below. Any help given is taken with an enlightened thanks.print("<form action=Project1.cgi method=POST ENCTYPE=\"multipart\form- +data\">");
Cheers fellow monk buddies.######## # not sure about this my @file =(); my $html = new CGI; my $filehandle = $html->upload('upload'); my $filename = $html->param('upload'); my $line; my @cols; ######## # read through the file and get the sequence sub checkFile() { # print("The path name was: $file"); print("Opening File..."); open( FILE, "<$filehandle") or die("Error opening the file<BR>"); print("File is now open"); @file = <FILE>; print("<BR><BR> @file<BR><BR>"); while($line = <FILE>) { chomp($line); if($line =~ /([^ACGTacgt])/) {next;} else { @cols = split(/\s/, $line); print("@cols"); } close( FILE ) or die("Error closing the file<BR>"); print("File is now closed"); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Upload a file from home dir
by eieio (Pilgrim) on Apr 01, 2005 at 14:44 UTC | |
by MonkPaul (Friar) on Apr 01, 2005 at 14:51 UTC | |
by eieio (Pilgrim) on Apr 01, 2005 at 16:21 UTC | |
|
Re: Upload a file from home dir
by tlm (Prior) on Apr 01, 2005 at 14:59 UTC | |
by MonkPaul (Friar) on Apr 01, 2005 at 15:10 UTC | |
|
Re: Upload a file from home dir
by chromatic (Archbishop) on Apr 01, 2005 at 18:43 UTC |