Lemme paint the picture.
U are hosting a perl script that returns client data. I create a web form to query the script directly and results are given back in html format on the screen.
It all works 100%
Now I dont want it in html format on the screen anymore. I want the results to be saved in a file of any readable type.
Remember I cant change the script because you have it on your server. I need to adjust my query if possible to accept the data returned into a file.
PLEASE HELP!!
Saving Perl Script output to file
Saving Perl Script output to file
All that glitters is not gold,
all those who wander are not lost...
JRR TOLKIEN
all those who wander are not lost...
JRR TOLKIEN
-
- Registered User
- Posts: 304
- Joined: 29 Jun 2004, 02:00
- Location: Where the mind is
-
- Registered User
- Posts: 4
- Joined: 14 Mar 2003, 02:00
- Location: Bloemfontein
Hi!!
Here is the scripts to write to, and read from a text file in pearl. You can just insert the code into your pearl document:
# write data to a text file
open( FILE, ">>records.txt" );
print( FILE "$firstName, $lastName, $email, $phone\n" );
close( FILE );
# read data from text file
open( FILE, "records.txt" ) or
die( "The database could not be opened." );
print("All records in records.txt",(br),(br));
while ( $line = )
{
chomp( $line );
( $firstName, $lastName, $email, $phone ) = split( ",",
$line );
print($firstName, $lastName, $email, $phone
}
close( FILE );
Hope this helps!!
Here is the scripts to write to, and read from a text file in pearl. You can just insert the code into your pearl document:
# write data to a text file
open( FILE, ">>records.txt" );
print( FILE "$firstName, $lastName, $email, $phone\n" );
close( FILE );
# read data from text file
open( FILE, "records.txt" ) or
die( "The database could not be opened." );
print("All records in records.txt",(br),(br));
while ( $line = )
{
chomp( $line );
( $firstName, $lastName, $email, $phone ) = split( ",",
$line );
print($firstName, $lastName, $email, $phone
}
close( FILE );
Hope this helps!!
-
- Registered User
- Posts: 4
- Joined: 14 Mar 2003, 02:00
- Location: Bloemfontein