Re: [Boston.pm] suppressing warnings

2013-05-05 Thread Greg London
Wow, I have never seen "warnings" used as an invocant to a method call before. I'm currently using: use Exporter 'import'; our @EXPORT = qw ( stuff ); but I'll rewrite it to use an import() subroutine and Exporter's export_to_level() call instead. Thanks, Greg > If your module has an im

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread Ben Tilly
If your module has an import method, and in that method calls warnings->unimport("once") then the unimport should be lexically scoped to where your package was used. Which in the normal case is the whole file, so it works. On Sat, May 4, 2013 at 2:07 PM, Jordan Adler wrote: > This pragma usage i

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread Jordan Adler
This pragma usage is lexically scoped, too. Sent from my iPhone On May 4, 2013, at 5:01 PM, Jordan Adler wrote: > Design issues aside, > > no warnings 'once'; > > Sent from my iPhone > > On May 4, 2013, at 3:47 PM, "Greg London" wrote: > >>> is there a way to suppress this warning from ins

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread David Cantrell
On 04/05/2013 20:47, Greg London wrote: is there a way to suppress this warning from inside testpackage.pm somehow? ... #!/usr/bin/env perl use warnings; use strict; use testpackage; somesub('tricky'); print "hello, tricky is '$main::tricky'\n"; When I run this script, I get the warning: Name

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread Jordan Adler
Design issues aside, no warnings 'once'; Sent from my iPhone On May 4, 2013, at 3:47 PM, "Greg London" wrote: >> is there a way to suppress this warning from inside testpackage.pm somehow? > > I've tried a bunch of things and still haven't found a solution. > > Is this not possible to do in

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread Jerrad Pierce
You can add some no-op-ish noise to sidestep the warning e.g; local $main::tricky; or use vars '$main::tricky'; ___ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm

Re: [Boston.pm] suppressing warnings

2013-05-04 Thread Greg London
> is there a way to suppress this warning from inside testpackage.pm somehow? I've tried a bunch of things and still haven't found a solution. Is this not possible to do in per? Or is it so obvious I can't see it? Greg > > package file testpackage.pm: > > package testpackage; > use warnings; >

[Boston.pm] suppressing warnings

2013-04-28 Thread Greg London
package file testpackage.pm: package testpackage; use warnings; use strict; use Data::Dumper; use Exporter 'import'; our @EXPORT = qw ( somesub ); sub somesub{ my ($name)=@_; my @caller=caller(0); my $package=$caller[0]; my $evalstr = '$'.$package.'::'.$name.' = 42