Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl opening dynamically generated files
    primarykey
    data
    text
    <p>I am using CGI script for my website. And I have problem with opening a dynamically generated file. Here is the code:</p> <pre><code>#!/usr/bin/perl my @output = `/export/es_share/Zhou/./notification_finder.sh range $date $time $range $ulh TestProd1 $actionname`; my $filen = $output[0]; open(my $result, "&lt;", $filen) or die "Can't open $filen - $!"; Do something with the file... </code></pre> <p>Always fails, with the output:</p> <pre><code>Can't open /var/tmp/notification-finder-1375086676-658183725.tmp - No such file or directory at /var/www/cgi-bin/appsupport/logapp_test/perltest.cgi line X. </code></pre> <p>While as this succeeds:</p> <pre><code>#!/usr/bin/perl open(my $result, "&lt;", /var/tmp/notification-finder-1375086676-658183725.tmp) or die "Can't open $filen - $!"; Do something with the file... </code></pre> <p>I have also checked if it was the problem of asynchronous execution of the backticks problem, but from my research on stackoverflow it does not seem to be the issue. I also tried this:</p> <pre><code>#!/usr/bin/perl my @output = `/export/es_share/Zhou/./notification_finder.sh range $date $time $range $ulh TestProd1 $actionname`; sleep(10); my $filen = $output[0]; open(my $result, "&lt;", $filen) or die "Can't open $filen - $!"; Do something with the file... </code></pre> <p>I have found this <a href="https://stackoverflow.com/questions/15798111/issue-with-filepath-name-possible-corrupt-characters">similar issue here</a>, but I don't seem to have the same problem as the asker... Thanks for reading this far.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload