Skip to main content

All Questions

Tagged with
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) ...
snoopyjc's user avatar
  • 633
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, ...
armagedescu's user avatar
  • 2,069
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( ...
Zippy1970's user avatar
  • 641
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 ...
Cristofayre's user avatar
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 ...
Zack Morris's user avatar
  • 4,783
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 ...
hepcat72's user avatar
  • 1,037
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 ...
Pedro's user avatar
  • 61
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 ...
Evan Carroll's user avatar
  • 81.6k
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 ...
Evan Carroll's user avatar
  • 81.6k
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 ...
vkk05's user avatar
  • 3,222
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 ...
Enredanrestos's user avatar
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 ...
Jacob Wegelin's user avatar
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 ...
Sam's user avatar
  • 1,317
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 ...
Sanchez's user avatar
  • 11
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 ...
Jacob Wegelin's user avatar

15 30 50 per page
1
2 3 4 5
11