Sponsored Content
Full Discussion: Basin Unix Question
Top Forums UNIX for Dummies Questions & Answers Basin Unix Question Post 66590 by asifanwar on Wednesday 16th of March 2005 05:12:51 AM
Old 03-16-2005
Basic Unix Question

Respected Dear Sir,
Sir i need some help it is dificult to ask u such a begginer question because all of you are very intelligent persons.
Sir i want to insatll unix in some basic steps because the book i consult according to that method there are many rpoblem occure i have an intel base system
sir please kindly advise me the procedure to install,

best reagrds

Asif

Last edited by asifanwar; 03-16-2005 at 06:26 AM..
 

10 More Discussions You Might Find Interesting

1. IP Networking

unix to unix serial connection question

hi there i'm a new bie just got few simple questions to ask. I got expert in windows configuration but totally new to unix environment . I want to make sure a com port (com1) is working, so I connect a 9-pin cable (CB9) for both PC using Unix environment (unix to unix). The question are (1)... (1 Reply)
Discussion started by: typsam
1 Replies

2. UNIX for Dummies Questions & Answers

Unix History Question: Why are filenames/dirnames case sentsitive in Unix?

I tried looking for the answer online and came up with only a few semi-answers as to why file and directory names are case sensitive in Unix. Right off the bat, I'll say this doesn't bother me. But I run into tons of Windows and OpenVMS admins in my day job who go batty when they have to deal... (3 Replies)
Discussion started by: deckard
3 Replies

3. UNIX for Dummies Questions & Answers

Question about unix

Hey everyone i am new to unix as well, has anybody heard of the script that allows you screen to look just like the Windows screen, if yea, what is it? (3 Replies)
Discussion started by: Gueso
3 Replies

4. Solaris

Unix Question

IF A program or database routine is writing in a file laying on unix box then how can be identify the process id which is writing in the file. Please let me know how can we do using root command and without root command? Regards, Shashank (10 Replies)
Discussion started by: TAPARIA
10 Replies

5. UNIX for Dummies Questions & Answers

a question about UNIX 5.0.6 , help me please

Dear friends I'm really new comer to this place and to this subject you will make me so happy if you help me about these questions: 1- I must install UNIX 5.0.6 because one of my work software will works ONLY on this version , so , I want to know WHERE CAN I DOWNLOAD A COMPELETE PACKAGE OF... (1 Reply)
Discussion started by: mrr53
1 Replies

6. UNIX for Dummies Questions & Answers

Unix question

When you enter your login id and password, what determines what program startsup? Is it always a Unix shell? (3 Replies)
Discussion started by: Alice Klein
3 Replies

7. UNIX for Dummies Questions & Answers

VI for UNIX Question ...

Hi All, I have a sync report file in the following format: root@####: updating host #### root@####: /opt/dba/bin/removedbaccount.sh: need to update root@####: /opt/sysadm/bin/sync###dirs.sh: need to update root@####: /opt/sysadm/bin/nbu_unassign_media.sh: need to install root@####:... (17 Replies)
Discussion started by: zixzix01
17 Replies

8. UNIX for Dummies Questions & Answers

UNIX question

Pleas I want answer this question or reference or link website can find answer to this question? 1. We consider that we are running on a UNIX system which uses ACL as a mechanism for file protection. Where is the protection information of the file stored? 2. In UNIX, each device is... (1 Reply)
Discussion started by: tamer11007
1 Replies

9. Shell Programming and Scripting

UNIX question

In unix, does the file size present is In byte format ? -rw-r-----+ 1 stck stck 20340713 Mar 3 10:11 C44444.STC.112 Can you you tell me how to filter the file size which should be less than the file size "20340713" one in particular directory. (3 Replies)
Discussion started by: ramkumar15
3 Replies

10. UNIX for Beginners Questions & Answers

Question on UNIX

