Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ppix::editortools::renamepackagefrompath(3pm) [debian man page]

PPIx::EditorTools::RenamePackageFromPath(3pm)		User Contributed Perl Documentation	     PPIx::EditorTools::RenamePackageFromPath(3pm)

NAME
PPIx::EditorTools::RenamePackageFromPath -Change the package name based on the files path SYNOPSIS
my $munged = PPIx::EditorTools::RenamePackageFromPath->new->rename( code => "package TestPackage; use strict; BEGIN { $^W = 1; } 1; ", filename => './lib/Test/Code/Path.pm', ); my $new_code_as_string = $munged->code; my $package_ppi_element = $munged->element; DESCRIPTION
This module uses PPI to change the package name of code. METHODS
new() Constructor. Generally shouldn't be called with any arguments. rename( ppi => PPI::Document $ppi, filename => Str ) =item rename( code => Str $code, filename => Str ) Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to process. Replaces the package name with that supplied in the "filename" parameter and returns a "PPIx::EditorTools::ReturnObject" with the new code available via the "ppi" or "code" accessors, as a "PPI::Document" or "string", respectively. An attempt will be made to derive the package name from the filename passed as a parameter. The filename's path will converted to an absolute path and it will be searched for a "lib" directory which will be assumed the start of the package name. If no "lib" directory can be found in the absolute path, the relative path will be used. Croaks with a "package name not found" exception if unable to find the package name. SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI. perl v5.14.2 2012-03-11 PPIx::EditorTools::RenamePackageFromPath(3pm)

Check Out this Related Man Page

PPIx::EditorTools::Lexer(3pm)				User Contributed Perl Documentation			     PPIx::EditorTools::Lexer(3pm)

NAME
PPIx::EditorTools::Lexer - Simple Lexer used for syntax highlighting SYNOPSIS
PPIx::EditorTools::Lexer->new->lexer( code => "package TestPackage; sub x { 1; ", highlighter => sub { my ( $css, $row, $rowchar, $len ) = @_; ... }, ); DESCRIPTION
Go over the various interesting elements of a give piece of code or an already process PPI tree. For each token call the user supplied 'highlighter' function with the follow values: $css - The keyword that can be used for colouring. $row - The row number where the token starts $rowchar - The character within that row where the token starts $len - The length of the token METHODS
new() Constructor. Generally shouldn't be called with any arguments. find( ppi => PPI::Document $ppi, highlighter => sub {...} ) =item find( code => Str $code, highlighter => sub ...{} ) Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to process. Return a reference to an array. SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI. perl v5.14.2 2012-03-11 PPIx::EditorTools::Lexer(3pm)
Man Page

11 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filename to contain date

hello, can anyone tell me how to rename a filename in a script to contain the current date? i have searched for the answer but with little success! many thanks rkap (4 Replies)
Discussion started by: rkap
4 Replies

2. Programming

absolute path

How to find out the absolute path of a file in C/C++? Thanks (4 Replies)
Discussion started by: filedeliver
4 Replies

3. UNIX for Dummies Questions & Answers

How do I rename a bunch of files at once?

I have about 3000+ files name P08DDD that I want to rename U08DDD. How can I do this using a single command? (8 Replies)
Discussion started by: bbbngowc
8 Replies

4. Shell Programming and Scripting

find and replace in subdirectory (filename & content - both)

Hi, I have to rename all occurance of CUST_MST to RESELLER_MST both in filename and file content under a directory (say D0) which contains multiple (2-3 levels) sub directory. Example: D0 -> D1 -> D2 has a file CUST_MST_TEMP.txt this contains : > cat /D0/D1/D2/CUST_MST_TEMP.txt... (3 Replies)
Discussion started by: sabyasm
3 Replies

5. Shell Programming and Scripting

Replacing string in all instances (both filenames and file contents) in a directory

Hi, I have a set of files stored in a single directory that I use to set parameters for a physics code, and I would like to streamline the process of updating them all when I change a parameter. For instance, if the files are called A2000p300ini, A2000p300sub, A2000p300run, and the text in each... (3 Replies)
Discussion started by: BlueChris
3 Replies

6. Shell Programming and Scripting

Read File and use contents to rename another

Hello guys, thank God that I found this forum. I hope that someone can help me because I don't have any idea on how to start it. I know that for some of you this is a very simple task but I'm not as advance on shell scripting like many people out there. I got this file with a permanent... (10 Replies)
Discussion started by: Shark Tek
10 Replies

7. Shell Programming and Scripting

BEGIN Clause Help Needed

what does this clause means in UNIX 'BEGIN { FS="|";OFS="|" } the complete clause is like find . -name $filename | xargs awk -v s1=$String1 -v s2=$String2 -v s3=$String3 -v s4=$String4 'BEGIN { FS="|";OFS="|" } Please advice. (2 Replies)
Discussion started by: jojo123
2 Replies

8. Shell Programming and Scripting

How do I rename a filename in a directory?

Hi, I've got a large to task to do, which I've broken into three section. I'm just stuck on one of the sections. I have to change the end of a filename from .txt to .doc in a directory. So if I have a directory called "folder1" and two files contained in it called "file1.txt" and "file2.txt",... (7 Replies)
Discussion started by: TeddyP
7 Replies

9. Shell Programming and Scripting

rename a file with new extension

Hi guys, i had many files like filename.20110520_20110519_050030 i have to rename the file by removint the last numerics .. i.e filename.dat i tried with cut command and removed the numerics but i'm not able to add .dat to the files. is there any command insted of cut command to... (1 Reply)
Discussion started by: apple2685
1 Replies

10. UNIX for Dummies Questions & Answers

Way to get Code/path , which is executing under a process?

Dear All, Please help me in finding solution for below problem. I need a command or script to get code or path(from which location code is being executed), which is executing under a process ID. I dont have google access here,Please help me in finding solution. Thank you. (3 Replies)
Discussion started by: subbarao12
3 Replies

11. UNIX for Beginners Questions & Answers

Renaming files by appending string from within file to filename

Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 Replies)
Discussion started by: HLee1981
10 Replies