Re: Command line perl to stat a file

2012-02-10 Thread Kevin Spencer
On Fri, Feb 10, 2012 at 10:52 AM, Harry Putnam wrote: > > But these command line attempts fail: > > (all on one line) >  perl  -e 'my ($seven, $nine) = >    (stat('./SweetwatterPk-016.jpg'))[7, 9]; >        print "$seven and $nine"' > > output: >  syntax error at -e line 1, near "stat(." >  Search

Re: is this ssh happenign in parallel?

2011-11-16 Thread Kevin Spencer
On Wed, Nov 16, 2011 at 3:34 PM, Rajeev Prasad wrote: > Salav > > thx a lot. I was able to use all the ssh options i need. > > last thing i need to understand is how to redirect the output to a local file > from all the commands: Just to offer a non-Perl suggestion, you could capture output and

Re: Perl script to retrieve specific lines from file

2011-08-10 Thread Kevin Spencer
On Wed, Aug 10, 2011 at 4:04 AM, Rob Coops wrote: > #!/usr/bin/perl > > use strict; > use warnings; > use File::Slurp; # A handy module check it out at: > http://search.cpan.org/~uri/File-Slurp-.19/lib/File/Slurp.pm While handy, be aware that you are slurping the entire file into memory, so j

Re: Wind32::ODBC question

2011-08-10 Thread Kevin Spencer
On Tue, Aug 9, 2011 at 6:51 AM, Gorrebeeck, Robert wrote: > I am using the Win32::ODBC module to connect to a Sybase database > > I can connect fine, but when I run a query to retrieve some data I keep > getting the following error > >            [Sybase][ODBC][connection timed out] While I have

Re: Exit subroutine on filehandle error

2011-07-28 Thread Kevin Spencer
On Wed, Jul 27, 2011 at 9:30 AM, Rob Dixon wrote: > What exactly is wrong with "or do {...}"? > > I believe it is the best option simply because is is comparable to the > common "open ... or die $!" idiom. The do is there only so that a > warning can be issued as well as the return There's nothin

Re: redirect system command STDER

2011-07-20 Thread Kevin Spencer
On Tue, Jul 19, 2011 at 12:14 PM, Tessio Fechine wrote: > Hello, > I have a subroutine that uses useradd to create accounts > > -- > @cmd = ('useradd', '-m', $account); > my $result = system @cmd; > -- > > but when useradd fails, I need to stop it from sending the error message to > STDER. > Is it