Hi, Can you please advise on answers of below 4 questions as I am not sure on the answers. 1. You are porting a C program that interacts over a network with remote systems. The program was originally written on AMD64 Linux. You are migrating it to SPARC Solaris architecture. Question Based on... (1 Reply)
Discussion started by: Vivekit82
1 Replies
Moose::Cookbook::Basics::Point_AttributesAndSubclassing(User Contributed Perl DocumentMoose::Cookbook::Basics::Point_AttributesAndSubclassing(3pm)

NAME
Moose::Cookbook::Basics::Point_AttributesAndSubclassing - Point and Point3D classes, showing basic attributes and subclassing. VERSION
version 2.0603 SYNOPSIS
package Point; use Moose; has 'x' => (isa => 'Int', is => 'rw', required => 1); has 'y' => (isa => 'Int', is => 'rw', required => 1); sub clear { my $self = shift; $self->x(0); $self->y(0); } package Point3D; use Moose; extends 'Point'; has 'z' => (isa => 'Int', is => 'rw', required => 1); after 'clear' => sub { my $self = shift; $self->z(0); }; package main; # hash or hashrefs are ok for the constructor my $point1 = Point->new(x => 5, y => 7); my $point2 = Point->new({x => 5, y => 7}); my $point3d = Point3D->new(x => 5, y => 42, z => -5); DESCRIPTION
This is the classic Point example. It is taken directly from the Perl 6 Apocalypse 12 document, and is similar to the example found in the classic K&R C book as well. As with all Perl 5 classes, a Moose class is defined in a package. Moose handles turning on "strict" and "warnings" for us, so all we need to do is say "use Moose", and no kittens will die. When Moose is loaded, it exports a set of sugar functions into our package. This means that we import some functions which serve as Moose "keywords". These aren't real language keywords, they're just Perl functions exported into our package. Moose automatically makes our package a subclass of Moose::Object. The Moose::Object class provides us with a constructor that respects our attributes, as well other features. See Moose::Object for details. Now, onto the keywords. The first one we see here is "has", which defines an instance attribute in our class: has 'x' => (isa => 'Int', is => 'rw', required => 1); This will create an attribute named "x". The "isa" parameter says that we expect the value stored in this attribute to pass the type constraint for "Int" (1). The accessor generated for this attribute will be read-write. The "required => 1" parameter means that this attribute must be provided when a new object is created. A point object without coordinates doesn't make much sense, so we don't allow it. We have defined our attributes; next we define our methods. In Moose, as with regular Perl 5 OO, a method is just a subroutine defined within the package: sub clear { my $self = shift; $self->x(0); $self->y(0); } That concludes the Point class. Next we have a subclass of Point, Point3D. To declare our superclass, we use the Moose keyword "extends": extends 'Point'; The "extends" keyword works much like "use base". First, it will attempt to load your class if needed. However, unlike "base", the "extends" keyword will overwrite any previous values in your package's @ISA, where "use base" will "push" values onto the package's @ISA. It is my opinion that the behavior of "extends" is more intuitive.(2). Next we create a new attribute for Point3D called "z". has 'z' => (isa => 'Int', is => 'rw', required => 1); This attribute is just like Point's "x" and "y" attributes. The "after" keyword demonstrates a Moose feature called "method modifiers" (or "advice" for the AOP inclined): after 'clear' => sub { my $self = shift; $self->z(0); }; When "clear" is called on a Point3D object, our modifier method gets called as well. Unsurprisingly, the modifier is called after the real method. In this case, the real "clear" method is inherited from Point. Our modifier method receives the same arguments as those passed to the modified method (just $self here). Of course, using the "after" modifier is not the only way to accomplish this. This is Perl, right? You can get the same results with this code: sub clear { my $self = shift; $self->SUPER::clear(); $self->z(0); } You could also use another Moose method modifier, "override": override 'clear' => sub { my $self = shift; super(); $self->z(0); }; The "override" modifier allows you to use the "super" keyword to dispatch to the superclass's method in a very Ruby-ish style. The choice of whether to use a method modifier, and which one to use, is often a question of style as much as functionality. Since Point inherits from Moose::Object, it will also inherit the default Moose::Object constructor: my $point1 = Point->new(x => 5, y => 7); my $point2 = Point->new({x => 5, y => 7}); my $point3d = Point3D->new(x => 5, y => 42, z => -5); The "new" constructor accepts a named argument pair for each attribute defined by the class, which you can provide as a hash or hash reference. In this particular example, the attributes are required, and calling "new" without them will throw an error. my $point = Point->new( x => 5 ); # no y, kaboom! From here on, we can use $point and $point3d just as you would any other Perl 5 object. For a more detailed example of what can be done, you can refer to the t/recipes/moose_cookbook_basics_point_attributesandsubclassing.t test file. Moose Objects are Just Hashrefs While this all may appear rather magical, it's important to realize that Moose objects are just hash references under the hood(3). For example, you could pass $self to "Data::Dumper" and you'd get exactly what you'd expect. You could even poke around inside the object's data structure, but that is strongly discouraged. The fact that Moose objects are hashrefs means it is easy to use Moose to extend non-Moose classes, as long as they too are hash references. If you want to extend a non-hashref class, check out "MooseX::InsideOut". CONCLUSION
This recipe demonstrates some basic Moose concepts, attributes, subclassing, and a simple method modifier. FOOTNOTES(1) Moose provides a number of builtin type constraints, of which "Int" is one. For more information on the type constraint system, see Moose::Util::TypeConstraints.(2) The "extends" keyword supports multiple inheritance. Simply pass all of your superclasses to "extends" as a list: extends 'Foo', 'Bar', 'Baz'; (3) Moose supports using instance structures other than blessed hash references (such as glob references - see MooseX::GlobRef). SEE ALSO
Method Modifiers The concept of method modifiers is directly ripped off from CLOS. A great explanation of them can be found by following this link. http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html <http://www.gigamonkeys.com/book/object-reorientation- generic-functions.html> AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 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.14.2 2012-06-28 Moose::Cookbook::Basics::Point_AttributesAndSubclassing(3pm)
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy