Re: looping through an array with for

2012-02-14 Thread Jim Gibson
At 9:08 PM -0700 2/14/12, Chris Stinemetz wrote: I have a for loop I would like to alter so that when the iteration reaches the last element in the array the varibale $lastmatch is passed to printf instead of $match. Does anyone have any suggestions? my $match = "GE 0 AND "; my $lastmatch = "GE

looping through an array with for

2012-02-14 Thread Chris Stinemetz
I have a for loop I would like to alter so that when the iteration reaches the last element in the array the varibale $lastmatch is passed to printf instead of $match. Does anyone have any suggestions? my $match = "GE 0 AND "; my $lastmatch = "GE 0"; for my $i (0 .. $#keyFields) { printf "%s %

Re: something about "strict"

2012-02-14 Thread Steve Bertrand
On 2012.02.14 15:12, timothy adigun wrote: On Tue, Feb 14, 2012 at 9:02 PM, Uri Guttman wrote: On 02/14/2012 02:38 PM, timothy adigun wrote: Hi Uri, On Tue, Feb 14, 2012 at 6:07 PM, Uri Guttman wrote: On 02/14/2012 12:02 PM, timothy adigun wrote: Hi lina, you could also use:

Re: something about "strict"

2012-02-14 Thread timothy adigun
On Tue, Feb 14, 2012 at 9:02 PM, Uri Guttman wrote: > On 02/14/2012 02:38 PM, timothy adigun wrote: > >> Hi Uri, >> >> On Tue, Feb 14, 2012 at 6:07 PM, Uri Guttman wrote: >> >> On 02/14/2012 12:02 PM, timothy adigun wrote: >>> >>> Hi lina, you could also use: no stri

Re: something about "strict"

2012-02-14 Thread Uri Guttman
On 02/14/2012 02:38 PM, timothy adigun wrote: Hi Uri, On Tue, Feb 14, 2012 at 6:07 PM, Uri Guttman wrote: On 02/14/2012 12:02 PM, timothy adigun wrote: Hi lina, you could also use: no strict 'vars' i.e: that is a very poor answer. she needed to use my correctly. turning off st

Re: something about "strict"

2012-02-14 Thread timothy adigun
Hi Uri, On Tue, Feb 14, 2012 at 6:07 PM, Uri Guttman wrote: > On 02/14/2012 12:02 PM, timothy adigun wrote: > >> Hi lina, >> >> you could also use: >> >> no strict 'vars' i.e: >> > > that is a very poor answer. she needed to use my correctly. turning off > strict is only for when you must

Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Brandon McCaig
On Tue, Feb 14, 2012 at 07:59:18PM +0200, Shlomi Fish wrote: > Hi Brandon, Hi Shlomi: tl;dr: Fixed. See bottom of message for diff. > What I would do is write another program (possibly in Perl) to > compare the differences and report immediately the location > within the two files, and the conte

Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Shlomi Fish
Hi Brandon, On Tue, 14 Feb 2012 12:12:07 -0500 Brandon McCaig wrote: > Hello: > > tl;dr: A program indended to split a large MS SQL script into > smaller ones appears to be losing data. See below for the script. > I guess that maybe I'm making a silly mistake with newlines or > file encoding or

Re: Rsync doesnot work

2012-02-14 Thread Punit Jain
I Jeff, Sorry but script doesnot run from command line as well. I changed the script to also include rsh => '/usr/local/bin/ssh', 'rsync-path' => '/usr/local/bin/rsync' for rsh over ssh and created passwordless login. But still doesnot work. Any clues ? Regards, Punit - Original Messa

Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Brandon McCaig
On Tue, Feb 14, 2012 at 12:12:07PM -0500, Brandon McCaig wrote: > The program follows (also attached in case my wrapping for mail > breaks something): I knew I would forget to attach it. :-X This time hopefully I remember.. Regards, -- Brandon McCaig Castopulence Software

Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Brandon McCaig
Hello: tl;dr: A program indended to split a large MS SQL script into smaller ones appears to be losing data. See below for the script. I guess that maybe I'm making a silly mistake with newlines or file encoding or something.. My colleague is working with a relatively large generated SQL script t

Re: something about "strict"

2012-02-14 Thread Uri Guttman
On 02/14/2012 12:02 PM, timothy adigun wrote: Hi lina, you could also use: no strict 'vars' i.e: that is a very poor answer. she needed to use my correctly. turning off strict is only for when you must do it as with some symbol table munging. it should never disabled for basic vari

Re: something about "strict"

2012-02-14 Thread timothy adigun
Hi lina, you could also use: no strict 'vars' i.e: #!/usr/bin/perl use strict; use warnings; sub add { no strict 'vars'; # added $results = $_[0] + $_[1]; print "The result was: $results\n"; } add(1,2); # print "The result was: 3" __END__ However, it's a good practic