Sponsored Content
Top Forums Programming Open Source What editor does everyone use? Post 302520795 by metal005 on Monday 9th of May 2011 08:06:20 AM
Old 05-09-2011
im using geany...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi editor ?

Hello everybody, My question is: how to add /tmp/work at the end of line in vi editor. my file looks like: cp file1 cp file2 cp file3 **** I need to add " /tmp/work" at the end of each line. I tried this :%s/$/" /tmp/work" and this :%s/$/\ /tmp/work\/ but it does not work. (2 Replies)
Discussion started by: billy5
2 Replies

2. HP-UX

instead VI editor - which one?

I'd like to find some editor for HP-UX, something like notepad, but not VI editor. Can someone have some ideas which one? thx (6 Replies)
Discussion started by: diamond
6 Replies

3. UNIX for Advanced & Expert Users

vi editor

Hi, how can I add at the begining and at the end of all of the lines of my text file in VI editor ? Many thanks before. for exemple if in my file i have line 1 line 2 I want to have : start line 1 end start line 2 end (3 Replies)
Discussion started by: alain123456
3 Replies

4. UNIX Desktop Questions & Answers

best editor

We work on AIX 5L We use vi as text editor (only scripts to create and modifiy). What do you think of emacs ? Where can I find it ? Do you know better text editor for scripts ? Thank you for all answers. (1 Reply)
Discussion started by: annemar
1 Replies

5. HP-UX

vi editor

I am new in hp ux and I want work with vi editor, but in hp ux vi editor the backspaes and del keys doesn't work. how can I enable them. thanks (3 Replies)
Discussion started by: hkoolivand
3 Replies

6. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

7. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

8. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

9. Shell Programming and Scripting

About vi editor

