All Questions
152
questions
2
votes
2
answers
229
views
In perl is \*STDIN the same as STDIN?
I'm the author of Pythonizer and I'm trying to translate the code of CGI.pm from the standard perl library to Python. I came across this code in read_from_client:
read(\*STDIN, $$buff, $len, $offset)
...
1
vote
0
answers
140
views
Perl threads, sockets and STDIN interference
I am trying to use a perl threads and sockets, to create a simple client/server application. The problem comes in client side, when trying to mix STDIN with socket reading in different threads. Note, ...
1
vote
1
answer
84
views
Perl: execute another program with a copy of STDIN
I have a Perl CGI script that redirects to other Perl CGI scripts. Which script is redirected to, depends on the contents of data posted with "POST".
So my redirect script reads STDIN:
read( ...
1
vote
1
answer
88
views
Run a second script, passing STDIN
Clickbank (and others) post an IPN message to the URL address on the domain / server. Presumably, the data goes to <STD IN>, and the script processes. I'm on Windows / Strawberry Perl, and can ...
0
votes
1
answer
216
views
Save STDIN to file in Perl?
I'm trying to use Perl to:
wait until at least 1 byte arrives on STDIN
read all of STDIN and save it to a file as binary (to be UTF-8 compatible)
My attempts:
# read STDIN into a string/buffer and ...
1
vote
1
answer
215
views
How to write a test to confirm that a perl script waits (or doesn't wait) for interactive user input (based on supplied options)
I have a perl script for which I would like to write a few tests. If the perl script gets supplied a specific option, the user is allowed to paste or type out multi-line input and end their input ...
2
votes
1
answer
57
views
Harvesting repository // "From=>" and "Until=>" with user input variable
I am using „from=>“ and “until=>” while harvesting a repository with OAI-PMH written in Perl. I tried to let the user type in start- and end-date with <STDIN> in format yyyy-mm-dd. But ...
1
vote
1
answer
125
views
How can I get a streaming effect like a pipe open with IPC::Run3?
Given the following code, the user will see it printed 3 times, one time a second "Hello World!".
#!/bin/perl
$| = 1;
use feature ':5.10';
use strict;
use warnings;
use constant PERL_SCRIPT ...
6
votes
2
answers
215
views
What does local do on the standard streams / bareword word filehandles: STDIN?
I was thinking about doing
open(*STDIN, "<", "/dev/null" );
open(my $fh, "-|", "/bin/bash", "/tmp/foo");
print for <$fh>;'
However, I would ...
1
vote
0
answers
120
views
Parallel::ForkManager gives - child process STDIN is not a real system Error
I have a script which does ssh to number if servers(@hosts) stored in an array and executes certain commands on those hosts.
...
use Net::OpenSSH;
use Parallel::ForkManager;
#these hosts are the IP ...
3
votes
1
answer
97
views
Why does the program shown in "7.2.39 IPC::Open2" of Programming Perl actually ends?
The program I am referring to is the second program shown in this section here. A small modification of it is:
#!/usr/bin/perl -w
use IPC::Open2;
use Symbol;
$WTR = gensym(); # get a reference to a ...
3
votes
2
answers
387
views
In a single Perl script, can I close and re-open STDIN?
I want to write perl scripts that can read the STDIN that is given at invocation of the script, finish reading it, and then interactively prompt the user for a one-line STDIN. This one-line STDIN will ...
1
vote
0
answers
113
views
How to preserve the history for STDIN for Perl?
I am using STDIN to fetch user input as below. Is there a way to preserve the history from the previous run? That is after terminated the program and rerun, I still can use up arrow key to get back ...
1
vote
2
answers
304
views
How to make User Input (STDIN) to move left and right in PERL - Unix Env
i'm a newbie in PERL. Whenever i tried to move left or right to delete characters in terminal it shows "^[[D^[[C^[[C^[[D". Is there a way to make User Input (STDIN) to scroll left and right to delete ...
0
votes
2
answers
244
views
why does perl while (<>) fail to count or print the first line
I want to count the lines in a file and print a string which depends on the line number. But my while loop misses the first line. I believe the while (<>) construct is necessary to increment the ...