| killer_ | how do I print to it? open (FH, ">$fh) ? |
| f00li5h | killer_: no. |
| thrig | print $fh "yadda\n"; |
| f00li5h | killer_: print $fh "stuff" |
| killer_ | ok and how do I close it.. |
| f00li5h | killer_: just let it go out of scope |
| killer_ | close ($fh) |
| f00li5h | killer_: or call close ( $fh ) |
| peshalto | heh |
| killer_ | hmm.. |
| thrig | print $fh "dum dee doo\n" or die "whoa! something very not right with system: $!" |
| f00li5h | s/ (/(/ |
| peshalto | found a web host that offers perl with a $9.99 account, and for a $19.99 account, you get "perl syntax checker" |
| f00li5h | killer_: http://search.cpan.org/~tjenness/File-Temp-0.18/Temp.pm#OBJECT-ORIENTED_INTERFACE |
| shorten | f00li5h's url is at http://xrl.us/vddu |
| peshalto | guess they don't know about -c |
| f00li5h | peshalto: i think the "perl syntax checker" is a person they pay to read your code |
| peshalto | haha |
| killer_ | f00li5h: I have this $fh = new File::Temp( TEMPLATE => $prefix, DIR => $SCOREDIR, SUFFIX => '.txt'); and I need to use it in a few subroutines |
| f00li5h | killer_: use what? the file? |
| killer_ | f00li5h: use the filename that is created |
| saaib | killer_, $filename is not a string dude, File::Temp returns an object reference not a scalar |
| thrig | pass the filehandle around |
| f00li5h | killer_: use the file handle, right? killer_: why do you want to use the /name/? |
| killer_ | saaib: that would be my problem |
| f00li5h | you don't want to open it bundles of times |
| killer_ | I need to open the file to print to it, then I need to save the filename in the mysql db |
| saaib | killer_, yes, when you're trying to open (), the reference to $filename is not the file path name is an object so, you might want to check the code return from open it obviously doesn;t die |
| thrig | why save some data outside MySQL? |
| killer_ | so if I don't "open(), and just print $fh ""; the file should get created.. then I can open() it in another sub if needed |
| saaib | $VAR1 = bless( \*{'File::Temp::$fh'}, 'File::Temp' ); |
| killer_ | ok.. I also need $fh to be changed from a reference to the actual string so I can store it in the mysql db, how do I do this |
| saaib | correct, you can use $filename as a file handle |
| killer_ | saaib: f00li5h: cool... I added print $fh ""; after $fh = new File::Temp.... and it works |
| f00li5h | thrig: derrived data doesn't go in your database |
| killer_ | still puzzled why I have no commandline output "Content-type: text/html" it works from the browser I get a correct page display |