NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Maybe... Build-time decision, perhaps? (Score:1, Interesting)
Wonder how many of my old scripts would croak as a result... Hm.
Inane warning used only once: possible typo (Score:1, Interesting)
I've barely dipped my toes into perl 5.6 so I'm not sure how much better things have gotten, but the "used only once" test is a good indicator as far as I'm concerned. I
Re:Inane warning used only once: possible typo (Score:1, Interesting)
BEGIN {
# this is the worst damned warning ever, so SHUT UP ALREADY!
$SIG{__WARN__} = sub { warn @_ unless $_[0] =~
I dont agree (Score:1, Interesting)
"Love, work and knowledge are the well-springs of our life. They should also govern it." - W. Reich
Support scripts? (Score:1, Interesting)
Not a good idea.... (Score:1, Interesting)
As for the ``possible typo'' warning, the new our $var construct should finally make it convenient to avoid.
Re:our() and "possible typo" (Score:1, Interesting)
Re:I dont agree (Score:1, Interesting)
Re:Inane warning used only once: possible typo (Score:1, Interesting)
BTW, is there really ever a need to use a variable only once?
glauber
Re:Inane warning used only once: possible typo (Score:1, Interesting)
Consider:
# foo.pl
$foo = 'bar';
-----------
#!/usr/bin/perl -w
# myscript.plx
require 'foo.pl';
print $foo;
__END__
Yields:
# Name "main::foo" used only once: possible typo.
File 'Bourque:Desktop Folder:Untitled #2'; Line 3
bar
Huh? Oh yeah, I use it only once _at compile time_. Oopsie. Wrapping the require statement in BEGIN { }
Re:Inane warning used only once: possible typo (Score:1)
use warnings;
{
no warnings 'once';
print *Another::Package::used_once = sub { 1 };
}
Re:I dont agree (Score:1, Interesting)
This is bogus. We already have the situation where an upgrade of perl may break old programs. Anyone who upgrades perl blindly is a fool.
Warnings and stricture don't force you to do things in a unique way. Perl has no ego, it doesn't care how you do things. If 80% (
Re:Support scripts? (Score:1, Interesting)
Re:I dont agree (Score:1, Interesting)
I don't think such numbers matter much. I think right and wrong, when applicable, matter. And I think they are applicable here. I think it is wrong to force me to have to type an extra flag or something to get my hundreds of one-liners and short scripts to compile.
So let's talk about numbers in this manner: you think it is bogus to say old programs would break, that old programs are broken by many
perl -w (Score:1, Interesting)
As with the 'use strict' pragma as well, it slows your program down a bit, so I usually keep the warnings while developing, but then take them out on production code.
Speaking of warnings... from Slash.pm (Score:1, Interesting)
This is from Slash.pm, the main module that powers slashdot and use.perl.org. I always thought this was some of the silliest hackery I'd every seen:
BEGIN { /Use of uninitialized value/ };
# this is the worst damned warning ever, so SHUT UP ALREADY!
$SIG{__WARN__} = sub { warn @_ unless $_[0] =~
}
darren
(darren)
Re:I dont agree (Score:1, Interesting)
perl and newbie-perl.
I hope I don't have to put the smiley for you to tell that I'm joking here.
stricture and warnings compiled in (Score:1, Interesting)
I think it could be useful, and here is why. As duff said, there are many new programmers which we always tell the