Tag Archives: perl

Return Perl-output to PHP

Questions: I want to return the output of a perl script to a webpage. However it only returns the last line. Perl script: my $directory = $ARGV[0]; opendir(DIR,$directory); my @files = grep {/\.txt$/ } readdir(DIR); closedir(DIR); foreach(@files) { print $_.”\n”; } PHP code: $perl_result = exec(“perl $script_folder $project_folder”); *some code* <?php print $perl_result; ?> Expected… Read More »

How to properly display Chinese characters in PHP?

Questions: I have these Chinese characters: 汉字/漢字”test If I do echo utf8_encode($chinesevar); it displays ??/??”test Or even if I just do a simple echo $chinesevar it still displays some weird characters… So how am I going to display these Chinese characters without using the <meta> tag with the UTF-8 thingy .. or the ini_set UTF-8… Read More »

TripleDES in Perl/PHP/ColdFusion

Questions: Recently a problem arose regarding hooking up an API with a payment processor who were requesting a string to be encrypted to be used as a token, using the TripleDES standard. Our Applications run using ColdFusion, which has an Encrypt tag – that supports TripleDES – however the result we were getting back was… Read More »

PHP source code in UTF-8 files; how to interpret properly?

Questions: I build tools to analyze source code. Such tools have to read the source code files correctly, especially as regards character encodings. For example, “What is the precise string of bytes in a string literal?” (both PHP literals, and HTML text). My perhaps erroneous understanding is that PHP source files are 8-bit character only… Read More »

How To Properly Create Domain using Zend Framework?

Questions: I asked this question a while back but now I’m looking to implement an actual separation between my database access layer and the domain layer. I am also going to be working to move business logic into the domain where it belongs and out of the controller scripts. I’m using Zend Framework which implements… Read More »