Re: shift vs @_

2012-05-21 Thread David Christensen
On 05/21/2012 08:37 PM, Steve Bertrand wrote: On 2012-05-21 21:10, David Christensen wrote: Therefore, performance is first and clarity is second. Would you not agree that these are pretty extreme cases to be making such a wide-reaching decision on? Please trim your replies. No, I don't thi

Re: shift vs @_

2012-05-21 Thread Steve Bertrand
On 2012-05-21 21:10, David Christensen wrote: On 05/21/2012 12:40 PM, sono-io wrote: David, Are you saying that it would be faster to do: my $this_date = shift; my $output = shift; as opposed to: my ($this_date, $output) = @_; or am I not reading your assessment correctly? 1. Benchmarking on t

Re: shift vs @_

2012-05-21 Thread Rob Dixon
On 21/05/2012 21:12, sono...@fannullone.us wrote: Hi Paul, Please don't care about this until your code is running correctly but too slowly and profiling has determined that this is the bottleneck. I'm curious as to why you say this. If one way is faster than another, wouldn't it be better to

Re: shift vs @_

2012-05-21 Thread David Christensen
On 05/21/2012 12:40 PM, sono-io wrote: David, Are you saying that it would be faster to do: my $this_date = shift; my $output = shift; as opposed to: my ($this_date, $output) = @_; or am I not reading your assessment correctly? 1. Benchmarking on the target (production)

Re: shift vs @_

2012-05-21 Thread sono-io
> For one thing, there is the "Lies, Damned Lies and Benchmarks" factor I must have missed the e-mail that said "DOG PILE!!!". =;) Thanks to everyone for the explanations - all good food for thought. That's why I'm here. Marc -- To unsubscribe, e-mail: beginners-unsubscr...@pe

Re: shift vs @_

2012-05-21 Thread Lawrence Statton
On 05/21/2012 03:12 PM, sono...@fannullone.us wrote: Hi Paul, Please don't care about this until your code is running correctly but too slowly and profiling has determined that this is the bottleneck. I'm curious as to why you say this. If one way is faster than another, wouldn't it

Re: shift vs @_

2012-05-21 Thread Steve Bertrand
On 2012-05-21 14:51, Shawn H Corey wrote: On 12-05-21 04:32 PM, Steve Bertrand wrote: On 2012-05-21 14:12, sono...@fannullone.us wrote: Hi Paul, Please don't care about this until your code is running correctly but too slowly and profiling has determined that this is the bottleneck. I'm cur

Re: shift vs @_

2012-05-21 Thread Shawn H Corey
On 12-05-21 04:32 PM, Steve Bertrand wrote: On 2012-05-21 14:12, sono...@fannullone.us wrote: Hi Paul, Please don't care about this until your code is running correctly but too slowly and profiling has determined that this is the bottleneck. I'm curious as to why you say this. If one way is

Re: shift vs @_

2012-05-21 Thread Steve Bertrand
On 2012-05-21 14:12, sono...@fannullone.us wrote: Hi Paul, Please don't care about this until your code is running correctly but too slowly and profiling has determined that this is the bottleneck. I'm curious as to why you say this. If one way is faster than another, wouldn't it be

Re: shift vs @_

2012-05-21 Thread Steve Bertrand
On 2012-05-21 13:40, sono...@fannullone.us wrote: On May 20, 2012, at 10:07 PM, David Christensen wrote: I've updated function_arguments.pl with Benchmark, below. f_direct() is the fastest, f_shift() is in the middle (12% slower), and f_assign() is the slowest (37%). David, Are you

Re: shift vs @_

2012-05-21 Thread sono-io
Hi Paul, > Please don't care about this until your code is running correctly but > too slowly and profiling has determined that this is the bottleneck. I'm curious as to why you say this. If one way is faster than another, wouldn't it be better to do it that way, as long as it doesn't c

Re: Unblessed reference problem

2012-05-21 Thread sono-io
On May 20, 2012, at 8:28 AM, Shlomi Fish wrote: > The problem is that «$self->animals» returns an (unblessed) array reference > and > not the list of individual animals, so you should do something like: > > for my $animal (@{ $self->animals }) { Thanks, Shlomi. That did it. Moose is a

Re: shift vs @_

2012-05-21 Thread Paul Johnson
On Mon, May 21, 2012 at 12:40:15PM -0700, sono...@fannullone.us wrote: > On May 20, 2012, at 10:07 PM, David Christensen wrote: > > > I've updated function_arguments.pl with Benchmark, below. f_direct() is the > > fastest, f_shift() is in the middle (12% slower), and f_assign() is the > > slowes

Re: shift vs @_

2012-05-21 Thread sono-io
On May 20, 2012, at 10:07 PM, David Christensen wrote: > I've updated function_arguments.pl with Benchmark, below. f_direct() is the > fastest, f_shift() is in the middle (12% slower), and f_assign() is the > slowest (37%). David, Are you saying that it would be faster to do: my $this

Re: Closing CGI/DB connections

2012-05-21 Thread jm
i have a whole collection of scripts that does this... at home. it's been quite a while but i believe what you want is $dbh->commit; $dbh->disconnect' to close a particular connection. hopefully someone can verify/correct http://search.cpan.org/~timb/DBI-1.620/DBI.pm will document all the detail

Closing CGI/DB connections

2012-05-21 Thread Mark Haney
I know this will sound incredibly stupid and n00bish, but I've encountered something I've never dealt with before. I'm setting up a perl based web application (this is my first web app, not my first perl) and have an issue with multiple DBI calls in a page and how I handle those calls. For th

Re: shift vs @_

2012-05-21 Thread Shawn H Corey
On 12-05-21 01:07 AM, David Christensen wrote: That's what I thought, until I started writing subroutines that modified @_ and stomped on the the caller's variables. Yes, that's what it does. That's why it's recommended to copy the values to my variables inside the subroutine. -- Just my 0.