mkdir function syntax

2001-02-27 Thread Chris Jensen

greetings everyone,

i've got a solution that requires me to create directories when a record is added to a 
database (in this case i'm using Lasso WDE on a WebTen webserver, which is a port of 
apache to mac.  full perl 5 capability).  problem is i've only had the last 3 days to 
learn anything at all about Perl, and i need something by tomorrow AM.

here is my code:

1   #!/usr/bin/perl
2
3   use CGI use_named_parameters,a;
4
5
6   # Grab information from form
7
8   $query = new CGI;
9   $ProjectNumber  =   $query-param("ProjectNumber");
10
11  $makeDirectoryDocs = "../WebSites/mch.nvisionusa.net/docs";
12  $makeDirectoryImages = "../WebSites/mch.nvisionusa.net/docs";
13
14  MKDIR ($makeDirectoryDocs$ProjectNumber);
15
16  MKDIR ($makeDirectoryImages$ProjectNumber);
17
18  print EOF; #Print start of pop-up window
19
20  html
21  headtitleProcessing/title/head
22  body bgcolor="#ff" 
onLoad="document.location.href='categories.mch?ProjectNumber$ProjectNumber';"
23  /body
24  /html
25
26
27
28  EOF

the error i get currently is:

Scalar found where operator expected at /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi 
line 14, at end of line
(Missing operator before ?)
syntax error at /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi line 14, near 
"$makeDirectoryDocs$ProjectNumber"
Scalar found where operator expected at /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi 
line 16, at end of line
(Missing operator before ?)
syntax error at /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi line 16, near 
"$makeDirectoryImages$ProjectNumber"
Execution of /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi aborted due to compilation 
errors.
[Tue Feb 27 16:16:15 2001] access to /usr/local/etc/httpd/cgi-bin/psr_mkdir.cgi failed 
for 208.131.27.12, reason: Premature end of script headers

if someone can give me some insight on this that would be frikkin awesome!  i'm sure 
it's something stupid that my newbie skills can't figure out (perl in a nutshell isn't 
as easy to absorb as i thought!), so school me please!

thanks and hello,
chris
-- 
---
c h r i s t o p h e r . a . j e n s e n
---
n Vision/usa inc.
w: http://www.nvisionusa.com
e: [EMAIL PROTECTED]
p: 6164566566
f: 6164566599





[OT] Re: mkdir function syntax

2001-02-27 Thread Adi Fairbank

Chriss,

Please mark your subject [OT] for off-topic in the future, as this is not a
mod_perl question, but a general Perl question and probably should be taken to
one of the comp.lang.perl.* newsgroups anyway.

In the good natured spirit of the mod_perl community, I'll answer the question
anyway.


replace

14  MKDIR ($makeDirectoryDocs$ProjectNumber);
15
16  MKDIR ($makeDirectoryImages$ProjectNumber);

with 

14  mkdir ($makeDirectoryDocs.$ProjectNumber, 0755);
15
16  mkdir ($makeDirectoryImages.$ProjectNumber, 0755);

On my platform, mkdir must be lowercase, but maybe not on yours.  It also
requires a second MODE parameter, but likely not on the mac.


You'll also need to change

22  body bgcolor="#ff"
onLoad="document.location.href='categories.mch?ProjectNumber$ProjectNumber';"

to

22  body bgcolor="#ff"
onLoad="document.location.href='categories.mch?ProjectNumber=$ProjectNumber';"

in order for CGI.pm to get your ProjectNumber correctly.

-Adi




Re: mkdir function syntax

2001-02-27 Thread Cees Hek

On 27 Feb 2001, Chris Jensen wrote:

 here is my code:
 
 8   $query = new CGI;
 9   $ProjectNumber=   $query-param("ProjectNumber");
 10
 11  $makeDirectoryDocs = "../WebSites/mch.nvisionusa.net/docs";
 12  $makeDirectoryImages = "../WebSites/mch.nvisionusa.net/docs";
 13
 14  MKDIR ($makeDirectoryDocs$ProjectNumber);

The problem is with the way you are trying to join 2 strings together.

One of the following should work for you:

mkdir ("$makeDirectoryDocs$ProjectNumber");
mkdir ($makeDirectoryDocs.$ProjectNumber);
mkdir (join '', $makeDirectoryDocs, $ProjectNumber);


-- 
Cees Hek
SiteSuite Corporation
[EMAIL PROTECTED]