
japhy
Enthusiast
/ Moderator
Mar 15, 2000, 10:33 PM
Post #2 of 9
(8306 views)
|
Re: quiteing un-neccessary warnings
[In reply to]
|
Can't Post
|
|
Under what conditions are you getting this warning? What's your version of Perl? This sounds like you're defining a subroutine inside a subroutine: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl -w use strict; sub foo { my $m = { suffix => '.html' }; my @array = ("foo","bar"); &routine(1, \@array); print "@array"; sub routine { my ($test, $iter) = @_; if ($test) { map { $_ .= $m->{suffix} } @$iter; } } } </pre><HR></BLOCKQUOTE> This gives me the compile-time warning of Variable "$m" will not stay shared at john.pl line 14. If you want this warning to be specifically turned off, there is a way to do that in Perl 5.6 (coming soon), and I have a module that lets you do it in versions of Perl BEFORE 5.6. If you're interested in it, let me know.
|