RE: Scope

2006-10-01 Thread Charles K. Clarkson
John Ackley wrote: : while( ($service) = $SERVICE->fetchrow_array ) { According to the DBI docs: "If there are no more rows or if an error occurs, then fetchrow_array returns an empty list." When a value is returned, $service is set to that value. When we get to the end of the l

Listerine

2006-10-01 Thread Mathew Snyder
Sorry. Just had to do it. :) -- Mathew Snyder -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Scope

2006-10-01 Thread John Ackley
simple scope question when is a global not a global? or how to get a value from inside a while() to the outside? two tests-extracted from much large program to show my problem test 1 my $count; my $service; while( ($service) = $SERVICE->fetch

RE: question about Data::Dumper

2006-10-01 Thread chen li
> This may be a more useful test. > > use strict; > use warnings; > use Bar; > > print "Sub routine > call:\n\tBar::print_result(1,2);\n"; > my $call = Bar::print_result(1,2); > > > print "\n\nMethod > call:\n\tBar->print_result(1,2);\n"; > $call = Bar->print_result(1,2); > > __END__ >

RE: question about Data::Dumper

2006-10-01 Thread Charles K. Clarkson
chen li wrote: Let's look at the calls: : my $call=&Bar::print_result(1,2); : my $call2=Bar->print_result(2); $call gets whatever is returned by Bar::print_result(). As we see below, Bar::print_result() always returns 1. Now. we'll look at what the sub returns: : sub print_result{

question about Data::Dumper

2006-10-01 Thread chen li
Hi all, I write a small script to see what is the difference between calling methods and regular subroutines. Then I use Data::Dumper to see the data structure. What I expecte is to print out a string(This is the data1 1 and data2 2) after using Dumper. But here are the results I get from using D

Re: Undefined subroutine &Main::BadData called at line 42

2006-10-01 Thread Ron Smith
--- Aaron Priven <[EMAIL PROTECTED]> wrote: > > On Sep 30, 2006, at 7:30 PM, Ron Smith wrote: > > > Hi all, > > > > I get the error: "Undefined subroutine > &Main::BadData > > called at line 42" when executing the following > '.cgi' > > script, with nothing entered in all of the text > > fields.

Re: can someone help out?

2006-10-01 Thread Mumia W.
On 10/01/2006 04:27 AM, Goke Aruna wrote: Dear all, I am just learning perl. i have the following code #!c:/perl/bin/perl -w use warnings; use strict; my $file = 'C:/Perl/20060920_1.csv'; open FH, $file or die $!; while(defined($file=)){ my @file = split/,/, $file; print qq($file[0], $file

Re: can someone help out?

2006-10-01 Thread Dr.Ruud
"Goke Aruna" schreef: > #!c:/perl/bin/perl -w Remove the -w. > use warnings; > use strict; Good! > my $file = 'C:/Perl/20060920_1.csv'; > open FH, $file or die $!; > while(defined($file=)){ > my @file = split/,/, $file; > print qq($file[0], $file[1], $file[10], $file[9], $file[12], > $f

Re: Undefined subroutine &Main::BadData called at line 42

2006-10-01 Thread Rob Dixon
Ron Smith wrote: Hi all, I get the error: "Undefined subroutine &Main::BadData called at line 42" when executing the following '.cgi' script, with nothing entered in all of the text fields. I'm unfamiliar with this error. Could someone give me an explaination behind this error? Here's the code

can someone help out?

2006-10-01 Thread Goke Aruna
Dear all,I am just learning perl.i have the following code#!c:/perl/bin/perl -wuse warnings;use strict;my $file =  'C:/Perl/20060920_1.csv';open FH, $file or die $!; while(defined($file=)){  my @file = split/,/, $file;   print qq($file[0], $file[1], $file[10], $file[9], $file[12], $file[13]\n);}the