Sponsored Content
Full Discussion: Perl revers File handling
Top Forums Shell Programming and Scripting Perl revers File handling Post 302277819 by radoulov on Sunday 18th of January 2009 08:46:28 AM
Old 01-18-2009
Check the File::ReadBackwards module (you have to install it manually, it's not included in the standard distribution).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file handling problem in perl......

Hi, I am opening a file......then i am wrting some data into it......and i am reopening the file again but ......i get a error cannot open file....... $::file= "\adder\testfile.txt" open(TEST1,$::file); some write operation close(TEST1) open(TEST1,$::file) 'I GET A ERROR CAN OPEN... (2 Replies)
Discussion started by: vivekshankar
2 Replies

2. Shell Programming and Scripting

Signal handling in Perl

Guys, I'm doing signal handling in Perl. I'm trying to catch ^C signal inside the script. There two scripts : one shell script and one perl script. The shell script calls the perl script. For e.g. shell script a.sh and perl scipt sig.pl. Shell script a.sh looks something like this :... (6 Replies)
Discussion started by: obelix
6 Replies

3. Programming

XML Handling in Perl

Hi there, I'm newby in perl and XML. I can read and parse Xml with XML-Node upper XML::Parser, but how can I create XML tags and pack my individual data in it then send through socket. PLZ lead me :) Thanks in Advance. (1 Reply)
Discussion started by: Zaxon
1 Replies

4. Shell Programming and Scripting

file handling in perl without using system command

Hi , Is there any way to achieve following using perl program (i.e without using system command). 1.system ("echo 'test' > /usr/spool/ship.csv"); 2.system ("cat /usr/ajay_test* >> /usr/spool/RAM/work/patil.csv"); 3.system("> /usr/spool/ajay.txt"); e.g for system("rm -f... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

5. Shell Programming and Scripting

Perl and Sockets - Error handling

Hello all, I have created a Perl script that tries to open connections to various systems on different ports in order to see if the machines are reachable, the ports are open, etc. There appears to be a difference between Solaris (10) and Linux (RH/Oracle and Ubuntu) in the status or error it... (4 Replies)
Discussion started by: Hollinch
4 Replies

6. Shell Programming and Scripting

Handling Parameters in Perl

Hi All, I'm pretty new to the forum and also to UNIX. I have a requirement for which I need some help. I have a script (example.script) where I get user inputs using the read command. I would need to pass the read-fetched input to a perl command (explained below) in my script. The part which... (3 Replies)
Discussion started by: bharath.gct
3 Replies

7. Programming

Perl help for file handling

$# some text $$ some text $@ some text $$. some text Mg1 some text Mg2 some text . . . Mg10 some text The above 10 lines are to be extracted except the lines starting from $#,$$.,... (4 Replies)
Discussion started by: baig.abdul
4 Replies

8. Shell Programming and Scripting

PERL error handling

I have a PERL command line embedded in a UNIX script. The script doesn't handle errors coming out of this command. I'm processing large files and occassionally I run out of disk space and end up with half a file. perl -p -e 's/\n/\r\n/g' < TR_TMP_$4 > $4 How do I handle errors coming out... (1 Reply)
Discussion started by: OTChancy
1 Replies

9. Shell Programming and Scripting

Perl file handling error

Hi, I am reading and file and writting each word to other file. where I have used array to store the data. I am getting below error as "Use of uninitialized value in concatenation (.) or string at customize_split_raw.pl line 51, <IN_FILE> " Where my line 51 code is 50 foreach... (8 Replies)
Discussion started by: Beginer123
8 Replies

10. Shell Programming and Scripting

Perl : How is file handling working here??

Hi, I have a perl script which is just reading from the file but what I would like to understand is how the counter is moving without using the loop in the script. Below are the details: $ more /tmp/abc.txt This is 0 This is 1 This is 2 This is 3 This is 4 This is 5 This is 6 This... (2 Replies)
Discussion started by: siddharthjindal
2 Replies
CPANPLUS::Dist::Base(3) 				User Contributed Perl Documentation				   CPANPLUS::Dist::Base(3)

NAME
CPANPLUS::Dist::Base - Base class for custom distribution classes SYNOPSIS
package CPANPLUS::Dist::MY_IMPLEMENTATION use base 'CPANPLUS::Dist::Base'; sub prepare { my $dist = shift; ### do the 'standard' things $dist->SUPER::prepare( @_ ) or return; ### do MY_IMPLEMENTATION specific things ... ### don't forget to set the status! return $dist->status->prepared( $SUCCESS ? 1 : 0 ); } DESCRIPTION
CPANPLUS::Dist::Base functions as a base class for all custom distribution implementations. It does all the mundane work CPANPLUS would have done without a custom distribution, so you can override just the parts you need to make your own implementation work. FLOW
Below is a brief outline when and in which order methods in this class are called: $Class->format_available; # can we use this class on this system? $dist->init; # set up custom accessors, etc $dist->prepare; # find/write meta information $dist->create; # write the distribution file $dist->install; # install the distribution file $dist->uninstall; # remove the distribution (OPTIONAL) METHODS
@subs = $Class->methods Returns a list of methods that this class implements that you can override. $bool = $Class->format_available This method is called when someone requests a module to be installed via the superclass. This gives you the opportunity to check if all the needed requirements to build and install this distribution have been met. For example, you might need a command line program, or a certain perl module installed to do your job. Now is the time to check. Simply return true if the request can proceed and false if it can not. The "CPANPLUS::Dist::Base" implementation always returns true. $bool = $dist->init This method is called just after the new dist object is set up and before the "prepare" method is called. This is the time to set up the object so it can be used with your class. For example, you might want to add extra accessors to the "status" object, which you might do as follows: $dist->status->mk_accessors( qw[my_implementation_accessor] ); The "status" object is implemented as an instance of the "Object::Accessor" class. Please refer to its documentation for details. Return true if the initialization was successful, and false if it was not. The "CPANPLUS::Dist::Base" implementation does not alter your object and always returns true. $bool = $dist->prepare This runs the preparation step of your distribution. This step is meant to set up the environment so the "create" step can create the actual distribution(file). A "prepare" call in the standard "ExtUtils::MakeMaker" distribution would, for example, run "perl Makefile.PL" to find the dependencies for a distribution. For a "debian" distribution, this is where you would write all the metafiles required for the "dpkg-*" tools. The "CPANPLUS::Dist::Base" implementation simply calls the underlying distribution class (Typically "CPANPLUS::Dist::MM" or "CPANPLUS::Dist::Build"). Sets "$dist->status->prepared" to the return value of this function. If you override this method, you should make sure to set this value. $bool = $dist->create This runs the creation step of your distribution. This step is meant to follow up on the "prepare" call, that set up your environment so the "create" step can create the actual distribution(file). A "create" call in the standard "ExtUtils::MakeMaker" distribution would, for example, run "make" and "make test" to build and test a distribution. For a "debian" distribution, this is where you would create the actual ".deb" file using "dpkg". The "CPANPLUS::Dist::Base" implementation simply calls the underlying distribution class (Typically "CPANPLUS::Dist::MM" or "CPANPLUS::Dist::Build"). Sets "$dist->status->dist" to the location of the created distribution. If you override this method, you should make sure to set this value. Sets "$dist->status->created" to the return value of this function. If you override this method, you should make sure to set this value. $bool = $dist->install This runs the install step of your distribution. This step is meant to follow up on the "create" call, which prepared a distribution(file) to install. A "create" call in the standard "ExtUtils::MakeMaker" distribution would, for example, run "make install" to copy the distribution files to their final destination. For a "debian" distribution, this is where you would run "dpkg --install" on the created ".deb" file. The "CPANPLUS::Dist::Base" implementation simply calls the underlying distribution class (Typically "CPANPLUS::Dist::MM" or "CPANPLUS::Dist::Build"). Sets "$dist->status->installed" to the return value of this function. If you override this method, you should make sure to set this value. $bool = $dist->uninstall This runs the uninstall step of your distribution. This step is meant to remove the distribution from the file system. A "uninstall" call in the standard "ExtUtils::MakeMaker" distribution would, for example, run "make uninstall" to remove the distribution files the file system. For a "debian" distribution, this is where you would run "dpkg --uninstall PACKAGE". The "CPANPLUS::Dist::Base" implementation simply calls the underlying distribution class (Typically "CPANPLUS::Dist::MM" or "CPANPLUS::Dist::Build"). Sets "$dist->status->uninstalled" to the return value of this function. If you override this method, you should make sure to set this value. perl v5.16.3 2013-05-20 CPANPLUS::Dist::Base(3)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy