On 2/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
After 20 minutes of web scouring can anyone tell if there is there
a difference between 'use warnings' and '-w'. Should I care?
Did you see the perllexwarn manpage anywhere in your scouring? Cheers!
--Tom Phoenix
Stonehenge Perl Trainin
On 4/15/06, mattesonweb <[EMAIL PROTECTED]> wrote:
> !# /usr/bin/perl
> use warnings;
You need to reverse those first two characters. Pound-bang is the
traditional start of executable scripts. But when reversed, Perl
thinks you're trying to negate the boolean value of 'use warnings',
and that's n
"Mark Cohen" <[EMAIL PROTECTED]> writes:
> While the use strict is quite clear to me "Perl pragma to restrict unsafe
> contructs" ,
> the use warnings "Perl pragma to control optional warnings" is not.
> What programming risks could I get without the use warnings ?
,[ perldoc perllexwarn ]
|
On Fri, 14 Jan 2005, Mark Cohen wrote:
>
> While the use strict is quite clear to me "Perl pragma to restrict unsafe
> contructs" ,
> the use warnings "Perl pragma to control optional warnings" is not.
> What programming risks could I get without the use warnings ?
perldoc -q warnings
Found in
Mystik Gotan wrote:
> No. Use warnings is a module, the -w flag is just some extra for error
> trapping (which sometimes really is useful!). But it's alright using both
> (along with strict, ofcourse). So -w is a built in 'function' and
> warnings.pm is just a module.
>
> (BTW, using the -T flag
>> On 26 Nov 2002 09:57:44, Dylan Boudreau <[EMAIL PROTECTED]> said:
> Is use warnings; the same as #!/usr/bin/perl -w
Good question. They're similar, but 'use warnings':
- only works under Perl 5.6+
- works _lexically_, rather than globally
- this means that you can do this:
pack
No. Use warnings is a module, the -w flag is just some extra for error
trapping (which sometimes really is useful!). But it's alright using both
(along with strict, ofcourse). So -w is a built in 'function' and
warnings.pm is just a module.
(BTW, using the -T flag for Taint Checking can also pr
No.
use warnings is file scoped. -w is 'executable' scoped. In other words any modules
that you 'use' will inherit the -w but not the 'use'.
At least that is my understanding from the Camel. And appears to be the case from what
I have seen in action.
http://danconia.org
--
If you put the -w flag in your shebang line like this
#!/usr/bin/perl -w
does it still throw an exception or do the warnings work?
>= Original Message From stanley <[EMAIL PROTECTED]> =
>i use solaris and ihave no root right.the version of perl5.005_03
>
>in a simple script if i try to
> both #!/usr/bin/perl -w and perl -w my.pl will do the warnings
> work,but use warnings will throw exception. if i setup a file called
> warnings.pm(it only conatins 1) in my lib and don't use directive or
> option,there is no warning and exception stanley
Put
$^W = 1;
into your warni
On Wed, Oct 09, 2002 at 07:55:13PM -0700, stanley wrote:
> #!/usr/bin/perl -w
>
> does it still throw an exception or do the warnings work?
-w on the shebang or command lines will work with any version of Perl. The
use warnings pragma was added in 5.6.0, and this is why you're getting the
error
Todd
how do you turn off the warning ?
stanley
>
> i use solaris and ihave no root right.the version of perl5.005_03
>
> in a simple script if i try to add "use warnings",it will say Can't locate
> warnings in @inc(@inc..)
>
> instead if i use perl -w my.pl,it will give me the warning inf
both #!/usr/bin/perl -w and perl -w my.pl will do the warnings work,but
use warnings will throw exception.
if i setup a file called warnings.pm(it only conatins 1) in my lib and don't use
directive or option,there is no warning and exception
stanley
nkuipers wrote: If you put the -w flag in
Stanley wrote:
>
> i use solaris and ihave no root right.the version of perl5.005_03
>
> in a simple script if i try to add "use warnings",it will say Can't locate
> warnings in @inc(@inc..)
>
> instead if i use perl -w my.pl,it will give me the warning information. so
> how can i modify m
14 matches
Mail list logo