How can ` character be printed on vi editor ? empl_id=`echo $line | awk ' { print $1; } '` (2 Replies)
Discussion started by: senem
2 Replies

10. Shell Programming and Scripting

Not able to use @ in VI editor

Hello All, Need one Help for one issue. I am using a French Keyboard, so @ sign is on key 0 and i have to use right Alt + 0 to print it. It is working everywhere but not inside Vi editor. I can type @ in shell, in notepad. But inside Vi editor it is not working, another problem is that if... (2 Replies)
Discussion started by: yadavricky
2 Replies
MooseX::Declare(3pm)					User Contributed Perl Documentation				      MooseX::Declare(3pm)

NAME
MooseX::Declare - Declarative syntax for Moose SYNOPSIS
use MooseX::Declare; class BankAccount { has 'balance' => ( isa => 'Num', is => 'rw', default => 0 ); method deposit (Num $amount) { $self->balance( $self->balance + $amount ); } method withdraw (Num $amount) { my $current_balance = $self->balance(); ( $current_balance >= $amount ) || confess "Account overdrawn"; $self->balance( $current_balance - $amount ); } } class CheckingAccount extends BankAccount { has 'overdraft_account' => ( isa => 'BankAccount', is => 'rw' ); before withdraw (Num $amount) { my $overdraft_amount = $amount - $self->balance(); if ( $self->overdraft_account && $overdraft_amount > 0 ) { $self->overdraft_account->withdraw($overdraft_amount); $self->deposit($overdraft_amount); } } } DESCRIPTION
This module provides syntactic sugar for Moose, the postmodern object system for Perl 5. When used, it sets up the "class" and "role" keywords. KEYWORDS
class class Foo { ... } my $anon_class = class { ... }; Declares a new class. The class can be either named or anonymous, depending on whether or not a classname is given. Within the class definition Moose and MooseX::Method::Signatures are set up automatically in addition to the other keywords described in this document. At the end of the definition the class will be made immutable. namespace::autoclean is injected to clean up Moose and other imports for you. Because of the way the options are parsed, you cannot have a class named "is", "with" or "extends". It's possible to specify options for classes: extends class Foo extends Bar { ... } Sets a superclass for the class being declared. with class Foo with Role { ... } class Foo with Role1 with Role2 { ... } class Foo with (Role1, Role2) { ... } Applies a role or roles to the class being declared. is mutable class Foo is mutable { ... } Causes the class not to be made immutable after its definition. Options can also be provided for anonymous classes using the same syntax: my $meta_class = class with Role; role role Foo { ... } my $anon_role = role { ... }; Declares a new role. The role can be either named or anonymous, depending on whether or not a name is given. Within the role definition Moose::Role and MooseX::Method::Signatures are set up automatically in addition to the other keywords described in this document. Again, namespace::autoclean is injected to clean up Moose::Role and other imports for you. It's possible to specify options for roles: with role Foo with Bar { ... } Applies a role to the role being declared. before / after / around / override / augment before foo ($x, $y, $z) { ... } after bar ($x, $y, $z) { ... } around baz ($x, $y, $z) { ... } override moo ($x, $y, $z) { ... } augment kuh ($x, $y, $z) { ... } Add a method modifier. Those work like documented in Moose, except for the slightly nicer syntax and the method signatures, which work like documented in MooseX::Method::Signatures. For the "around" modifier an additional argument called $orig is automatically set up as the invocant for the method. clean Sometimes you don't want the automatic cleaning the "class" and "role" keywords provide using namespace::autoclean. In those cases you can specify the "dirty" trait for your class or role: use MooseX::Declare; class Foo is dirty { ... } This will prevent cleaning of your namespace, except for the keywords imported from "Moose" or "Moose::Role". Additionally, a "clean" keyword is provided, which allows you to explicitly clean all functions that were defined prior to calling "clean". Here's an example: use MooseX::Declare; class Foo is dirty { sub helper_function { ... } clean; method foo ($stuff) { ...; return helper_function($stuff); } } With that, the helper function won't be available as a method to a user of your class, but you're still able to use it inside your class. NOTE ON IMPORTS
When creating a class with MooseX::Declare like: use MooseX::Declare; class Foo { ... } What actually happens is something like this: { package Foo; use Moose; use namespace::autoclean; ... __PACKAGE__->meta->make_immutable; } So if you declare imports outside the class, the symbols get imported into the "main::" namespace, not the class' namespace. The symbols then cannot be called from within the class: use MooseX::Declare; use Data::Dump qw/dump/; class Foo { method dump($value) { return dump($value) } # Data::Dump::dump IS NOT in Foo:: method pp($value) { $self->dump($value) } # an alias for our dump method } To solve this, only import MooseX::Declare outside the class definition (because you have to). Make all other imports inside the class definition. use MooseX::Declare; class Foo { use Data::Dump qw/dump/; method dump($value) { return dump($value) } # Data::Dump::dump IS in Foo:: method pp($value) { $self->dump($value) } # an alias for our dump method } Foo->new->dump($some_value); Foo->new->pp($some_value); NOTE that the import "Data::Dump::dump()" and the method "Foo::dump()", although having the same name, do not conflict with each other, because the imported "dump" function will be cleaned during compile time, so only the method remains there at run time. If you want to do more esoteric things with imports, have a look at the "clean" keyword and the "dirty" trait. SEE ALSO
o Moose o Moose::Role o MooseX::Method::Signatures o namespace::autoclean o vim syntax: <http://www.vim.org/scripts/script.php?script_id=2526> o emacs syntax: http://github.com/jrockway/cperl-mode <http://github.com/jrockway/cperl-mode> o Geany syntax + notes: http://www.cattlegrid.info/blog/2009/09/moosex-declare-geany-syntax.html <http://www.cattlegrid.info/blog/2009/09/moosex-declare-geany-syntax.html> AUTHORS
o Florian Ragwitz <rafl@debian.org> o Ash Berlin <ash@cpan.org> o Chas. J. Owens IV <chas.owens@gmail.com> o Chris Prather <chris@prather.org> o Dave Rolsky <autarch@urth.org> o Devin Austin <dhoss@cpan.org> o Hans Dieter Pearcey <hdp@cpan.org> o Justin Hunter <justin.d.hunter@gmail.com> o Matt Kraai <kraai@ftbfs.org> o Michele Beltrame <arthas@cpan.org> o Nelo Onyiah <nelo.onyiah@gmail.com> o nperez <nperez@cpan.org> o Piers Cawley <pdcawley@bofh.org.uk> o Rafael Kitover <rkitover@io.com> o Robert 'phaylon' Sedlacek <rs@474.at> o Stevan Little <stevan.little@iinteractive.com> o Tomas Doran <bobtfish@bobtfish.net> o Yanick Champoux <yanick@babyl.dyndns.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Florian Ragwitz. 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.12.4 2011-08-23 MooseX::Declare(3pm)
All times are GMT -4. The time now is 02:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy