From hongxian at pcbi.upenn.edu Mon Aug 16 17:33:24 2004 From: hongxian at pcbi.upenn.edu (Hongxian He) Date: Mon Aug 16 17:33:19 2004 Subject: [Bioperl-microarray] warning "Exiting subroutine via next at ..." in ArrayDesign.pm In-Reply-To: References: Message-ID: <41212824.8010808@pcbi.upenn.edu> Hello, Allen: I got the following warning message (hundreds of lines) when using the ArrayDesign module to parse a CDF file. (CVS version 1.6) Exiting subroutine via next at /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm line 209, line 71804. Exiting subroutine via next at /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm line 209, line 71845. Exiting subroutine via next at /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm line 209, line 71846. The warning came from the following subroutine. After googling a bit, I found out that the warning can be avoided by using "return" rather than "next" to exit from the subroutine. (Use 'next', 'redo', and 'last' to alter the execution path in loop construcs.) sub load_data { my($self,$line) = @_; next unless $line; ... } Thanks, Hongxian From allenday at ucla.edu Mon Aug 16 17:47:41 2004 From: allenday at ucla.edu (Allen Day) Date: Mon Aug 16 17:49:48 2004 Subject: [Bioperl-microarray] Re: warning "Exiting subroutine via next at ..." in ArrayDesign.pm In-Reply-To: <41212824.8010808@pcbi.upenn.edu> References: <41212824.8010808@pcbi.upenn.edu> Message-ID: fixed in cvs, thanks. On Mon, 16 Aug 2004, Hongxian He wrote: > Hello, Allen: > > I got the following warning message (hundreds of lines) when using the > ArrayDesign module to parse a CDF file. (CVS version 1.6) > > Exiting subroutine via next at > /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm > line 209, line 71804. > Exiting subroutine via next at > /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm > line 209, line 71845. > Exiting subroutine via next at > /home/hongxian/lib/perl/lib/perl5/site_perl/5.8.0/Bio/Expression/Microarray/Affymetrix/ArrayDesign.pm > line 209, line 71846. > > > The warning came from the following subroutine. After googling a bit, I > found out that the warning can be avoided by using "return" rather than > "next" to exit from the subroutine. (Use 'next', 'redo', and 'last' to > alter the execution path in loop construcs.) > > sub load_data { > my($self,$line) = @_; > > next unless $line; > ... > } > > Thanks, > Hongxian > >