Re: error on simple system command

2007-11-27 Thread Tom Phoenix
On 11/27/07, lerameur <[EMAIL PROTECTED]> wrote: > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; Since you didn't chomp() it, and since you didn't need to add a newline when you printed it, it seems that $file_

Re: error on simple system command

2007-11-27 Thread John W . Krahn
On Tuesday 27 November 2007 08:18, lerameur wrote: > > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; > > open (FILE, "< /test/$file_to_print") or die "Could not open > file_to_print $: $!"; > > although the thi

Re: error on simple system command

2007-11-27 Thread lerameur
works good now: my $file_to_print = ( `ls -1c /test/*log | tail -1 `); print "file_to_print: $file_to_print"; open (FILE, "< /test/$file_to_print") or die "Could not open file_to_print $: $!"; although the third line is not opening the file. It prints out good but but I

Re: error on simple system command

2007-11-26 Thread Jenda Krynicky
To: beginners@perl.org From: lerameur <[EMAIL PROTECTED]> Subject: error on simple system command Date sent: Mon, 26 Nov 2007 13:05:53 -0800 (PST) Organization: http://groups.google.com > Hello, > > I a

Re: error on simple system command

2007-11-26 Thread John W . Krahn
On Monday 26 November 2007 13:05, lerameur wrote: > Hello, Hello, > I am trying to use this two line script. The command by itself works, > when I run this script, I get error message: > Use of uninitialized value in concatenation (.) or string at ./ > find_date.pl line 8. > > line 8: my $file_t

error on simple system command

2007-11-26 Thread lerameur
Hello, I am trying to use this two line script. The command by itself works, when I run this script, I get error message: Use of uninitialized value in concatenation (.) or string at ./ find_date.pl line 8. line 8: my $file_to_print = system "ls -lrt /test/*log | tail -1 | awk {'print $9'}";