Sponsored Content
Full Discussion: Perl strict
Top Forums Shell Programming and Scripting Perl strict Post 302276668 by buffoonix on Wednesday 14th of January 2009 10:35:09 AM
Old 01-14-2009
Quote:
Originally Posted by otheus
Bah.

Most of perl these days is modularized, with variables accessed through AUTOLOAD functions or entries in hash tables, for which "use strict" is useless.

In my opinion, if you have to use "strict", you're probably using the wrong programming language.
Interesting opinion, you may be right, for I don't claim to be a Perl expert.
It only happens that I quite regularly attend Perl conferences and workshops where the acclaimed Perl elite meets and gives talks and presentations.
Almost all the sample code presented at these events sticks to use strict and there seems to be common (tacit?) agreement that it is considered good style.
I'm not sure if you would suggest that e.g. Damian Conway is using the wrong language?
At least in his Perl Best Practices in chapter 18 in the pragraph on Stricture it reads, Always use strict, followed by some explanation why you should do so, but also that you cannot always rely on that it will capture every mistake.
Finally, if I use a well tested and proven useful module (e.g. one of the better ones from CPAN) I think I would rely most of the times on that the module author(s) have done a decent job in at least eliminating those bugs that stricture would capture.
It is more for the wrapping code that I add where I would like to make use of this extra parachute because I know too well how easily even typos happen whose unnecessary debugging would waste far too much time.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strict Argument

Im trying to write a bash script that has an if statment that when the user enters ONLY that exact argument, will echo what follows that conditon. For example: for file in $1 do if then Var1=$(cat hello | egrep "that pattern" | awk '{ print $NF }') cat $Var1 fi done Basically,... (3 Replies)
Discussion started by: oxoxo
3 Replies

2. Shell Programming and Scripting

Passing date formats in Perl: i.e. Jul/10/2007 -> 20070710 (yyyymmdd) - Perl

Hi , This script working for fine if pass script-name.sh Jul/10/2007 ,I want to pass 20070710(yyyymmdd) .Please any help it should be appereciated. use Time::Local; my $d = $ARGV; my $t = $ARGV; my $m = ""; @d = split /\//, $d; @t = split /:/, $t; if ( $d eq "Jan" ) { $m = 0 }... (7 Replies)
Discussion started by: akil
7 Replies

3. Shell Programming and Scripting

New PERL guru's help on strict.pm

I opened strict.pm and found some not understandable stuff, please let me know if you have any Idea on the same. 1) Line 23 => $bits |= (what is $= here how it affect the statement) 2) Line 36 => $^H (what is that I haven't found any statement on this in google) 3) Line 41 =>... (3 Replies)
Discussion started by: jatanig
3 Replies

4. Shell Programming and Scripting

Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time.

How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ? Like in Shell script, we use tee, is there anything in Perl or any other option ? (2 Replies)
Discussion started by: butterfly20
2 Replies

5. UNIX for Advanced & Expert Users

perl and HP-UX : instmodsh in combination with software depot : update inventory for installed Perl

we create a HP-UX software depot with a new perl-modul. after installation of the software depot, the perl module i can't find with instmodsh in the inventory for installed Perl modules. - i have learned of using instmodsh command : i find out what modules are already installed on my system. ... (0 Replies)
Discussion started by: bora99
0 Replies

6. Shell Programming and Scripting

Help! Can't locate strict.pm after Cygwin update

I installed gcc4 today using setup.exe from cygwin. However, I cannot run any of my perl program after that. For example, Run@Run-THINK /home $ perl Process.pl Can't locate strict.pm in @INC (@INC contains: /usr/lib/perl5/5.10/i686-cygwin / usr/lib/perl5/5.10... (0 Replies)
Discussion started by: littledeer
0 Replies

7. UNIX for Advanced & Expert Users

Ssh disable strict checking

What are the different ways to disable ssh strict checking? I've seen this mentioned a few times but it doesn't seem to be working. $ ssh -o 'StrictHostKeyChecking no' admin@hostnamehttp://docs.oracle.com/cd/E35328_01/E35336/html/vmcli-ssh.html Is there a file somewhere in /etc that I could... (4 Replies)
Discussion started by: cokedude
4 Replies

8. Shell Programming and Scripting

Perl : Getopts and Strict -How to solve

How do I get past the error when using strict and GetOpts ? #!/usr/bin/perl use strict; use Getopt::Std; # Process the command line options die "Usage: $0 -r <router> -u <username> -p <password> -e <enable password>\n" if (@ARGV < 6); exit if (!getopts('r:u:p:e:')); my... (3 Replies)
Discussion started by: popeye
3 Replies

9. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrUser3Contributed Perl DocumePerl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict(3)

NAME
Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict - Prohibit various flavors of "no strict". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
There are good reasons for disabling certain kinds of strictures, But if you were wise enough to "use strict" in the first place, then it doesn't make sense to disable it completely. By default, any "no strict" statement will violate this policy. However, you can configure this Policy to allow certain types of strictures to be disabled (See "CONFIGURATION"). A bare "no strict" statement will always raise a violation. CONFIGURATION
The permitted strictures can be configured via the "allow" option. The value is a list of whitespace-delimited stricture types that you want to permit. These can be "vars", "subs" and/or "refs". An example of this customization: [TestingAndDebugging::ProhibitNoStrict] allow = vars subs refs SEE ALSO
Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module perl v5.16.3 2014-06-09 Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict(3)
All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy