Everything2
Near Matches
Ignore Exact
Full Text
Everything2

-w

created by WWWWolf

(thing) by WWWWolf (1.4 y) (print)   ?   (I like it!) Tue Sep 11 2001 at 9:38:08

Perl command line switch, used to turn on several very helpful warnings.

Typically, your Perl program should always have this sort of beginning:

#!/usr/bin/perl -w

use strict;

or, in the days of Perl 5.6,

#!/usr/bin/perl

use warnings;
use strict;

While Perl doesn't require strictness and warnings of Bad Habits, you bloody well should enable them, lest you dwell in the land of messy memory for ever, or worst of all - the mockery from Python zealots shall ring in your ears.

Perl creators consider the fact that -w or use warnings; isn't mandatory a bug. Regrettably, it can't be enabled by default - it would break amazing amounts of old code - but it's definitely recommended for all new code.

In the program code, -w has a different meaning, similiar to Bourne shell meaning. It tests whether a file is writeable or not:

if(!-w $file) {
   die "$0: the file $file isn't writeable.\n";
}

printable version
chaos

use strict -T warnings "right" != "too complex for beginners"
Everything is a perl script Jude Law strict Python
my first perl program Perl Bad Habit
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
Why the Borg have such terrible fashion sense
Everything Quests: Film Reviews
Granny shot
The Whiz-Bang Atlanta E2 Party
a case for lowercase
Jaguar
A duck meets God at a bar
Under normal circumstances, the Jewish community does not seek converts
The next revolution in music has not yet arrived
Ghost Dance
Kaspar Hauser
The Texas Chain Saw Massacre
colcannon
New Writeups
Glowing Fish
Tualatin River(place)
The Jacket
Words of Advice(idea)
keepinitreal
Why buy the cow when you can get the milk for free?(idea)
John_Fox
Good Intentions Gone Wrong(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
This page courtesy of The Everything Development Company