I think the previously defined script was confusing, this is the script I want to run now that does not create a directory, please help me with this.
I am not mistaken if the code is idiotic, since I'm just a beginner in perl. Could you suggest me the correct approach for this script, and if I get any errors?
output_folder1.txt
contains 10010
, and output_folder.txt_2
contains 30001
.
I get the output file could not be created.
#!/usr/local/bin/perl -w use strict; print "Content-type:text/html\n\n"; my(@folder_name,$temp1,$temp2); open ONE,"<","/var/www/html/piRNA_html/UNAFold/output_folder_1.txt" || die "Cannot open the file"; @folder_name=<ONE>; close ONE; open TWO,"<","/var/www/html/piRNA_html/UNAFold/output_folder_2.txt" || die "Cannot open the file"; push(@folder_name,<TWO>); close TWO; print $folder_name[0],"\n",$folder_name[1],"\n"; $temp1 = pop(@folder_name); $temp2 = pop(@folder_name); if($temp1 < 30050) { mkdir "/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1",0777 or die "File cannot be created"; }
source share