Hello all
i am in ned of help with getting a cgi script to output to a flat file
with out the use of a cron job whis is what ive ben using as such

perl /[path to cgi file]/vfx.cgi > /[path to plx folder]/vfx.txt

can i add a line of code to the existing script to get this result? and if so which line and where?

i am asking this and researching it at the same time abey ill find an answer else where yet any info would be helpful

thanks in advance

solocky

Use the open() function to open a file in the CGI script to print data to the file. Something like:

open(my $IN, ">>", "path/to/vfx.txt") or die "$!";
print $IN "some data\n";
close ($IN);

>> = creates or appends to file
> = creates or overwrites file

See the open functions manpage or perlopen

Use the open() function to open a file in the CGI script to print data to the file. Something like:

open(my $IN, ">>", "path/to/vfx.txt") or die "$!";
print $IN "some data\n";
close ($IN);

>> = creates or appends to file
> = creates or overwrites file

See the open functions manpage or perlopen

Thanks works perfect

ciao
solocky

Flat files such as CSV (comma-separated values) and text documents are employed by many different applications and are often used as an exchange format between dissimilar programs. As companies continue to expand and grow through globalization and mergers and acquisitions, the ability to programmatically integrate or convert this semi-structured data into other prevalent formats is a common requirement.

Many organizations continue to utilize legacy software that can no longer be modified, but produces useful output in the form of text files. Integrating these applications into a modern computing environment can be challenging. The structure of flat files and text documents varies from application to application, making processing and integrating this data with other data formats increasingly difficult.

Thanks for the speech.... I guess.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.