Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: flat file problem

by PodMaster (Abbot)
on Oct 28, 2004 at 08:07 UTC ( [id://403301]=note: print w/replies, xml ) Need Help??


in reply to flat file problem

When I run from the form (on submit), it does not create or write to flatfile.data, however a confrimation email is sent and everything else is fine.
Thats hard to believe :) You've made an assumption somewhere, and you're not checking something you should be. Its impossible to tell you what without seeing more. Maybe you're not pointing to the right cgi, maybe you're checking the wrong log, maybe flatFile doesn't get called, maybe you're in a chroot jail and /tmp/flatfile.data is really /tmp/apachejails/username/tmp/flatfile.data .... look into using Devel::Trace (or similar) or just start sprinkling around print/warn statements to verify that what you believe is going on, is actually going on.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: flat file problem
by csuhockey3 (Curate) on Oct 28, 2004 at 08:25 UTC
    Was I naive in doing this?
    $working_dir = $0; $working_dir =~ s#(.*)/.*$#$1#; chdir $working_dir;
    Honestly, on submit, I get a confirmation page and an email, but no flat file (that's why I am pulling my hair out). I also made certain it was the correct cgi. I have never had a flat file give me fits like this! I might have to dig deeper into this new development server, I will run Devel::Trace right now.

    update:BINGO! It was a problem with the development server. I had the form on the production side and the cgi on the development side. After running Devel::Trace I saw where everything was going and that solved the problem (once the flatfile was created manually and placed on production side, it worked). Thank you all for the help.
      Yes, but not for reasons you may think :) The proper way to determine the directory where your file resides is using File::Spec->dirname( File::Spec->rel2abs(__FILE__)) (dirname not official part of File::Spec, get it from here). chdir would not affect sub flatFile because it uses an absolute path.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://403301]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-19 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found