Re: newbie pipe stdin to sendmail

2016-11-02 Thread Mark Coetser
On 02/11/2016 22:14, Andy Bach wrote: #!/usr/bin/perl my $vacation_forward = 'vacat...@domain.com '; open(OUT, "|/usr/sbin/sendmail $vacation_forward") or die ("Can't sendmail - $!"); my $email_addr_to = ''; while ( <>) { $email_addr_to = $1 if /^To: (.*)$/; print

Re: newbie pipe stdin to sendmail

2016-11-02 Thread Mark Coetser
On 02/11/2016 19:35, Andy Bach wrote: On Wed, Nov 2, 2016 at 9:13 AM, Mark Coetser mailto:m...@tux-edo.co.za>> wrote: $parser->ignore_errors(1); $parser->output_to_core(1); my $entity = $parser->parse(\*STDIN); my $error = ($@ || $parser->last_error);

newbie pipe stdin to sendmail

2016-11-02 Thread Mark Coetser
/mailfile | sendmail t...@test.com This is what I have so far, I can print the To address fine but for some reason I am just receiving a blank email as if STDIN isnt outputting anything? There are a couple of hashed out variations I have tried already #!/usr/bin/perl use strict; use warnings

ssh key via stdin: perl vs bash

2014-07-19 Thread gator_ml
Hi, I was trying to embed a ssh key in a script and pass it via stdin (unfortunately not directly supported by ssh). Investigating ways how this can be done, I ran into a curiosity. With bash, the following does about what I need: #!/bin/bash ssh -i /dev/stdin luser@localhost ls <&a

ssh key via stdin: perl vs bash

2014-07-19 Thread gator_ml
Hi, I was trying to embed a ssh key in a script and pass it via stdin (unfortunately not directly supported by ssh). Investigating ways how this can be done, I ran into a curiosity. With bash, the following does about what I need: #!/bin/bash ssh -i /dev/stdin luser@localhost ls <&a

ssh key via stdin: perl vs bash

2014-07-19 Thread gator_ml
Hi, I was trying to embed a ssh key in a script and pass it via stdin (unfortunately not directly supported by ssh). Investigating ways how this can be done, I ran into a curiosity. With bash, the following does about what I need: #!/bin/bash ssh -i /dev/stdin luser@localhost ls <&a

Re: 3-argument open on STDIN

2011-08-23 Thread Bryan R Harris
"Bryan" == Bryan R Harris writes: >>> >>> Bryan> How can I use the "safe" 3-argument open and still be able to read >>> off >>> a >>> Bryan> pipe? >>> >>> You don't. 2-arg open has to be good for something. >>> >>> And 2-arg open is perfectly safe if the second arg is a literal: >

Re: 3-argument open on STDIN

2011-08-23 Thread Rob Dixon
On 23/08/2011 04:17, Bryan R Harris wrote: "Bryan" == Bryan R Harris writes: Bryan> How can I use the "safe" 3-argument open and still be able to read off a Bryan> pipe? You don't. 2-arg open has to be good for something. And 2-arg open is perfectly safe if the second arg is a literal:

Re: 3-argument open on STDIN

2011-08-22 Thread Bryan R Harris
>> "Bryan" == Bryan R Harris writes: > > Bryan> How can I use the "safe" 3-argument open and still be able to read off > a > Bryan> pipe? > > You don't. 2-arg open has to be good for something. > > And 2-arg open is perfectly safe if the second arg is a literal: > > open OTHER, "<-" o

Re: 3-argument open on STDIN

2011-08-22 Thread Randal L. Schwartz
> "Bryan" == Bryan R Harris writes: Bryan> How can I use the "safe" 3-argument open and still be able to read off a Bryan> pipe? You don't. 2-arg open has to be good for something. And 2-arg open is perfectly safe if the second arg is a literal: open OTHER, "<-" or die; open my $handl

3-argument open on STDIN

2011-08-22 Thread Bryan R Harris
How can I do a 3-argument open on STDIN? This doesn't work because the 3-argument open won't open STDIN when you tell it to open "-". ** @files = ("-"); for (@files) { print reverse readfile($_); } sub readfile {

Re: 3-argument open on STDIN

2011-08-17 Thread Shawn H Corey
On 11-08-17 06:53 PM, Bryan R Harris wrote: How can I do a 3-argument open on STDIN? This doesn't work because the 3-argument open won't open STDIN when you tell it to open "-". ** @files = ("-"); for (@files) { prin

Re: 3-argument open on STDIN

2011-08-17 Thread Rob Dixon
On 18/08/2011 01:35, John Delacour wrote: At 17:53 -0500 17/08/2011, Bryan R Harris wrote: How can I do a 3-argument open on STDIN? This doesn't work because the 3-argument open won't open STDIN when you tell it to open "-". ** @files =

Re: 3-argument open on STDIN

2011-08-17 Thread John Delacour
At 17:53 -0500 17/08/2011, Bryan R Harris wrote: How can I do a 3-argument open on STDIN? This doesn't work because the 3-argument open won't open STDIN when you tell it to open "-". ** @files = ("-"); for (@files

Re: 3-argument open on STDIN

2011-08-17 Thread Brandon McCaig
On Wed, Aug 17, 2011 at 6:53 PM, Bryan R Harris wrote: > How can I use the "safe" 3-argument open and still be able to read off a > pipe? What I have done in the past is manually compare the filename to '-' and skip the opening and just assign STDIN to my file handle.

3-argument open on STDIN

2011-08-17 Thread Bryan R Harris
How can I do a 3-argument open on STDIN? This doesn't work because the 3-argument open won't open STDIN when you tell it to open "-". ** @files = ("-"); for (@files) { print reverse readfile($_); } sub readfile {

Re: Auto completing STDIN from a script

2010-10-07 Thread Robert Wohlfarth
d script will prompt to enter your name which it > grabs STDIN. > > Can someone point or tell me what to do in the first script to kind of fake > STDIN. So when prompted, will run the second script and auto-complete. Any > suggestions? Thanks. > Take a look at http://perldo

Auto completing STDIN from a script

2010-10-07 Thread Chris E. Rempola
I am making a Perl script that needs to execute another Perl script. The second script is sort of like a verification thing before it does it's thing and it asks to confirm some details. For example, the second script will prompt to enter your name which it grabs STDIN. Can someone poi

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Uri Guttman
> "KW" == Kenneth Wolcott writes: KW> On Mon, Mar 22, 2010 at 15:50, Uri Guttman wrote: >> "KW" == Kenneth Wolcott writes: KW>  >> select LOGNAME; KW>  >> $|++; KW>  >> select STDOUT; KW>  KW>   Which is what the Perl Cookbook suggests as well. you sai

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Kenneth Wolcott
Hi Uri; On Mon, Mar 22, 2010 at 15:50, Uri Guttman wrote: > > "KW" == Kenneth Wolcott writes: > > KW> Hi Harry; > KW> On Mon, Mar 22, 2010 at 12:25, Harry Putnam > wrote: > > >> Harry Putnam writes:But even then I still got > what I > >> needed... or until someone tells me > >> its

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Uri Guttman
> "KW" == Kenneth Wolcott writes: KW> Hi Harry; KW> On Mon, Mar 22, 2010 at 12:25, Harry Putnam wrote: >> Harry Putnam writes:But even then I still got what I >> needed... or until someone tells me >> its better to in this case not to use IO::Handle but stick with Jim >> Gs' su

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Kenneth Wolcott
Hi Harry; On Mon, Mar 22, 2010 at 12:25, Harry Putnam wrote: > Harry Putnam writes:But even then I still got what I > needed... or until someone tells me > its better to in this case not to use IO::Handle but stick with Jim > Gs' suggestion: > > select LOGNAME; > $|++; > select STDOUT; >

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Harry Putnam
Harry Putnam writes: > Thanks, that works fine. > > The page offered by perldoc -q flush mentions a write up about > buffering ( http://perl.plover.com/FAQs/Buffering.html ), that I also > went through. > > I'm sorry to say that it was mostly like trying to read ancient > sanskrit, since its writ

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Harry Putnam
Jim Gibson writes: linux expert wrote: >>> Try adding the following line after your 'use warnings' line: >>> $|++; >>> >>> That will disable output buffering on the currently-selected >>> filehandle (STDOUT be default). Harry replied: >>Doesn't appear to make any difference whatever. Jim G.

Re: filter script read STDIN from named pipe >file

2010-03-21 Thread Jim Gibson
At 7:40 PM -0500 3/21/10, Harry Putnam wrote: Linux Expert writes: Again... appears to work. However the log file takes quite a long time to starting showing any action, and then stay well behind the console output. Try adding the following line after your 'use warnings' line: $|++;

Re: filter script read STDIN from named pipe >file

2010-03-21 Thread Harry Putnam
Linux Expert writes: >> Again... appears to work. >> >> However the log file takes quite a long time to starting showing any >> action, and then stay well behind the console output. >> > > Try adding the following line after your 'use warnings' line: > $|++; > > That will disable output buffering

Re: filter script read STDIN from named pipe >file

2010-03-21 Thread Linux Expert
> Again... appears to work. > > However the log file takes quite a long time to starting showing any > action, and then stay well behind the console output. > Try adding the following line after your 'use warnings' line: $|++; That will disable output buffering on the currently-selected filehandl

filter script read STDIN from named pipe >file

2010-03-21 Thread Harry Putnam
I'm thinking this is some kind of buffer issue and wondering if anything can be done about it: The script included below is really simple so I hope its not some script error causing this. How script is used: System logger is setup to write everything but mail and news logs to a named pipe: On

Re: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Shlomi Fish
On Tuesday 02 Mar 2010 22:07:28 Joseph L. Casale wrote: > >I'm commenting on your code below with some general remarks. Not sure if > >this will fix your problem. > > Shlomi, > I greatly appreciate your time going through this, I have undergone > rewriting it from scratch with your suggestions. It

RE: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Joseph L. Casale
>I'm commenting on your code below with some general remarks. Not sure if this >will fix your problem. Shlomi, I greatly appreciate your time going through this, I have undergone rewriting it from scratch with your suggestions. It was a script I copied from an existing one which was a bad idea:)

Re: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Shlomi Fish
Hi jlc! On Tuesday 02 Mar 2010 06:38:09 Joseph L. Casale wrote: > Hi, > I should state first I don't have the luxury of using Perl often > and am super rusty:) > > I have a script that sends snmp commands to a switch either by passing > args directly or as stdin. It

Script runs fine when passed args directly, not as stdin

2010-03-01 Thread Joseph L. Casale
Hi, I should state first I don't have the luxury of using Perl often and am super rusty:) I have a script that sends snmp commands to a switch either by passing args directly or as stdin. It works when passing them directly, but fails when feeding them as stdin, which is ultimately the w

Re: Getting STDIN filename from command line

2009-05-21 Thread Chas. Owens
On Thu, May 21, 2009 at 12:44, Tony Esposito wrote: > Hello, > > Given the command line: > > perl myperl.plx < myfile.txt > > is there anyway from within the Perl script to capture the redirected STDIN > filename (i.e., myfile.txt)? > > OS:      WinXP SPSP3

Getting STDIN filename from command line

2009-05-21 Thread Tony Esposito
Hello, Given the command line: perl myperl.plx < myfile.txt is there anyway from within the Perl script to capture the redirected STDIN filename (i.e., myfile.txt)? OS:      WinXP SPSP3 Perl:     5.8.8 for Win32 from ActiveState Thx.

Re: Use of my on left side breaks STDIN on right side?

2009-03-29 Thread Chas. Owens
On Sun, Mar 29, 2009 at 22:20, John W. Krahn wrote: > Kelly Jones wrote: >>> >>> perl -le '$x=; print $x' >> >> hello <- I TYPED THIS IN AND HIT RETURN >> hello >> >>> perl -le 'my($x)=; print $x' >> >> hello <- I TYPED THIS IN AND HIT RETURN >> [no answer, hangs forever] > > $x= is in scalar cont

Re: Use of my on left side breaks STDIN on right side?

2009-03-29 Thread John W. Krahn
Kelly Jones wrote: perl -le '$x=; print $x' hello <- I TYPED THIS IN AND HIT RETURN hello perl -le 'my($x)=; print $x' hello <- I TYPED THIS IN AND HIT RETURN [no answer, hangs forever] $x= is in scalar context so only one line is read. ($x)= is in list context so readline keeps reading ut

Use of my on left side breaks STDIN on right side?

2009-03-29 Thread Kelly Jones
> perl -le '$x=; print $x' hello <- I TYPED THIS IN AND HIT RETURN hello > perl -le 'my($x)=; print $x' hello <- I TYPED THIS IN AND HIT RETURN [no answer, hangs forever] Why? -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We fee

Re: piping and reading stdin

2007-08-15 Thread Chas Owens
On 8/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas Owens" schreef: > > > A one second sleep is common, but you can sleep for less than a second > > with usleep from the Time::HiRes* module if this is too slow for your > > purposes. > > AFAIK, a "sleep 1" could take anything between 0 and 2 seco

Re: piping and reading stdin

2007-08-15 Thread Dr.Ruud
"Chas Owens" schreef: > A one second sleep is common, but you can sleep for less than a second > with usleep from the Time::HiRes* module if this is too slow for your > purposes. AFAIK, a "sleep 1" could take anything between 0 and 2 seconds. See also select(). -- Affijn, Ruud "Gewoon is een t

Re: piping and reading stdin

2007-08-14 Thread Jeff Pang
-Original Message- >From: Chas Owens <[EMAIL PROTECTED]> >but you can sleep for less than a second >with usleep from the Time::HiRes* module if this is too slow for your >purposes. > Or use four arguments version of select,see perldoc -f select. -- Jeff Pang <[EMAIL PROTECTED]> http://h

Re: piping and reading stdin

2007-08-14 Thread Chas Owens
On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > Its not really making sense to me why you are adding sleep to this. > Cant I do this as fast as possible? snip I added sleep for two reasons, to show that it worked and to prevent it from hogging the CPU. With non-blocking IO you pro

Re: piping and reading stdin

2007-08-14 Thread horizxon
On Aug 13, 10:47 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 8/13/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > > > -Original Message- > > >From: [EMAIL PROTECTED] > > >Sent: Aug 14, 2007 3:20 AM > > >To: [EMAIL PROTECTED] > >

Re: piping and reading stdin

2007-08-13 Thread Chas Owens
On 8/13/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > -Original Message- > >From: [EMAIL PROTECTED] > >Sent: Aug 14, 2007 3:20 AM > >To: beginners@perl.org > >Subject: piping and reading stdin > > > >I want to read from a pipe

Re: piping and reading stdin

2007-08-13 Thread Jeff Pang
-Original Message- >From: [EMAIL PROTECTED] >Sent: Aug 14, 2007 3:20 AM >To: beginners@perl.org >Subject: piping and reading stdin > >I want to read from a pipe in my perl script invoked like: > >date | perl myperlscript.pl > >I understand that this puts th

piping and reading stdin

2007-08-13 Thread horizxon
I want to read from a pipe in my perl script invoked like: date | perl myperlscript.pl I understand that this puts the text outputted from the date program into the stdin. How could I check the buffer contained by the stdin without it blocking for you to input anything from the keyboard if

Re: How to save input STDIN into a file

2007-08-06 Thread Chas Owens
a sort block. * you can chomp the variables as you assign to them * there is no comma between $fh and "$var\n" (this is how print knows it should use the $fh as a file handle instead trying to print it's contents) Things to think about: * programs that ask questions are a

Re: How to save input STDIN into a file

2007-08-06 Thread Paul Lalli
On Aug 6, 2:16 am, [EMAIL PROTECTED] (Sydney) wrote: > The script working fine. but I like to save output of "$avar="$dir/ > $db" into a file. How do I do that? Thanks LC perldoc perlopentut perldoc -f open perldoc -f print Paul Lalli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

How to save input STDIN into a file

2007-08-06 Thread Sydney
The script working fine. but I like to save output of "$avar="$dir/ $db" into a file. How do I do that? Thanks LC print "which client\n"; my $a = <>; chomp $a; my $db = <>; chomp $db; my $dir="/u1/data/$a"; my $avar="$dir/$db"; $avar="$dir/$db"; print "$avar\n"; -- To unsubscribe, e-mail: [E

Re: capture stdin and stderr

2007-03-20 Thread Mumia W.
On 03/20/2007 05:21 PM, Vladimir Lemberg wrote: Hi All, My script is calling a Win32 program with two arguments: system ( "$ARGV[0]\\program.exe", $File::Find::name, "$ARGV[0]\\source"); I want to capture STDOUT and STDERR from the program to log file system ( "$ARGV[0]\\program.e

Re: capture stdin and stderr

2007-03-20 Thread Vladimir Lemberg
Hi David, Would you please send this portion to me? Thanks, Vladimir - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; Sent: Tuesday, March 20, 2007 3:54 P

RE: capture stdin and stderr

2007-03-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Vladimir Lemberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 20, 2007 15:21 > To: beginners@perl.org > Subject: capture stdin and stderr > > Hi All, > > > > My script is calling a Win32 program with two arguments: >

capture stdin and stderr

2007-03-20 Thread Vladimir Lemberg
Hi All, My script is calling a Win32 program with two arguments: system ( "$ARGV[0]\\program.exe", $File::Find::name, "$ARGV[0]\\source"); I want to capture STDOUT and STDERR from the program to log file system ( "$ARGV[0]\\program.exe", $File::Find::name, "$ARGV[0]\\source", 1>"$ARGV

Re: How to mimic a CLI using perl with STDIN

2007-02-15 Thread Tom Phoenix
On 2/15/07, Gauthier, Dave <[EMAIL PROTECTED]> wrote: I would like to mimic linux command line behavior from inside a perl script. I guess the only thing I'm missing us the up/down arrow behavior (scrolll up/down the previous input line(s) stack) It sounds like you're talking about the "histo

How to mimic a CLI using perl with STDIN

2007-02-15 Thread Gauthier, Dave
I would like to mimic linux command line behavior from inside a perl script. I guess the only thing I'm missing us the up/down arrow behavior (scrolll up/down the previous input line(s) stack) Is there a way to do this? Thanks -dave

Re: time limited STDIN

2007-01-04 Thread Saurabh Singhvi
Thanks a lot ! That does it :) On 1/4/07, Dave Gray <[EMAIL PROTECTED]> wrote: On 1/4/07, Saurabh Singhvi <[EMAIL PROTECTED]> wrote: > Hi all, > > I wanted to know a way of taking a time limited STDIN. Say for eg > after 3 seconds, the STDIN should stop waiting and mo

Re: time limited STDIN

2007-01-04 Thread Dave Gray
On 1/4/07, Saurabh Singhvi <[EMAIL PROTECTED]> wrote: Hi all, I wanted to know a way of taking a time limited STDIN. Say for eg after 3 seconds, the STDIN should stop waiting and move forward. How do I do this?? I was trying with unless ($child) { sleep($waittime); `ec

time limited STDIN

2007-01-04 Thread Saurabh Singhvi
Hi all, I wanted to know a way of taking a time limited STDIN. Say for eg after 3 seconds, the STDIN should stop waiting and move forward. How do I do this?? I was trying with unless ($child) { sleep($waittime); `echo "\n"`; exit 0; } $ans = ; but this didn&

Re: assign STDIN to a hash ref

2006-10-25 Thread John W. Krahn
Brian Volk wrote: > Hello~ > > I'm trying to assign STDIN to a hash ref... I think? :-) perldoc -q "pass.*filehandle" John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order

Re: assign STDIN to a hash ref

2006-10-25 Thread Arnaldo Guzman
Arnaldo Guzman wrote: Brian Volk wrote: Hello~ I'm trying to assign STDIN to a hash ref... I think? :-) I have a working program (w/o references) but I think it will easily get out of control if I don't learn to use references. Here is what I would like to do: User selects vendo

Re: assign STDIN to a hash ref

2006-10-25 Thread Arnaldo Guzman
Brian Volk wrote: Hello~ I'm trying to assign STDIN to a hash ref... I think? :-) I have a working program (w/o references) but I think it will easily get out of control if I don't learn to use references. Here is what I would like to do: User selects vendor and then selects t

assign STDIN to a hash ref

2006-10-25 Thread Brian Volk
Hello~ I'm trying to assign STDIN to a hash ref... I think? :-) I have a working program (w/o references) but I think it will easily get out of control if I don't learn to use references. Here is what I would like to do: User selects vendor and then selects the type of image (

Re: queuing up user input via writes to STDIN

2006-07-28 Thread Michael Gale
efore exiting foreach my $entry (@data){ print "$entry\n"; } exit; Gavin Bowlby wrote: All: I have a program that reads STDIN for user commands while the program is running. I'm adding the capability to queue up user commands from the shell command line when the prog

Re: queuing up user input via writes to STDIN

2006-07-27 Thread John W. Krahn
Gavin Bowlby wrote: > All: Hello, > I have a program that reads STDIN for user commands while the program is > running. > > I'm adding the capability to queue up user commands from the shell > command line when the program is invoked. > > I'd like to be able

queuing up user input via writes to STDIN

2006-07-27 Thread Gavin Bowlby
All: I have a program that reads STDIN for user commands while the program is running. I'm adding the capability to queue up user commands from the shell command line when the program is invoked. I'd like to be able to queue the command line data up in STDIN, so that when the program

Re: Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Kevin Viel
Chad Perrin wrote: On Wed, Jul 05, 2006 at 11:31:55AM -0500, Kevin Viel wrote: Mr. Shawn H. Corey wrote: Kevin Viel wrote: I call a perl script from SAS using a pipe. The file on which the script acts changes. Is there a way to provide the file name to the script using STDIN on the

Re: Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Chad Perrin
On Wed, Jul 05, 2006 at 11:31:55AM -0500, Kevin Viel wrote: > Mr. Shawn H. Corey wrote: > >Kevin Viel wrote: > > > >>I call a perl script from SAS using a pipe. The file on which the > >>script acts changes. Is there a way to provide the file name to the >

Re: Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Mr. Shawn H. Corey
Kevin Viel wrote: > That should work, but I cannot use the keyboard to provide the STDIN. > Instead I was hoping for something like: > > filename ABI pipe "perl C:/base.ps >file.ab1" ; >^ > > Thanks, > &g

Re: Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Kevin Viel
Mr. Shawn H. Corey wrote: Kevin Viel wrote: I call a perl script from SAS using a pipe. The file on which the script acts changes. Is there a way to provide the file name to the script using STDIN on the command line? The SAS call looks like: filename ABI pipe "perl C:/base.ps"

Re: Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Mr. Shawn H. Corey
Kevin Viel wrote: > I call a perl script from SAS using a pipe. The file on which the > script acts changes. Is there a way to provide the file name to the > script using STDIN on the command line? The SAS call looks like: > > filename ABI pipe "perl C:/base.ps" ; &g

Providing STDIN to a PIPEd call to perl

2006-07-05 Thread Kevin Viel
I call a perl script from SAS using a pipe. The file on which the script acts changes. Is there a way to provide the file name to the script using STDIN on the command line? The SAS call looks like: filename ABI pipe "perl C:/base.ps" ; For now, I altered the script to read a

Re: How do I redirect STDIN [Please, ignore this thread]

2006-02-12 Thread Ron Smith
Please, ignore this thread!! I've posted the correct thread under the subject: Redirecting STDOUT to an array. Ron Smith <[EMAIL PROTECTED]> wrote: Hi all, How would I redirect the output of the print line to an array instaed of STDOUT? my $firstBar = 5; print "*" while $firstBar, $firstBar--

How do I redirect STDIN

2006-02-12 Thread Ron Smith
Hi all, How would I redirect the output of the print line to an array instaed of STDOUT? my $firstBar = 5; print "*" while $firstBar, $firstBar--; I've looked in several places, including the Camel Book and the Cookbook. Everything seems to be refering to a filehandle instead.

conclusion: about eval and stdin

2006-01-04 Thread Adriano Allora
hi to all and thanks to all suggested me some solution, using debug lines (or something similar) I understood how obtaining the output I want. Now, I'm writing this e-mail to show a possible way to do a discrete corrector: I write a regexp to substitute (maybe with another regexp including bac

RE: about eval and stdin

2006-01-03 Thread Timothy Johnson
text to replace it with. PATTERN: Te([^ ]+).*support REPLACEMENT: sticular Pattern Found! $_ => Tech Support $1 => ch Type "s" to confirm substitution, or press any other key to cancel: s COMMAND: s/Te([^ ]+

RE: about eval and stdin

2006-01-03 Thread Timothy Johnson
ne to: if(/($pattern)/gi) -Original Message- From: Adriano Allora [mailto:[EMAIL PROTECTED] Sent: Mon 1/2/2006 3:48 AM To: beginners@perl.org Cc: Subject: about eval and stdin hi to all, a friend of mi

Re: about eval and stdin

2006-01-02 Thread John Doe
Adriano Allora am Montag, 2. Januar 2006 12.48: > hi to all, > a friend of mine ask me for a perl script to change regexp patterns in > some texts (he can learn regexp, but I suppose he won't learn perl). So > I start write this one to him. > I have a problem: > ==> with pattern = (dir)ectory and r

about eval and stdin

2006-01-02 Thread Adriano Allora
hi to all, a friend of mine ask me for a perl script to change regexp patterns in some texts (he can learn regexp, but I suppose he won't learn perl). So I start write this one to him. I have a problem: ==> with pattern = (dir)ectory and replacement = $1, why the script does not eval $1 as "d

Re: strange problem with STDIN- need help

2005-12-30 Thread John W. Krahn
e has an idea how this is affecting . Yes, I do. readline() is waiting for EOF on the STDIN filehandle. > I tried using $|=1 but that did not help. That is because setting $| only effects the currently selected filehandle which is STDOUT by default. John -- use Perl; program fulfillment

Re: strange problem with STDIN- need help

2005-12-30 Thread Poonam Pahil
t showing up. > > -Original Message- > From: Poonam Pahil [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 29, 2005 2:23 AM > To: beginners@perl.org > Subject: strange problem with STDIN- need help > > Hi, > > Iam using to accept user input but the script just

RE: strange problem with STDIN- need help

2005-12-29 Thread Timothy Johnson
nners@perl.org Subject: strange problem with STDIN- need help Hi, Iam using to accept user input but the script just hangs at that point. I type in the value & program is just stuck at that point. i know its got to do with buffer flushing. when iam using the same piece of code at the beginni

Re: strange problem with STDIN- need help

2005-12-29 Thread Dr.Ruud
Poonam Pahil schreef: > Iam using to accept user input but the script just hangs at > that point. perldoc -q waiting -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: strange problem with STDIN- need help

2005-12-29 Thread Owen Cook
On Thu, 29 Dec 2005, Poonam Pahil wrote: > if($remove_CS =~ m/n/i ){ ??? } > it does not reach to this point. > > it hangs before this, at > my $remove_CS = ; > > Well this works for me cut #!/usr/bin/perl -w use strict; print "Do you w

Re: strange problem with STDIN- need help

2005-12-29 Thread Poonam Pahil
if($remove_CS =~ m/n/i ){ ??? } it does not reach to this point. it hangs before this, at my $remove_CS = ; thanks poonam On 12/29/05, Owen Cook <[EMAIL PROTECTED]> wrote: > > > On Thu, 29 Dec 2005, Poonam Pahil wrote: > > > > Iam using to accept user input but the script just hangs at that

Re: strange problem with STDIN- need help

2005-12-29 Thread Owen Cook
On Thu, 29 Dec 2005, Poonam Pahil wrote: > > Iam using to accept user input but the script just hangs at that > point. > I type in the value & program is just stuck at that point. > > i know its got to do with buffer flushing. when iam using the same piece of > code at the beginning of the scri

strange problem with STDIN- need help

2005-12-29 Thread Poonam Pahil
Hi, Iam using to accept user input but the script just hangs at that point. I type in the value & program is just stuck at that point. i know its got to do with buffer flushing. when iam using the same piece of code at the beginning of the script everything works fine. iam using system() a lot.

Re: One liner to process stdin/stdout similar "in place edit", grep, cut and awk ($5 PayPal reward for the best answer!)

2005-05-18 Thread Jeff 'japhy' Pinyan
On May 18, Lance Murray said: perl -i -p -e "s/oldhostname/newhostname/g" /etc/hosts However, what is the syntax if I wanted to just process a text stream to stdout?, e.g.: cat /etc/hosts | perl "s/in_text/out_text/g" Simple: use the -p and -e switches, but not the -i switch. -- Jeff "japhy" Pin

Re: One liner to process stdin/stdout similar "in place edit", grep, cut and awk ($5 PayPal reward for the best answer!)

2005-05-18 Thread Jay Savage
On 5/18/05, Chris Devers <[EMAIL PROTECTED]> wrote: > On Wed, 18 May 2005, Lance Murray wrote: > > > However, what is the syntax if I wanted to just process a text stream > > to stdout?, e.g.: > > > > cat /etc/hosts | perl "s/in_text/out_text/g" > > > > I'm sure the answer is fairly simple. I'd j

Re: One liner to process stdin/stdout similar "in place edit", grep, cut and awk ($5 PayPal reward for the best answer!)

2005-05-18 Thread John W. Krahn
Lance Murray wrote: Hello: Hello, I've long used Perl's "in place edit" feature, and understand it and regex fairly well, e.g.: perl -i -p -e "s/oldhostname/newhostname/g" /etc/hosts However, what is the syntax if I wanted to just process a text stream to stdout?, e.g.: cat /etc/hosts | perl "s/in_

Re: One liner to process stdin/stdout similar "in place edit", grep, cut and awk ($5 PayPal reward for the best answer!)

2005-05-18 Thread Chris Devers
On Wed, 18 May 2005, Lance Murray wrote: > However, what is the syntax if I wanted to just process a text stream > to stdout?, e.g.: > > cat /etc/hosts | perl "s/in_text/out_text/g" > > I'm sure the answer is fairly simple. I'd just like to use perl one > liners in place of awk, cut, grep stateme

One liner to process stdin/stdout similar "in place edit", grep, cut and awk ($5 PayPal reward for the best answer!)

2005-05-18 Thread Lance Murray
Hello: I've long used Perl's "in place edit" feature, and understand it and regex fairly well, e.g.: perl -i -p -e "s/oldhostname/newhostname/g" /etc/hosts However, what is the syntax if I wanted to just process a text stream to stdout?, e.g.: cat /etc/hosts | perl "s/in_text/out_text/g" I'm

Re: -t STDIN multiple times or doit once and use variable?

2005-05-13 Thread JupiterHost.Net
JupiterHost.Net wrote: Hello group, I was wanting opinions on what you think is better and why: Assuming there are several places you need to check and see if the script is being run via terminal or not, would it be better to: if(-t STDIN) { everytime *or* do it once: my $isterminal = -t STDIN

-t STDIN multiple times or doit once and use variable?

2005-05-05 Thread JupiterHost.Net
Hello group, I was wanting opinions on what you think is better and why: Assuming there are several places you need to check and see if the script is being run via terminal or not, would it be better to: if(-t STDIN) { everytime *or* do it once: my $isterminal = -t STDIN; and then do if

Re: help on stdin

2005-05-03 Thread John W. Krahn
Zuromski, Brian wrote: hi, Hello, I'm trying to write a short perl script that takes stdin as a command line option and executes it with the command I'm using in the script. I don't want the stdin to be visible when entering it in. Any assistance would be appreciated. perld

help on stdin

2005-05-03 Thread Zuromski, Brian
hi, I'm trying to write a short perl script that takes stdin as a command line option and executes it with the command I'm using in the script. I don't want the stdin to be visible when entering it in. Any assistance would be appreciated. here is wha

Issue reading password from STDIN after STDIN was read from redirect.

2005-03-09 Thread Anthony Tippett
I've have a program that reads input from STDIN like so: example: program < file.txt and then I try to read a password from STDIN that the user types in but it skips right over that section. Do I have to do anything to STDIN before I try to get user input from it? Perhaps close and r

Re: Input a password from STDIN

2005-02-06 Thread Gerard Robin
On Sun, Feb 06, 2005 at 10:33:05PM +0800 Xiaofang Zhou wrote: > Anyone can help me in this?. When running > > $password = ; > > the password will show on the console windows as user > type in. Is it possible for perl to read from keyboard > directly, without echo to the console window? there is

Re: Input a password from STDIN

2005-02-06 Thread Randy W. Sims
Xiaofang Zhou wrote: > Anyone can help me in this?. When running > > $password = ; > > the password will show on the console windows as user > type in. Is it possible for perl to read from keyboard > directly, without echo to the console window? > perldoc -q password -- To unsubscribe, e-ma

Re: RE: Input a password from STDIN

2005-02-06 Thread Xiaofang Zhou
I'm using active perl 5.6 on winxp, running perl in a DOS-like command windows. The User interfaces modules on cpan seems not designed for win32 platform. I tought about using TK to pop-up a gui dialog window. But don't know how to leave "MainLoop" and return to my script. Direct calling 'exit' on

RE: Input a password from STDIN

2005-02-06 Thread Charles K. Clarkson
Xiaofang Zhou <[EMAIL PROTECTED]> wrote: : Anyone can help me in this?. When running : : $password = ; : : the password will show on the console windows as user : type in. Is it possible for perl to read from keyboard : directly, without echo to the console window? That depends on the console

Input a password from STDIN

2005-02-06 Thread Xiaofang Zhou
Anyone can help me in this?. When running $password = ; the password will show on the console windows as user type in. Is it possible for perl to read from keyboard directly, without echo to the console window? Thanks, Xiaofang [EMAIL PROTECTED] -- To unsubscribe, e-m

  1   2   3   >