Re: Need a Perl Regex Help

2009-11-13 Thread 7
On Fri, Nov 13, 2009 at 5:07 AM, Parag Kalra wrote: > Hey All, > > I have a following a LDIF file to process through Perl - > > ### > dn: ou=71404558, ou=Company, ou=Personal, o=paragkalra.com > dn: ou=People, ou=71404558, ou=Company, ou

Re: Need a Perl Regex Help

2009-11-13 Thread 7
On Fri, Nov 13, 2009 at 5:07 AM, Parag Kalra wrote: > Hey All, > > I have a following a LDIF file to process through Perl - > > ### > dn: ou=71404558, ou=Company, ou=Personal, o=paragkalra.com > dn: ou=People, ou=71404558, ou=Company, ou

Re: Warning: Use of uninitialized value

2010-01-30 Thread 7
a) > open (BHF_FILE, ") { #do something with $line } close $BHF_FILE; b) Take a look at this code: use strict; use warnings; use 5.010; my $line = 'hello world goodbye'; my @pieces = split / /, $line, 2; for (@pieces) { say; } --output:-- hello world goodbye At the command line,

Re: Warning: Use of uninitialized value

2010-01-30 Thread 7
On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote: > Why are you replying to me? My post did use the three-argument form of > open(). Also: > > - It is bad form to use upper case letters for lexical variables > "Perl Best Practices" disagrees with you. > - Passing / / as the first parameter of

Re: prepare(SELECT ... FROM TABLE) error

2010-02-01 Thread 7
above: $@"; } --output:-- executing other code here There was an error inside that eval block above: ***prepare error*** at 2perl.pl line 7.

Re: prepare(SELECT ... FROM TABLE) error

2010-02-02 Thread 7
On Mon, Feb 1, 2010 at 1:40 PM, Tony Esposito wrote: > Is this the idea? I do not ever want to catch the error from the prepare > statement itsel > I thought you said the program fails if you don't catch the error? If so, and you want your program to continue executing, then you have to catch

Re: 1-line text file with numbers, need to add to them

2010-02-06 Thread 7
On 2/4/10, Chris wrote: > On Feb 4, 10:59 am, shlo...@iglu.org.il (Shlomi Fish) wrote: >> Hi Chris! >> >> Have you visitedhttp://perl-begin.org/yet and read a good introductory >> book >> or tutorial? >> >> On Thursday 04 Feb 2010 09:27:32 Chris wrote: >> >> > I need some help with this problem. >

Re: 1-line datafile, need data for another routine

2010-02-06 Thread 7
ontains 30 values that were >>> written previously, and this has been verified over and over. >>> >>> sub newValues { >>> my($file) = shift; >>> >>> open(FILE, "<$file") or die("Unable to open data file."); >

Re: Syntax for if

2010-02-08 Thread 7
On 2/8/10, Chris Coggins wrote: > What is the proper syntax for a comparison at the end of a subroutine to > stop the script if a certain variable is "0" or ''? > > sub routine{ > (get data and process it) > if $varA = '' || $varA = "0" { > (stop script, print error message to user) > } > else{ >

Re: Syntax for if

2010-02-08 Thread 7
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote: > On 2/8/10, Chris Coggins wrote: >> What is the proper syntax for a comparison at the end of a subroutine to >> stop the script if a certain variable is "0" or ''? >> >> sub routine{ >&g

Re: Syntax for if

2010-02-08 Thread 7
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote: > On 2/8/10, 7 <7stud.7s...@gmail.com> wrote: >> On 2/8/10, Chris Coggins wrote: >>> What is the proper syntax for a comparison at the end of a subroutine to >>> stop the script if a certain variable is "0&qu

Re: Syntax for if

2010-02-08 Thread 7
On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote: > >>>>> "7" == 7 <7stud.7s...@gmail.com> writes: > > 7> if (defined $var && ($var eq '' || $var eq '0')) { > > 7> #code > > 7> } > > 7&

Re: Syntax for if

2010-02-08 Thread 7
On Mon, Feb 8, 2010 at 9:00 PM, 7 <7stud.7s...@gmail.com> wrote: > On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote: > >> >>>>> "7" == 7 <7stud.7s...@gmail.com> writes: >> >> 7> if (defined $var && ($var eq ''

Re: Syntax for if

2010-02-08 Thread 7
On Mon, Feb 8, 2010 at 6:45 PM, Chris Coggins wrote: > Thanks Jim. I used > > exit(0) unless $varA; > That form of unless is especially poor style.

Re: Syntax for if

2010-02-08 Thread 7
On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote: > >>>>> "7" == 7 <7stud.7s...@gmail.com> writes: > they both read fine in english which is why they we included by > larry. They don't both read fine. To many people, unless is a confusing