780596001735.do
>>
>> )
>> 10.18. Autoflushing
>>
>> Avoid a raw select when setting autoflushes .
>
> Very nice and important info but I/O buffering has been optimized. Do
> not enable autoflush. Things go slower if you do.
When I need to save the merged
On Wed, 10 Jul 2013 10:49:37 -0500
Andy Bach wrote:
> On Wed, Jul 10, 2013 at 7:08 AM, Shawn H Corey
> wrote:
>
> > Auto-flush is a de-optimization. Don't set it.
>
>
>
> More "Best Practices" on autoflush (note, the original book "Perl Best
> Practices" by Damian Conway is well worth the p
On Wed, Jul 10, 2013 at 7:08 AM, Shawn H Corey wrote:
> Auto-flush is a de-optimization. Don't set it.
More "Best Practices" on autoflush (note, the original book "Perl Best
Practices" by Damian Conway is well worth the price. Even for those few you
may not agree with, practices-wise, you'll le
On Wed, 10 Jul 2013 04:57:44 -0400
shawn wilson wrote:
> On Jul 10, 2013 2:01 AM, "jitendra B" wrote:
> >
> > Thank you very much Andy, Nathan, Shawn for your kind help.
> >
> > I am new to the perl. Why auto-flush is needed here (STDERR
> > autoflush
On Jul 10, 2013 2:01 AM, "jitendra B" wrote:
>
> Thank you very much Andy, Nathan, Shawn for your kind help.
>
> I am new to the perl. Why auto-flush is needed here (STDERR autoflushes)?
>
Probably for consistency with autoflush being enabled for STDOUT, it'
Thank you very much Andy, Nathan, Shawn for your kind help.
I am new to the perl. Why auto-flush is needed here (STDERR autoflushes)?
It will free the memory or something else.
Regards,
Jitendra
On Tue, Jul 9, 2013 at 9:10 PM, Andy Bach wrote:
>
> On Tue, Jul 9, 2013 at 9:37 AM,
On Tue, Jul 9, 2013 at 9:37 AM, Nathan Hilterbrand wrote:
> I want to open a file read+write mode and change
> > the
> > some content in same file without creating another file and copy to it.
>
You might want to look at the perl "in place mode" [1], so something like
perl -i.bak -pe ' s/BLR/ban
See below
> Hi All,
>
>
> Can you please let me know the following snippset? why it is used for?
>
>
> select( STDERR );
> $| = 1;
> select( STDOUT );
> $| = 1;
> print STDERR "\nThis is india\n\n";
> print STDERR "Usage: This is build&
On Tue, 9 Jul 2013 13:24:54 +0530
jitendra B wrote:
> Can you please let me know the following snippset? why it is used for?
>
>
> select( STDERR );
Change the default file handle use by `print` and `say` to STDERR. The
default file handle is use when no file handle is specif
jitendra B wrote:
Hi All,
Hello,
Can you please let me know the following snippset? why it is used for?
select( STDERR );
Select STDERR as the default filehandle.
$| = 1;
Turn on autoflush for the current default filehandle.
(Redundant because STDERR autoflushes by default
Hi All,
Can you please let me know the following snippset? why it is used for?
select( STDERR );
$| = 1;
select( STDOUT );
$| = 1;
print STDERR "\nThis is india\n\n";
print STDERR "Usage: This is build";
print STDERR "where: base PL label\n";
and second que
Thank you!
> On Nov 2, 5:06 pm, bryan_r_har...@raytheon.com (Bryan R Harris) wrote:
>> I have these lines in my script:
>>
>> **
>> for my $handle (*STDIN, *STDERR) {
>> open($handle, "+> /dev/null: $!. Exitin
On Nov 2, 5:06 pm, bryan_r_har...@raytheon.com (Bryan R Harris) wrote:
> I have these lines in my script:
>
> **
> for my $handle (*STDIN, *STDERR) {
> open($handle, "+ /dev/null: $!. Exiting.\n";
>
> }
>
> # open outfil
I have these lines in my script:
**
for my $handle (*STDIN, *STDERR) {
open($handle, "+$outfile") or die "$me: Couldn't open $outfile: $!\n";
$| = 1; # and don't buffer it
******
I
That works like a charm -- thanks!
"Chas. Owens" wrote on 07/05/2009 03:57:34 AM:
> From:
>
> "Chas. Owens"
>
> To:
>
> Eric Veith/Germany/i...@ibmde
>
> Cc:
>
> beginners@perl.org
>
> Date:
>
> 07/05/2009 03:58 AM
>
> Subj
On Thu, Jul 2, 2009 at 04:36, Eric Veith wrote:
>
> Hello List,
>
> as part of a Perl script of mine, I want to execute a program, get its
> return code AND capture its output on both STDERR and STDOUT. I tried
> IO::Handle, but that only gives me STDOUT and not the return cod
Hello List,
as part of a Perl script of mine, I want to execute a program, get its
return code AND capture its output on both STDERR and STDOUT. I tried
IO::Handle, but that only gives me STDOUT and not the return code. Using
qr//, I cannot read linewise and have to load the complete program
Hello !
here my hint :
#!/usr/bin/perl
use strict;
use warnings;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init(
{
file => ">> my_error_log",
level => $ERROR,
},
{
file => "STDERR",
level => $ERROR,
}
);
For more informations see ht
Date sent: Mon, 22 Jun 2009 10:53:06 -0700
From: pa...@compugenic.com
To: beginners@perl.org
Subject:redirecting STDERR with IO::Tee
> I have a script which runs mostly via a cron job and sometimes
> interactively. I woul
console) and a log file. What is the proper way of doing
>> this?
>>
>> print STDERR mess;
>> print FILEHANDLE mess;
>>
>
> STDERR is where errors go. Error messages are generated as a result of
> an error, not a 'print' statement. Athough I could
Hi Pablo,
pa...@compugenic.com wrote:
STDERR is where errors go. Error messages are generated as a result of
an error, not a 'print' statement. Athough I could manually print to
STDERR, I'm trying to log all errors to both a logfile and STDERR.
Hm, not quite sur
proper way of doing this?
>
> print STDERR mess;
> print FILEHANDLE mess;
>
STDERR is where errors go. Error messages are generated as a result of
an error, not a 'print' statement. Athough I could manually print to
STDERR, I'm trying to log all errors to both a logfile and
On Wed, Jun 24, 2009 at 09:25:05AM -0700, pa...@compugenic.com wrote:
> I'd like to automatically have my script's errors and warnings sent to
> both STDOUT (console) and a log file. What is the proper way of doing this?
print STDERR mess;
print FILEHANDLE mess;
>
&g
On Wed, Jun 24, 2009 at 05:52:36PM +0800, Jeff Pang wrote:
> 2009/6/23 :
> > I have a script which runs mostly via a cron job and sometimes
> > interactively. I would like STDERR to automatically print to both the
> > console and to a logfile simultaneously.
>
I'd like to automatically have my script's errors and warnings sent to
both STDOUT (console) and a log file. What is the proper way of doing this?
Pablo
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
2009/6/23 :
> I have a script which runs mostly via a cron job and sometimes interactively.
> I would like STDERR to automatically print to both the console and to a
> logfile simultaneously.
>
> Right now I've gotten as far as merging both file handles with IO::Tee but
&
I have a script which runs mostly via a cron job and sometimes interactively.
I would like STDERR to automatically print to both the console and to a logfile
simultaneously.
Right now I've gotten as far as merging both file handles with IO::Tee but I'm
not sure if I'm heading
t to use rmtree to delete a dir and use variables to catch the
>> error message. However, when i am about to delete a dir that does not
>> belong to me, it still print the error message to stderr. Does anyone
>> have clue?
>>
>> my script: test.pl
>>
>> use
On Fri, Sep 26, 2008 at 12:17 AM, Yue Chen <[EMAIL PROTECTED]> wrote:
> Hi
>
> I want to use rmtree to delete a dir and use variables to catch the
> error message. However, when i am about to delete a dir that does not
> belong to me, it still print the error message to stder
Hi
I want to use rmtree to delete a dir and use variables to catch the
error message. However, when i am about to delete a dir that does not
belong to me, it still print the error message to stderr. Does anyone
have clue?
my script: test.pl
use File::Path;
File::Path::rmtree( '/root
Hello beginners,
any hints on this problem?
win32...
I have N threads. in each thread I want to run a command and
redirect it's STDERR and STDOUT to a filehandle/socket opened
in the main thread. I tried with IPC::Run3 but the outputs get
scrambled.
--
Best regards,
Alex
On Jul 17, 9:24 pm, [EMAIL PROTECTED] (Yitzle) wrote:
> On Wed, Jul 16, 2008 at 9:01 PM, <[EMAIL PROTECTED]> wrote:
> > Hi experts
> > When I am using STDERR and STDOUT for mixed output, I found a problem.
> > Output of STDERR and STDOUT can not be mix
On Wed, Jul 16, 2008 at 9:01 PM, <[EMAIL PROTECTED]> wrote:
> Hi experts
> When I am using STDERR and STDOUT for mixed output, I found a problem.
> Output of STDERR and STDOUT can not be mixed.
> Here is the snippet.
>
> #
> pri
Hi experts
When I am using STDERR and STDOUT for mixed output, I found a problem.
Output of STDERR and STDOUT can not be mixed.
Here is the snippet.
#
print STDOUT "This is STDOUT\n";
print STDERR "This is STDERR\n";
print STDO
On Thu, 30 Aug 2007 10:57:20 -0300, Adriano Ferreira wrote:
> On 8/30/07, Peter Scott <[EMAIL PROTECTED]> wrote:
>> Why are you using a BEGIN block? Why not just make it the first
>> executable statement? Do you have any other 'use' statements in the
>> program?
>
> Because otherwise it would be
On Thu, 30 Aug 2007 17:25:28 +0100, Beginner wrote:
> On 30 Aug 2007 at 10:07, Mumia W. wrote:
>
>> On 08/30/2007 09:37 AM, Beginner wrote:
>> > q2) Will our $logfile now be a shared variable across all my modules?
>> Try it and see.
>
> No. It's not.
Yes. It is. It was declared (three posts
"Beginner" schreef:
> Log::Handler looks pretty comprehensive.
Consider also Log::Log4Perl.
http://search.cpan.org/~mschilli/Log-Log4perl/lib/Log/Log4perl/FAQ.pm
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
"Beginner" schreef:
> Adriano Ferreira:
>> use lib qw(/etc/perl);
>
> use lib ('/etc/perl');
The idiom adivised by Adriano is more flexible.
See `perldoc lib`.
Example:
use lib qw(
/usr/local/cvs_tree/lib
/etc/perl
);
--
Affijn, Ruud
"Gewoon is een tijger."
ile and I can use a scalar for logfile.
> >
> > q1) Does this still give me the effect of getting any errors from the
> > other modules directed to our $logfile?
> >
>
> Probably not. There's no better way than to try it and see if it works.
> Read "perldoc
On 08/30/2007 09:37 AM, Beginner wrote:
[...]
I tried the INIT option and that worked also and I liked the fact
that my `perl -c myscript.pl` sent it's output to screen and not my
log file and I can use a scalar for logfile.
q1) Does this still give me the effect of getting any errors from t
; which doesn't need the surrounding "BEGIN" block.
>
> > $| = 1;
> > open(STDERR, ">>/usr/local/myreports/report.log") || die
> > "Can't write to file: $!\n";
> > }
> >
> > use MY::MakePDF;
> >
On 8/30/07, Beginner <[EMAIL PROTECTED]> wrote:
> On 30 Aug 2007 at 6:32, Peter Scott wrote:
>
> > On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote:
> > > I want all the output plus any error messages to got to a log file. I
> > > used the BEGIN
On 8/30/07, Peter Scott <[EMAIL PROTECTED]> wrote:
> On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote:
> > I want all the output plus any error messages to got to a log file. I
> > used the BEGIN block to direct STDERR into the file:
> >
> > BEGIN {
> >
On 30 Aug 2007 at 6:32, Peter Scott wrote:
> On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote:
> > I want all the output plus any error messages to got to a log file. I
> > used the BEGIN block to direct STDERR into the file:
> >
> > BEGIN {
> > ope
On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote:
> I want all the output plus any error messages to got to a log file. I
> used the BEGIN block to direct STDERR into the file:
>
> BEGIN {
> open(STDERR, ">>/usr/local/myreports/report.log") || di
On 08/30/2007 04:32 AM, Beginner wrote:
Hi,
I want all the output plus any error messages to got to a log file. I
used the BEGIN block to direct STDERR into the file:
BEGIN {
open(STDERR, ">>/usr/local/myreports/report.log") || die "Can't
write to file: $
Hi,
I want all the output plus any error messages to got to a log file. I
used the BEGIN block to direct STDERR into the file:
BEGIN {
open(STDERR, ">>/usr/local/myreports/report.log") || die "Can't
write to file: $!\n";
}
use strict;
use warnings;
..
Karyn Williams wrote:
> I have this script I have been working on where I need to redirect STDOUT
> and STDERR to files at the beginning of the script and then back to default
> (terminal) at the end of the script. I found an example on-line and used it
> and it works, however it
On 5/7/07, Karyn Williams <[EMAIL PROTECTED]> wrote:
I have this script I have been working on where I need to redirect STDOUT
and STDERR to files at the beginning of the script and then back to default
(terminal) at the end of the script. I found an example on-line and used it
and it
On 5/7/07, Karyn Williams <[EMAIL PROTECTED]> wrote:
I have this script I have been working on where I need to redirect STDOUT
and STDERR to files at the beginning of the script and then back to default
(terminal) at the end of the script. I found an example on-line and used it
and it
I have this script I have been working on where I need to redirect STDOUT
and STDERR to files at the beginning of the script and then back to default
(terminal) at the end of the script. I found an example on-line and used it
and it works, however it generates a warning when running my script. I
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
M
Subject: RE: capture stdin and stderr
-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:
system ( &quo
> -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:
>
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
On Thu, 18 Jan 2007 20:28:42 -0600, David Moreno Garza wrote:
> On Thu, 2007-01-18 at 07:11 -0800, Peter Scott wrote:
>> my $output = `myperlscript.pl 2>&1`;
>> send_email($output) if $output;
>
> Isn't send_email($output) in this situation still going to happen? I
> mean, even of there is not out
On Thu, 2007-01-18 at 07:11 -0800, Peter Scott wrote:
> my $output = `myperlscript.pl 2>&1`;
> send_email($output) if $output;
Doubt:
Isn't send_email($output) in this situation still going to happen? I
mean, even of there is not output on "myperlscript.pl 2>&1", $output is
going to be set, meani
Igor, thanks for the tip!
A search of CPAN turned up IPC::Open3::Simple
Very cool... Very easy to use and exactly what I needed.
Separate callback subs for STDOUT and STDERR... just push anything fed to
them into an array... When all done, if array size > 0, fire off an email
with the conte
. The sending in an email part I can handle. and I think
> I can probably redirect the output of myperlscript.pl to a file and read
> that, but is there a better, more elegant way to capture any stdout/stderr
> output WITHOUT having to redirect and read another file?
Look up backticks in pe
nk
I can probably redirect the output of myperlscript.pl to a file and read
that, but is there a better, more elegant way to capture any stdout/stderr
output WITHOUT having to redirect and read another file?
Why don't you encapsulate the myperlscript.pl code on a reusable
module, then ju
part I can handle. and I think
> I can probably redirect the output of myperlscript.pl to a file and read
> that, but is there a better, more elegant way to capture any stdout/stderr
> output WITHOUT having to redirect and read another file?
Look up system2 in cpan.
--
Ken Foskey
FOSS
ipt.pl to a file and read
that, but is there a better, more elegant way to capture any stdout/stderr
output WITHOUT having to redirect and read another file?
Thanks!
-Dan
Hello,
In your daemon script,you can re-direct the STDIN/STDOUT/STDERR to the null
device like '/dev/null'.
open (STDIN, "/dev/null");
open (STDERR,">&STDOUT");
Then you can redefine the 'warn' and 'die' handler to the subrouti
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote:
I have a daemon process that works but I am currently running it with
script.pl > error.log 2>&1
and I want to do the same thing without using the redirection,, remove
the human error when starting the program.
I c
On 08/29/2006 09:06 AM, Ken Foskey wrote:
I have a daemon process that works but I am currently running it with
script.pl > error.log 2>&1
and I want to do the same thing without using the redirection,, remove
the human error when starting the program.
I can `open( STDERR, '
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote:
I can `open( STDERR, '>', 'error.log') ...` but is there a piece of
magic to duplicate that to STDOUT as well (ie same file output)
open(STDERR, '>', 'error.log') or die "Can't r
I have a daemon process that works but I am currently running it with
script.pl > error.log 2>&1
and I want to do the same thing without using the redirection,, remove
the human error when starting the program.
I can `open( STDERR, '>', 'error.log') ...`
Opening the filehandle STDERR to a file will not persist beyond termination of
the script, nor will it affect other programs running at the same time as the
script. It affects only the running script. STDERR of the shell is different
from that of perl.
On Friday 07 October 2005 16:56, Timothy
ROTECTED]>:
> It partly depends on your operating system, I think. That's fine on
> Windows, but on UNIX I think that under some if not all circumstances
> your change will persist after the script finishes executing. I've
> never had to do it, but I've seen one meth
open(OLD_STDERR,">&STDERR") or die "Failed to save STDERR";
open(STDERR,">script.err") or die "Failed to redirect STDERR";
do something...
open(STDERR,">&OLD_STDERR") or die "Failed to restore STDERR";
-Original Message-
Perlers,
I have a script where I redirect STDERR to a file so that I can capture
'die' messages like so:
use warnings;
use strict;
my $logfile = "/some/path/logfile.txt";
open STDERR, ">>$logfile";
something or die "Unable to do something()\n";
Hello,
I am using the following to redirect STDERR and STDOUT:
open(STDOUT, "> $logfile") || die "Can't redirect stdout";
open(STDERR, ">&STDOUT") || die "Can't dup stdout";
select(STDERR); $| = 1; # make unbuffered
select(ST
Hi list,
I've got some strange behaviour with redirected STDOUT/STDERR handles and
calls to File::Copy - I hope someone can explain me why I'm seeing what I'm
seeing here.
I use the following code to redirect STDOUT and STDERR to a log file - as you
can see, it's more or
Hi
I am writing a routine which gives me the right output, but lot of warning messages as
well. This messages are related to the SCM tool i am using. I want to capture these
warnings and supress them. i.e i dont want them to appear in the stdout. how do i
achieve this?
Regards
Sudhindra
Harry Putnam wrote:
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why
"Randy W. Sims" <[EMAIL PROTECTED]> writes:
> Use 'return' to exit from a subroutine. Use 'next', 'redo', 'last',
> and 'goto' to alter the execution path in loop constructs; they must
> appear /inside/ the block owned by the loop construct or within a
> sub-block.
Ahh, ok thanks. Return turns o
On Sat, Mar 27, 2004 at 03:24:13PM -0500, Randy W. Sims wrote:
> Harry Putnam wrote:
> >I'm getting this output on stderr from a next clause:
> > Exiting subroutine via next at ./test_bol.pl line 101.
> >
> >I wondered why this happens. Is it considered an err
Harry Putnam wrote:
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why I put it there. S
From: "Larry Guest" <[EMAIL PROTECTED]>
> What I need to do now is not only have is display information to
> STDERR and STDOUT but also write the same information I see when I run
> the command to a file.
Strange you only got a few Unix-only solutions when there are at
I think I have it.
I had to have
close (STDERR)
close (STDOUT)
close (TEE)
-Original Message-
From: Larry Guest [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 11:22 PM
To: 'Randal L. Schwartz'; [EMAIL PROTECTED]
Subject: RE: Redirect stdout, stderr to file and std
00:00:00 tee YourLogFileHere
I have a close (TEE); at the end as well.
Any thoughts?
Thanks
-Original Message-
From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 9:55 AM
To: [EMAIL PROTECTED]
Subject: Re: Redirect stdout, stderr to file and stdout
>>>>> "Larry" == Larry Guest <[EMAIL PROTECTED]> writes:
Larry> I have a small script that does some admin work for me.
Larry> What I need to do now is not only have is display information to STDERR
Larry> and STDOUT but also write the same information
On Fri, 16 Jan 2004, Larry Guest wrote:
> I have a small script that does some admin work for me.
>
> What I need to do now is not only have is display information to STDERR
> and STDOUT but also write the same information I see when I run the
> command to a file.
>
>
On Fri, Jan 16, 2004 at 05:02:52PM -0800, Larry Guest wrote:
> I have a small script that does some admin work for me.
>
> What I need to do now is not only have is display information to STDERR
> and STDOUT but also write the same information I see when I run the
> command to
print @_;
print OUTFILE @_;
}
###
-Original Message-
From: Larry Guest [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 5:03 PM
To: [EMAIL PROTECTED]
Subject: Redirect stdout, stderr to file and stdout
What I need to do now is not only have is displ
On Jan 16, 2004, at 5:02 PM, Larry Guest wrote:
I have a small script that does some admin work for me.
What I need to do now is not only have is display information to STDERR
and STDOUT but also write the same information I see when I run the
command to a file.
I have written it for others who
I have a small script that does some admin work for me.
What I need to do now is not only have is display information to STDERR
and STDOUT but also write the same information I see when I run the
command to a file.
I have written it for others who are not very technical. I want them to
be able
On Thu, Oct 16, 2003 at 02:01:54PM +0200, [EMAIL PROTECTED] wrote:
> Well this is good.
>
> But would be perfect to realy separate the STDERR from STDOUT. Probably will
> have diferent colors in the output. Can you get me that please.
It's right here:
> #my $pid = o
Well this is good.
But would be perfect to realy separate the STDERR from STDOUT. Probably will
have diferent colors in the output. Can you get me that please.
Thanks
Marcos
-Original Message-
From: zentara [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 1:56 PM
To: [EMAIL
I need to run one program and get the stdout and stdin from it.
If possible in real time.
like:
perl myscript.pl "perl -e 'foreach (1..5) {print 1; warn 2}; print \"end\"'"
would print
STDOUT: 1
STDERR: 2
STDOUT: 1
STDERR: 2
STDOUT: 1
STDERR: 2
STDOUT: end
Pr
Trina Espinoza wrote:
> I have this command that reads logfiles.However, if the command isn't
> successful it gives me a standard error.
>
> my @logData= `program1 -log $data1 $data2`;
>
>
> The error looks like this:
>
> program1: '//mnt/leah/dir/': The system cannot find the file specified
I have this command that reads logfiles.However, if the command isn't successful it
gives me a standard error.
my @logData= `program1 -log $data1 $data2`;
The error looks like this:
program1: '//mnt/leah/dir/': The system cannot find the file specified.
*How do I read that error for the st
well I found the answer to my question:
use strict;
use IPC::Open3;
local(*stdin, *stdout, *stderr);
open3(\*stdin, \*stdout, \*stderr, "perl testeSTDERR.pl");
print(join(", ", ));
close *stdin;
close *stdout;
close *stderr;
-Original Message-
From: [EMAIL PROTE
join(", ", ));
close FILE;
:::
So I'm trying to get the STDERR. How do I do this?
Thanks
Marcos
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Original Message -
From: isao <[EMAIL PROTECTED]>
Date: Tuesday, July 1, 2003 7:07 pm
Subject: stdout+stderr to file?
> I'm writing scripts that are basically wrappers for Linux shell
> commands.
> I want to be able to 1) print messages to screen along with say
&
I'm writing scripts that are basically wrappers for Linux shell commands.
I want to be able to 1) print messages to screen along with say the first
line of any STDERR, and 2) print messages, STDOUT, and STDERR to go to a
file.
The best I've come up with is something like the follo
d also do:
>
> sub readpipes {
>require IPC::Open3;
>my $pid = IPC::Open3::open3(my ($in, $out, $err), @_);
There is a nice module to make ipc even easier than IPC::Open3,
called Proc::Reliable
#!/usr/bin/perl
use Proc::Reliable;
$myproc = Proc::Reliable->new();
($out, $err, $
> >>
> >> I was wondering if it's possible to save the error of
> >> a DOS command from the error stream into a variable.
> >>
> > you could try the old 2>&1 trick
> > $out = `$cmd 2>&1`;
> >
as others have mentioned, the above may depend on your which win32 OS you
are using.
works fine on my
James Kipp <[EMAIL PROTECTED]> wrote:
> Navid M. <[EMAIL PROTECTED]> writes:
>>
>> I was wondering if it's possible to save the error of
>> a DOS command from the error stream into a variable.
>>
> you could try the old 2>&1 trick
> $out = `$cmd 2>&1`;
>
> or use system() and read the docs for
1 - 100 of 166 matches
Mail list logo