Sponsored Content
The Lounge War Stories Useful one should be aware of Post 302865773 by CarloM on Saturday 19th of October 2013 04:36:15 PM
Old 10-19-2013
Quote:
Originally Posted by MadeInGermany
rm -r is an old chestnut.
I remember when I was at university the text editor we were taught to use saved backup files as filename+ampersand. You can guess how that went if you were slightly careless when cleaning up old backups...
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Anyone aware of load rules??

i found some load rules in our unix script.any know about it>? (1 Reply)
Discussion started by: Diddy
1 Replies

2. What is on Your Mind?

What people should be aware of

I you haven't already see it yet, I just wanted to share with you the following video : How lobbies controls international organizations regarding Food/Health ... Dailymotion - NWO - Nouvel Ordre Mondial - Codex Alimentarius - Food Plan - une vidéo News & Politics What happen when fees come... (2 Replies)
Discussion started by: ctsgnb
2 Replies

3. Windows & DOS: Issues & Discussions

Excel VBA script aware of being opened interatively or from the command line

I have a Excel VBA script that automatically runs when opened, extracts one table from a Microsoft Access Database, saves it as CSV, closes it, extracts another, saves it as CSV, closes it, then terminates itself. Is is called from a short .bat file using the /e option so that Excel does not... (1 Reply)
Discussion started by: Michael Stora
1 Replies

4. What is on Your Mind?

Be aware. Coreboot and the NSA.

NSA Starts Contributing Low-Level Code to UEFI BIOS Alternative (0 Replies)
Discussion started by: wisecracker
0 Replies
File::Inplace(3)					User Contributed Perl Documentation					  File::Inplace(3)

NAME
File::Inplace - Perl module for in-place editing of files SYNOPSIS
use File::Inplace; my $editor = new File::Inplace(file => "file.txt"); while (my ($line) = $editor->next_line) { $editor->replace_line(reverse $line); } $editor->commit; DESCRIPTION
File::Inplace is a perl module intended to ease the common task of editing a file in-place. Inspired by variations of perl's -i option, this module is intended for somewhat more structured and reusable editing than command line perl typically allows. File::Inplace endeavors to guarantee file integrity; that is, either all of the changes made will be saved to the file, or none will. It also offers functionality such as backup creation, automatic field splitting per-line, automatic chomping/unchomping, and aborting edits partially through without affecting the original file. CONSTRUCTOR
File::Inplace offers one constructor that accepts a number of parameters, one of which is required. File::Inplace->new(file => "filename", ...) file The one required parameter. This is the name of the file to edit. suffix The suffix for backup files. If not specified, no backups are made. chomp If set to zero, then automatic chomping will not be performed. Newlines (actually, the contents of $/) will remain in strings returned from "next_line". Additionally, the contents of $/ will not be appended when replacing lines. regex If specified, then each line will be split by this parameter when using "next_line_split" method. If unspecified, then this defaults to s+. separator The default character used to join each line when replace_line is invoked with a list instead of a single value. Defaults to a single space. INSTANCE METHODS
$editor->next_line () In scalar context, it returns the next line of the input file, or undef if there is no line. In an array context, it returns a single value of the line, or an empty list if there is no line. $editor->replace_line (value) Replaces the current line in the output file with the specified value. If passed a list, then each valie is joined by the "separator" specified at construction time. $editor->next_line_split () Line "next_line", except splits based on the "regex" specified in the constructor. $editor->has_lines () Returns true if the file contains any further lines. $editor->all_lines () Returns an array of all lines in the file being edited. $editor->replace_all_lines (@lines) Replaces all remaining lines in the file with the specified @lines. $editor->commit () Completes the edit operation and saves the changes to the edited file. $editor->rollback () Aborts the edit process. $editor->commit_to_backup () Saves edits to the backup file instead of the original file. AUTHOR
Chip Turner, <chipt@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2005 by Chip Turner This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.0 or, at your option, any later version of Perl 5 you may have available. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 283: You forgot a '=back' before '=head1' Around line 285: '=item' outside of any '=over' perl v5.16.3 2005-01-29 File::Inplace(3)
All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy