Sponsored Content
Full Discussion: Prize of being an Admin
The Lounge War Stories Prize of being an Admin Post 302651193 by admin_xor on Tuesday 5th of June 2012 06:41:55 AM
Old 06-05-2012
Good story of "researching" on production systems. So people can do anything at anytime at your place?
 

6 More Discussions You Might Find Interesting

1. Solaris

fresh admin

hi everybody i'm just recreuted as UNIX system admin... please tell me from where do i have to begin... best regards (8 Replies)
Discussion started by: hmaiida
8 Replies

2. Solaris

Tape Admin

Tape: Need tape library help please. Need to configure a remote admin card in the L100. Anything helpful.....thxs (2 Replies)
Discussion started by: uwinix77
2 Replies

3. Post Here to Contact Site Administrators and Moderators

note for admin

i left a message for admin in the wrong thread.. it is in the what is on your mind thread since i can't move it or delete it.. i thought I would mention that I meant it to be in this thread.. sorry about the mistake.. thanx for your patience moxxx68 (3 Replies)
Discussion started by: moxxx68
3 Replies

4. What is on Your Mind?

Windows Admin switching to *nix Admin

I'm currently a Windows admin and have wanted to jump ship to the *nix side for a while now. I've been studying both through an lpic level 1 manual as I have time (focusing on debian), and a solaris 10 cert book. The problem is I only have a handful of hours a week to study, and my current job... (3 Replies)
Discussion started by: bobwilson
3 Replies

5. War Stories

Prize of being an Admin - Part 2

I was reading this thread of admin_xor Prize of being an Admin and thought will share this experience of mine which is kind of opposite to what he did - I didn't tell anybody what happened :D We were porting one of the subsystem from Solaris to Linux. As part of that we developed many wrapper... (23 Replies)
Discussion started by: ahamed101
23 Replies

6. What is on Your Mind?

Regarding Admin life either as DBA or UNIX Linux admin

I am planning to choose my career as Unix/Linux Admin or a DBA. But I have come to know from forums and few admins like the job will be 24/7. I have few questions on that. Can we get "DAY" shifts in any one of the admin Job ? Can't we have shift timings in any company ? Eventhough the... (7 Replies)
Discussion started by: Jacktts
7 Replies
Perl::Critic::Policy::InputOutput::RequireBriefOpen(3pm)User Contributed Perl DocumentatioPerl::Critic::Policy::InputOutput::RequireBriefOpen(3pm)

NAME
Perl::Critic::Policy::InputOutput::RequireBriefOpen - Close filehandles as soon as possible after opening them. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
One way that production systems fail unexpectedly is by running out of filehandles. Filehandles are a finite resource on every operating system that I'm aware of, and running out of them is virtually impossible to recover from. The solution is to not run out in the first place. What causes programs to run out of filehandles? Usually, it's leaks: you open a filehandle and forget to close it, or just wait a really long time before closing it. This problem is rarely exposed by test systems, because the tests rarely run long enough or have enough load to hit the filehandle limit. So, the best way to avoid the problem is 1) always close all filehandles that you open and 2) close them as soon as is practical. This policy takes note of calls to "open()" where there is no matching "close()" call within "N" lines of code. If you really need to do a lot of processing on an open filehandle, then you can move that processing to another method like this: sub process_data_file { my ($self, $filename) = @_; open my $fh, '<', $filename or croak 'Failed to read datafile ' . $filename . '; ' . $OS_ERROR; $self->_parse_input_data($fh); close $fh; return; } sub _parse_input_data { my ($self, $fh) = @_; while (my $line = <$fh>) { ... } return; } As a special case, this policy also allows code to return the filehandle after the "open" instead of closing it. Just like the close, however, that "return" has to be within the right number of lines. From there, you're on your own to figure out whether the code is promptly closing the filehandle. The STDIN, STDOUT, and STDERR handles are exempt from this policy. CONFIGURATION
This policy allows "close()" invocations to be up to "N" lines after their corresponding "open()" calls, where "N" defaults to 9. You can override this to set it to a different number with the "lines" setting. To do this, put entries in a .perlcriticrc file like this: [InputOutput::RequireBriefOpen] lines = 5 CAVEATS
"IO::File->new" This policy only looks for explicit "open" calls. It does not detect calls to "CORE::open" or "IO::File->new" or the like. Is it the right lexical? We don't currently check for redeclared filehandles. So the following code is false negative, for example, because the outer scoped filehandle is not closed: open my $fh, '<', $file1 or croak; if (open my $fh, '<', $file2) { print <$fh>; close $fh; } This is a contrived example, but it isn't uncommon for people to use $fh for the name of the filehandle every time. Perhaps it's time to think of better variable names... CREDITS
Initial development of this policy was supported by a grant from the Perl Foundation. AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2007-2011 Chris Dolan. Many 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.14.2 2012-06-07 Perl::Critic::Policy::InputOutput::RequireBriefOpen(3pm)
All times are GMT -4. The time now is 02:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy