Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

hii monks, nyc to meet u in this discussion and thanks in advance for helping in this

Problem: here with this script am unable to make a directory , am running it as cgi, please help me in this

#!/usr/local/bin/perl -w print "Content-type:text/html\n\n"; use File::Copy; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); #use strict; my($jobname,$sequence,$temperature,$sodium,$folding,$magnesium,$label, +$window); my(@folder_name,$temp1,$temp2); #my(@argument); $jobname = param('jobname'); $sequence = param('sequence'); $temperature = param('temperature'); $sodium = param('sodium'); $folding = param('folding'); $magnesium = param('magnesium'); $label = param('label'); $window = param('window'); 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(my @folder_name,<TWO>); close TWO; #print $folder_name[0],"\n", $folder_name[1]; $temp1 = pop(@folder_name); $temp2 = pop(@folder_name); if($temp1 < 30050) { mkdir "/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1",0775 +; open DAT,">","/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1/$j +obname" || die "Can't open the file "; print DAT my $sequence; print ($temp2,$temp1,$jobname); close DAT; my $location = "/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1" +; my $file1 = "unafold2.cgi"; copy $file1,$location || die "File cannot be copied."; system("chmod 777 $location/$file1"); $temp1++; open THREE,">","/var/www/html/piRNA_html/UNAFold/output_folder_2. +txt" || die "Can't open the file"; #print THREE $temp1; close THREE; } else { $temp1 = 30001; $temp2++; mkdir "/var/www/html/piRNA_html/UNAFold/output/$temp2",0777; mkdir "/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1",0777 +; open DAT,">/var/www/html/piRNA_html/UNAFold/output/$temp2/$tem +p1/$jobname" || die "Can't open the file "; print DAT $sequence; close DAT; my $location = "/var/www/html/piRNA_html/UNAFold/output/$temp2/$temp1" +; my $file1 = "unafold2.cgi"; copy $file1,$location || die "File cannot be copied."; system("chmod 777 $location/$file1"); $temp1++; open FOUR,">/var/www/html/piRNA_html/UNAFold/output_folder_2.txt" +|| die "Can't open the file"; print FOUR $temp1; close FOUR; open FIVE,">/var/www/html/piRNA_html/UNAFold/output_folder_1.txt" +|| die "Can't open the file"; print FIVE $temp2; close FIVE; }

In reply to problem in mkdir by MVRS

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-16 20:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found