Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
On Jun 17, 2014, at 1:27 PM, Jim Gibson wrote: I would split your one, long line into several lines and use a temporary variable to hold the possibly undefined value and assigning '' to it if it is undefined: I like that idea. Thanks, Jim. However, that's going to be a lot

Re: Stopping undefined warnings

2014-06-23 Thread SSC_perl
I just realized that I can add no warnings 'uninitialized'; to the entire script, which probably makes my last question moot. Unless there's an answer that someone likes better, just disregard that question. I can't think straight with this cold. Not that I need an excuse.

Stopping undefined warnings

2014-06-17 Thread SSC_perl
What's the best way to stop undefined warnings for code like this: $data-{'image'} = CopyTempFile('image') if ($main::global-{'admin'} $main::global-{'form'}-{'image_upload'} ne ''); CGI::Carp gives the following: [Tue Jun 17 14:54:36 2014] admin.cgi: Use of uninitialized

Re: Stopping undefined warnings

2014-06-17 Thread Jim Gibson
On Jun 17, 2014, at 1:02 PM, SSC_perl wrote: What's the best way to stop undefined warnings for code like this: $data-{'image'} = CopyTempFile('image') if ($main::global-{'admin'} $main::global-{'form'}-{'image_upload'} ne ''); CGI::Carp gives the following: [Tue Jun 17

Re: Stopping undefined warnings

2014-06-17 Thread Andy Bach
On Tue, Jun 17, 2014 at 3:27 PM, Jim Gibson jimsgib...@gmail.com wrote: my $upload = $main::global-{'form'}-{'image_upload'} || ''; if ($main::global-{'admin'} $upload ne '' ) { $data-{'image'} = CopyTempFile('image'); } I find that much more readable and will not generate any