English 中文(简体)
PHP通过变量到Perl,在使用变量方法之间的空间时有问题,是否有另一个更好的途径?
原标题:PHP passing variables to Perl, having issues with using spaces between variables method, is there another, better way?

我认为,我需要更多地使用Perl,因为PHP的定期表达使我怀疑,他们会半途而废(例如,当我使用Perl时就是这样)。 i)在使用这种方法时常使用(在一开始尝试使用定期表达方式之前)。 我很想知道,这样做的最好办法,是否比在永久档案名称方法之后的变数,因为这种方法似乎有一些明显的相似之处。 感谢任何信息。

我目前这样做的方式:

$file = "/pathtomy/perlscript.pl $var1 $var2 $var3" ;
    ob_start();
passthru($file);
$perlreturn = ob_get_contents();
ob_end_clean();
return $perlreturn;
最佳回答

使用引号:

$file = "/pathtomy/perlscript.pl  $var1   $var2   $var3 " ;
问题回答




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签