On Sat, 28 Jun 2003, fuzzy wrote:
> i need to know how do file i/o.
>
> i know c, c++, php, 5 different vb, so i'm not new to programming, just
> to perl.
>
> i'm going to be send stuff to this script using a html form via ACTION=,
> so i need to know how to pull them in, smush them into a string in a
> format and write it (in append mode) to a file. i know how to do this in
> php, but php runs as 'nobody' and i dont want to leave this file with
> world write access
>
> here's the final format i need
> 00-00-00,00:00,file.ext,"title with spaces in quotes"
>
> the first part is a date
> second is a time
> 3rd is a file name
> fourth is a string in quotes, the quotes are important
>
> in php i would use
> $outout = sprintf("%s,%s,%s,\"%s\"", $date, $time, $file, $title);
>
This will work in Perl as well.
To write it to a file, use the following code:
open O, ">>myfile.txt"; ## >> is for append
print O $outout;
close(O);
For more information refer here:
http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/files/
http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture4/system-funcs/
perldoc perlopentut
Regards,
Shlomi Fish
> someone please help
>
> -fuzzy
>
>
>
----------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Home Page: http://t2.technion.ac.il/~shlomif/
An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.
Falk Fish
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]