Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: flat file problem

by csuhockey3 (Curate)
on Oct 28, 2004 at 08:25 UTC ( #403307=note: print w/replies, xml ) Need Help??


in reply to Re: flat file problem
in thread flat file problem

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.

Replies are listed 'Best First'.
Re^3: flat file problem
by PodMaster (Abbot) on Oct 28, 2004 at 08:49 UTC
    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
Node Status?
node history
Node Type: note [id://403307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2021-01-23 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?