473,583 Members | 3,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unix pipes to perl scripts

Got a problem piping command output to a perl script, in the test below
the loop accepts the piped files but it also interferes with my STDIN!

===test======== =============== ======
$ls -1 *.cfg | ./pp
ls -1 *.cfg | ./pp
file: hosts.cfg
file: pseries.cfg

type something : you typed :
===test======== =============== ======

I do not get the chance to type something in after "type something"...

Do i have to flush some variable inbetween the foreach loop and
Is looping trough <ARGV> or <> the best way to catch piped input?

===code======== =============== ======
$cat ./pp

while ( <ARGV> ) {
print "file: $_";

print "\ntype something : ";
$answer = <STDIN>;
print "you typed : $answer \n";
===code======== =============== ======


Jul 19 '05 #1
1 4312
how about this

$ls -1 *.cfg | perl -ne '
print "file: $_";
while(<> ){
print "file: $_";
print "\ntype something : ";
$answer = <STDIN>;
print "you typed : $answer \n";

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Sandman | last post by:
The subject says it all. I am doing a: I have a perl script in which I am using a ReadParse routine that parses the $ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'} which are two variables passed to the script under usual SSI (.shtml) containing form data submitted to the page from which the script is executed from. Well, since switching to...
by: rk | last post by:
Hi, I'm looking for some kind of software which can give cgi/perl scripts autmatically based on the user input to the web page so that each web page can be made dynamic page once the software gives the server side scripts. Immediate responsed on this highly appreciated. Thanks
by: Bill Cunningham | last post by:
Can one (I know nothing about perl but I'm looking since xml) write perlscripts for a brower as such? <script language="perlscript" > Does this exist? Bill
by: Gaizer | last post by:
I need to be able to use my perl scripts that use use XML::RSS; use XML::Parser; I have already installed an Apache server and LWP. I am using Windows XP. What should I install now for the above XML capabilities? And where can I find these XML programs? Thanks a million!
nimisha m
by: nimisha m | last post by:
what are setuid/setgid perl scripts?
by: fungazid | last post by:
Hello guys, I have a Perl script that calls other Perl scripts: ### Main script: ### my @command; $command="step1.pl"; $command="step2.pl";
by: ratcateme | last post by:
I am using apache 2.2.4 and perl 5.8.8 on Ubuntu 7.10 I am creating a website mainly in PHP but i have a few perl scripts i want to run. I am running a simple script but get this error a Internal Server Error 500 the apache error.log file says: (2)No such file or directory: exec of '/var/www/cgi-bin/test.cgi' failed Premature end of...
by: jagjot | last post by:
hey Can anybody tell me How to convert my perl scripts in binary executables? Which command should I make use of? Please revert back as soon as possible and if possible drop me a mail at EMAIL REMOVED
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX interprocess controls and communication, locale determination, EBCDIC/ASCII discrimination, etc. Almost all of these are easy in Perl. Why isn't there a...
by: happyse27 | last post by:
Hi All, How create OOP perl scripts and how to let users select different ouput html template to display the photo that they upload? Including the urls to refer to. Kindly advise... Cheers..
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.