Re: Beginner's Introduction to Perl 5.10 exercise solution commentary

2010-12-12 Thread Shlomi Fish
Hi Onteria, On Monday 13 December 2010 02:52:42 Onteria wrote: > I just finished working on a solution for the exercises provided in the > tutorial located here: > > A Beginner's Introduction to Perl 5.10 - Perl.com > http://bit.ly/dHvsqC > (shortened to prevent cutoff) > > Instructions for the

Re: excluding undefined variables

2010-12-12 Thread shawn wilson
On Mon, Dec 13, 2010 at 1:05 AM, John W. Krahn wrote: > shawn wilson wrote: >> >> i'm trying to exclude undefined variables for that are to be put into >> a sql database date field, but none of this is working: >> >> sub correctdate {             # make valid sql DATE field >>    my $date = $_[ 0

Re: excluding undefined variables

2010-12-12 Thread John W. Krahn
shawn wilson wrote: i'm trying to exclude undefined variables for that are to be put into a sql database date field, but none of this is working: sub correctdate { # make valid sql DATE field my $date = $_[ 0 ]; my ($month, $day, $year) = split / /, $date if defined( $date )

Re: excluding undefined variables

2010-12-12 Thread Brian Fraser
You are declaring $corrected within the if block -- After it ends, the variable goes out of scope, making a strict[0] Perl blow up in your face. As you have warnings enabled, it shows that message (which you can look up in perldiag is you don't quite get [1]). The solution is simple: You just need

Re: excluding undefined variables

2010-12-12 Thread shawn wilson
On Sun, Dec 12, 2010 at 8:11 PM, shawn wilson wrote: > i'm trying to exclude undefined variables for that are to be put into > a sql database date field, but none of this is working: errr, sorry, my error with the current code is: Global symbol "$corrected" requires explicit package name at ./usc

excluding undefined variables

2010-12-12 Thread shawn wilson
i'm trying to exclude undefined variables for that are to be put into a sql database date field, but none of this is working: sub correctdate { # make valid sql DATE field my $date = $_[ 0 ]; my ($month, $day, $year) = split / /, $date if defined( $date ); $day =~ s/,//g if

Re: Beginner's Introduction to Perl 5.10 exercise solution commentary

2010-12-12 Thread shawn wilson
On Sun, Dec 12, 2010 at 7:52 PM, Onteria wrote: > I just finished working on a solution for the exercises provided in the > tutorial located here: > > A Beginner's Introduction to Perl 5.10 - Perl.com > http://bit.ly/dHvsqC > (shortened to prevent cutoff) > > Instructions for the exercise: > "Give

Beginner's Introduction to Perl 5.10 exercise solution commentary

2010-12-12 Thread Onteria
I just finished working on a solution for the exercises provided in the tutorial located here: A Beginner's Introduction to Perl 5.10 - Perl.com http://bit.ly/dHvsqC (shortened to prevent cutoff) Instructions for the exercise: "Given a month and the day of the week that's the first of that month,