Sponsored Content
Full Discussion: What is your age? (Part 2)
The Lounge What is on Your Mind? What is your age? (Part 2) Post 302108127 by marlonus999 on Friday 23rd of February 2007 06:03:35 AM
Old 02-23-2007
I'm in the 21-30's range.

My first job was of engineering nature, designing IC mask and sorts. But during that time I fell in love with unix/linux stuff and that's where I started to choose a second job, an IT job this time. Now I work in an outsourcing/solutions company, but majority of my tasks are of shell-scripting nature. This time i'm having fun Smilie
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find a process age

I can write a script to use ps and interigate the output, but is there a command that works similar to the find command for files where I can request a list of all the running processes over 1 day old ? thanks! (8 Replies)
Discussion started by: MizzGail
8 Replies

2. What is on Your Mind?

What is your age?

What is your age? (15 Replies)
Discussion started by: royal
15 Replies

3. Shell Programming and Scripting

Check password age

Hi Guys, I hope one of you has already done this and is kind enough to share your script with me. I have a Solaris8 server that uses password aging for its local user accounts. I need a script that checks the age of the password and then sends the user an email if the password is about to... (3 Replies)
Discussion started by: Tornado
3 Replies

4. Shell Programming and Scripting

file age

How can I count the age of the file (e.g. in minutes)? (4 Replies)
Discussion started by: jarmo.leppanen
4 Replies

5. Shell Programming and Scripting

Identify age of the file.

Hi all, I'm using SunOS. need to find age of the file in terms of seconds. The file name with its path will be given to the script as input. Any kinda help will be appreciated. Thanks in advance (7 Replies)
Discussion started by: bankimmehta
7 Replies

6. AIX

Visual Age C++

hi , After i installed the visual age c++ its got installed but am not able to find the bin directory in the /usr/vacpp.am i need to install the some fileset ???? please help me.version is 7 mak (1 Reply)
Discussion started by: senmak
1 Replies

7. UNIX for Dummies Questions & Answers

Age of file

Hi All.. Is there any easy way to find out how many days older is file? for ex. fileA 20 days fileB 10 days I am currently on AIX, and there is no STAT command available in this environment. What are my options? Thanks Abhijeet R (1 Reply)
Discussion started by: freakabhi
1 Replies
Moose::Manual::Exceptions(3)				User Contributed Perl Documentation			      Moose::Manual::Exceptions(3)

NAME
Moose::Manual::Exceptions - Moose's exceptions VERSION
version 2.1202 Exceptions in Moose Moose will throw an instance of "Moose::Exception" when it encounters an error condition. There are many specific subclasses of Moose::Exception, each designed specifically for its particular error condition. These subclasses have attributes that contain relevant information, such as a stack trace, related metaclass objects, etc. Handling Moose Exceptions Because Moose's exceptions use the standard "die" mechanism, you are free to catch and handle errors however you like. You could use Perl's builtin "eval" to catch Moose exceptions. However due to the subtle problems "eval" can introduce into your programs, the Moose team strongly recommends using Try::Tiny instead. Please refer to Try::Tiny's documentation for a discussion of how "eval" is dangerous. The following example demonstrates how to catch and inspect a Moose::Exception. For the sake of simplicity, we will cause a very simple error. The "extends" keywords expects a list of superclass names. If we pass no superclass names, Moose will throw an instance of Moose::Exception::ExtendsMissingArgs. Catching with Try::Tiny use warnings; use strict; use Try::Tiny; try { package Example::Exception; use Moose; extends; # <-- error! } catch { # $_ contains the instance of the exception thrown by the above try block # $_ may get clobbered, so we should copy its value to another variable my $exception = $_; # exception objects are not ubiquitous in Perl, so we must check whether $exception is blessed # we also need to ensure that $exception is actually the kind of exception we were expecting if ( blessed $exception && $exception->isa("Moose::Exception::ExtendsMissingArgs") ) { # fetch attributes from the $exception object and display a friendly error to the user my $class_name = $exception->class_name; warn "You forgot to specify the superclass of $class_name, dummy!"; } else { # you've got some other kind of exception, so just print it # note: all Moose::Exception objects will stringify to a useful error message warn "$exception "; } } Example of catching ValidationFailedForTypeConstraint use warnings; use strict; use Try::Tiny; { package Person; use Moose; use Moose::Util::TypeConstraints; subtype 'NameStr', as 'Str', where { $_ =~ /^[a-zA-Z]+$/; }; has 'age' => ( is => 'ro', isa => 'Int', required => 1 ); has 'name' => ( is => 'ro', isa => 'NameStr', required => 1 ); } my $person; while( !$person ) { try { print "Enter your age : "; my $age = <STDIN>; chomp $age; print "Enter your name : "; my $name = <STDIN>; chomp $name; $person = Person->new( age => $age, name => $name ); my $person_name = $person->name; my $person_age = $person->age; print "$person_name is $person_age years old "; } catch { my $exception = $_; if ( blessed $exception && $exception->isa("Moose::Exception::ValidationFailedForTypeConstraint") ) { # fetch attributes from the $exception object and display a friendly error to the user my $attribute_name = $exception->attribute->name; my $type_name = $exception->type->name; my $value = $exception->value; warn "You entered $value for $attribute_name, which is not $type_name!"; } else { # you've got some other kind of exception, so just print it # note: all Moose::Exception objects will stringify to a useful error message warn "$exception "; } } } Example of catching AttributeIsRequired use warnings; use strict; use Try::Tiny; { package Example::RequiredAttribute; use Moose; has 'required_attribute' => ( is => 'ro', isa => 'Int', required => 1 ); } try { # we're not passing required_attribute, so it'll throw an exception my $object = Example::RequiredAttribute->new(); } catch { my $exception = $_; if ( blessed $exception && $exception->isa("Moose::Exception::AttributeIsRequired") ) { # fetch attributes from the $exception object and display only # the topmost frame of the stack trace my $attribute_name = $exception->attribute->name; my $trace = $exception->trace; my $frame = $trace->frame(0); my $message = $exception->message; my $file = $frame->{filename}; my $line = $frame->{line}; warn "$message at $file $line "; } else { # you've got some other kind of exception, so just print it # note: all Moose::Exception objects will stringify to a useful error message warn "$exception "; } }; Moose Exception Types These are documented in Moose::Manual::Exceptions::Manifest. AUTHORS
o Stevan Little <stevan.little@iinteractive.com> o Dave Rolsky <autarch@urth.org> o Jesse Luehrs <doy@tozt.net> o Shawn M Moore <code@sartak.org> o XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> o Karen Etheridge <ether@cpan.org> o Florian Ragwitz <rafl@debian.org> o Hans Dieter Pearcey <hdp@weftsoar.net> o Chris Prather <chris@prather.org> o Matt S Trout <mst@shadowcat.co.uk> COPYRIGHT AND LICENSE
This software is copyright (c) 2006 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.18.2 2014-01-19 Moose::Manual::Exceptions(3)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy