Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perl::critic::policy::variables::protectprivatevars(3) [centos man page]

Perl::Critic::Policy::Variables::ProtectPrivateVars(3)	User Contributed Perl Documentation Perl::Critic::Policy::Variables::ProtectPrivateVars(3)

NAME
Perl::Critic::Policy::Variables::ProtectPrivateVars - Prevent access to private vars in other packages. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
By convention Perl authors (like authors in many other languages) indicate private methods and variables by inserting a leading underscore before the identifier. This policy catches attempts to access private variables from outside the package itself. CONFIGURATION
This Policy is not configurable except for the standard options. HISTORY
This policy is inspired by a similar test in B::Lint SEE ALSO
Perl::Critic::Policy::Subroutines::ProtectPrivateSubs AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2006-2011 Chris Dolan. 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::Variables::ProtectPrivateVars(3)

Check Out this Related Man Page

Perl::Critic::Policy::Variables::RequireNegativeIndices(User Contributed Perl DocumentPerl::Critic::Policy::Variables::RequireNegativeIndices(3pm)

NAME
Perl::Critic::Policy::Variables::RequireNegativeIndices - Negative array index should be used. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Conway points out that $arr[$#arr]; $arr[$#arr-1]; $arr[@arr-1]; $arr[@arr-2]; are equivalent to $arr[-1]; $arr[-2]; $arr[-1]; $arr[-2]; and the latter are more readable, performant and maintainable. The latter is because the programmer no longer needs to keep two variable names matched. This policy notices all of the simple forms of the above problem, but does not recognize any of these more complex examples: $some->[$data_structure]->[$#{$some->[$data_structure]} -1]; my $ref = @arr; $ref->[$#arr]; CONFIGURATION
This Policy is not configurable except for the standard options. AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2006-2011 Chris Dolan. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-07 Perl::Critic::Policy::Variables::RequireNegativeIndices(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Code Hiding

Is there a way to hide the Perl script like we do in C and other languages? :rolleyes: (5 Replies)
Discussion started by: sskb
5 Replies

2. Shell Programming and Scripting

Perl to C convertor

Is there one out there that supports Perl/Tk ??? (5 Replies)
Discussion started by: perleo
5 Replies

3. UNIX for Dummies Questions & Answers

Using Variables to Set Other Variables

I have a script that I'm trying to shorten (below) by removing repetitive code. if ] then commodity_ndm_done=Y fi if ] then customer_ndm_done=Y fi if ] then department_ndm_done=Y fi if ] then division_ndm_done=Y fi (3 Replies)
Discussion started by: superdelic
3 Replies

4. Shell Programming and Scripting

Best place on the net to get Perl tutorials ?

I am looking for a full Perl course on internet (tutorial) to learn everything about Perl. I already know a bunch of programing languages. I have started Unix interests this year ever since I installed Ubuntu Linux on my PC AND I also got a job at IBM doing software distributions with... (1 Reply)
Discussion started by: Browser_ice
1 Replies

5. Shell Programming and Scripting

Problem with storage of PID's to variables

I have the following problem to be solved: I read a .csv file (tempfile), fetch the values into variables F1 to F5. Variables F1, F2, F3 are parameters used for running a program (blablaprogram). Variable F4 I want to use to store the PID-value in and variable F5 is used for storing the return... (3 Replies)
Discussion started by: zwiebertje11
3 Replies

6. UNIX for Dummies Questions & Answers

Variables

i have a script i want that two varibles to be copied to another file. can anyone help me with this Thanks in advance Gina (3 Replies)
Discussion started by: gina
3 Replies

7. Shell Programming and Scripting

Comparing Variables in Perl

Hi. I have three arrays. @a=('AB','CD','EF'); @b=('AB,'DG',HK'); @c=('DD','TT','MM'); I want to compare the elements of the first two array and if they match then so some substition. I tried using the if statement using the scalar value of the array but its not giving me any output. ... (7 Replies)
Discussion started by: kamitsin
7 Replies

8. Shell Programming and Scripting

Variables

Hi All Trying to get a better handle on variables. ie how $1, $2, $3... are used. I have tried searching this site without much luck. When it would be used in how is $1 used in a program? I know you can asign variables x=4, just do not understand $1, $2. Thanks, Doug (1 Reply)
Discussion started by: Reddoug
1 Replies

9. UNIX for Dummies Questions & Answers

Variables question

Hi I am trying to find were to look for definitions of these variables; $0, $1, $2, $#, $$ , $*. I am not having much luck with my searching. Can anyone point me in the right direction? Thanks, Doug (3 Replies)
Discussion started by: Reddoug
3 Replies

10. Shell Programming and Scripting

Unix Shell scripting, removing hex 0d 0a

hi, I have a file with data like this : 5963491,11926750,Policy Endorsement 1 Policy Endorsement 2 Policy Endorsement 3 Policy Endorsement 4 Policy Endorsement 5 Policy Endorsement 6 Policy Endorsement 7 5963492,11926751,Product.Quote... (10 Replies)
Discussion started by: mrsindhe87
10 Replies

11. Shell Programming and Scripting

Perl Methods Calling

Hello I am on my way to improve my wonderful Perl skills, I got an issue which I want to share with you all. I have a Perl module which looks like package Cocoa; require Exporter; @ISA = qw(Exporter); my $a=''; my $b=''; my $c=''; sub new { my $this = shift; # Create... (8 Replies)
Discussion started by: adisky123
8 Replies

12. Shell Programming and Scripting

awk problem two lines in the same line

Hi guy, I have an output command like this: Policy Name: NBU.POL.ORA.PROD Policy Type: Oracle Active: yes HW/OS/Client: Linux RedHat2.6 node1 Iclude: /usr/openv/netbackup/scripts/backup_ora1.bash I would like to parse the... (1 Reply)
Discussion started by: luca72m
1 Replies

13. Shell Programming and Scripting

Perl Matching multiple variables

I am trying to match mulitple (3) variables. I found the sub given below on the web which works well when all vars are defined. But there are situations where one or two will not be defined (at least one will always be defined.) Example of the variable content possibilities The sub found... (4 Replies)
Discussion started by: popeye
4 Replies

14. Shell Programming and Scripting

Assigning Variables

Hi, Can the below be clarified please. i just want to know what is the difference between the two ways of assigning variables as mentioned below. export SRC_TBL=${SRC_TBL-"MMA_COPAY_PLN_FACT_STG"} export SRC_TBL="MMA_COPAY_PLN_FACT_STG" thanks in advance :) Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies

15. Programming

Perl: How to load some functions automaticaly, starting Perl inteructively (with -d -e 0)?

I would like to use Perl in 'interactive' mode (kind off), starting it by > perl -d -e 0; But I need to have some function be read on loading. Also, it should not be for anyone who starting Perl or use it any how. I did try to search, but not much result. I have try a file '.perldb':... (1 Reply)
Discussion started by: alex_5161
1 Replies