File::SmartNL 0.05
Sponsored Links
File::SmartNL 0.05 Ranking & Summary
File size:
0.082 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
989
Date added:
2007-02-09
Publisher:
Software Diamonds
File::SmartNL 0.05 description
File::SmartNL is a slurp text files no matter the New Line (NL) sequence.
SYNOPSIS
#####
# Subroutine Interface
#
use File::SmartNL qw(config fin fout smartnl);
$old_value = config( $option );
$old_value = config( $option => $new_value);
(@all_options) = config( );
$data = smart_nl($data);
$data = fin( $file_name, @options );
$char_count = fout($file_name, $data, @options);
######
# Object Interface
#
use File::SmartNL;
$default_options = File::SmartNL->default(@options);
$old_value = $default_options->config( $option );
$old_value = $default_options->config( $option => $new_value);
(@all_options) = $default_options->config( );
$data = File::SmartNL->smart_nl($data);
$data = File::SmartNL->fin( $file_name, @options );
$char_count = File::SmartNL->fout($file_name, $data, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Different operating systems have different sequences for new-lines. Historically when computers where first being born, one of the mainstays was the teletype. The teletype understood ASCII. The teletype was an automated typewriter that would perform a carriage return when it received an ASCII Carriage Return (CR), 15, character and a new line when it received a Line Feed (LF), 12 character.
After some time came Unix. Unix had a tty driver that had a raw mode that sent data unprocessed to a teletype and a cooked mode that performed all kinds of translations and manipulations. Unix stored data internally using a single NL character at the ends of lines. The tty driver in the cooked mode would translate the New Line (NL) character to a CR,LF sequence. When driving a teletype, the physicall action of performing a carriage return took some time. By always putting the CR before the LF, the teletype would actually still be performing a carriage return when it received the LF and started a line feed.
After some time came DOS. Since the tty driver is actually one of the largest peices of code for UNIX and DOS needed to run in very cramp space, the DOS designers decided, that instead of writing a tailored down tty driver, they would stored a CR,LF in the internal memory. Data internally would be either text data or binary data.
Needless to say, after many years and many operating systems about every conceivable method of storing new lines may be found amoung the various operating systems. This greatly complicates moving files from one operating system to another operating system.
The smart NL methods in this package are designed to take any combination of CR and NL and translate it into the special NL seqeunce used on the site operating system. Thus, by using these methods, the messy problem of moving files between operating systems is mostly hidden in these methods. By using the fin and fout methods, text files may be freely exchanged between operating systems without any other processing.
The one thing not hidden is that the methods need to know if the data is text data or binary data. Normally, the assume the data is text and are overriden by setting the binary option.
Perl 5.6 introduced a built-in smart nl functionality as an IO discipline :crlf. See Programming Perl by Larry Wall, Tom Christiansen and Jon Orwant, page 754, Chapter 29: Functions, open function. For Perl 5.6 or above, the :crlf IO discipline my be preferable over the smart_nl method of this program module.
SYNOPSIS
#####
# Subroutine Interface
#
use File::SmartNL qw(config fin fout smartnl);
$old_value = config( $option );
$old_value = config( $option => $new_value);
(@all_options) = config( );
$data = smart_nl($data);
$data = fin( $file_name, @options );
$char_count = fout($file_name, $data, @options);
######
# Object Interface
#
use File::SmartNL;
$default_options = File::SmartNL->default(@options);
$old_value = $default_options->config( $option );
$old_value = $default_options->config( $option => $new_value);
(@all_options) = $default_options->config( );
$data = File::SmartNL->smart_nl($data);
$data = File::SmartNL->fin( $file_name, @options );
$char_count = File::SmartNL->fout($file_name, $data, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Different operating systems have different sequences for new-lines. Historically when computers where first being born, one of the mainstays was the teletype. The teletype understood ASCII. The teletype was an automated typewriter that would perform a carriage return when it received an ASCII Carriage Return (CR), 15, character and a new line when it received a Line Feed (LF), 12 character.
After some time came Unix. Unix had a tty driver that had a raw mode that sent data unprocessed to a teletype and a cooked mode that performed all kinds of translations and manipulations. Unix stored data internally using a single NL character at the ends of lines. The tty driver in the cooked mode would translate the New Line (NL) character to a CR,LF sequence. When driving a teletype, the physicall action of performing a carriage return took some time. By always putting the CR before the LF, the teletype would actually still be performing a carriage return when it received the LF and started a line feed.
After some time came DOS. Since the tty driver is actually one of the largest peices of code for UNIX and DOS needed to run in very cramp space, the DOS designers decided, that instead of writing a tailored down tty driver, they would stored a CR,LF in the internal memory. Data internally would be either text data or binary data.
Needless to say, after many years and many operating systems about every conceivable method of storing new lines may be found amoung the various operating systems. This greatly complicates moving files from one operating system to another operating system.
The smart NL methods in this package are designed to take any combination of CR and NL and translate it into the special NL seqeunce used on the site operating system. Thus, by using these methods, the messy problem of moving files between operating systems is mostly hidden in these methods. By using the fin and fout methods, text files may be freely exchanged between operating systems without any other processing.
The one thing not hidden is that the methods need to know if the data is text data or binary data. Normally, the assume the data is text and are overriden by setting the binary option.
Perl 5.6 introduced a built-in smart nl functionality as an IO discipline :crlf. See Programming Perl by Larry Wall, Tom Christiansen and Jon Orwant, page 754, Chapter 29: Functions, open function. For Perl 5.6 or above, the :crlf IO discipline my be preferable over the smart_nl method of this program module.
File::SmartNL 0.05 Screenshot
File::SmartNL 0.05 Keywords
SmartNL
NL
LF
New Line
CR
SmartNL 0.05
Text files
operating systems
no matter
carriage return
data
options
new
line
text
operating
Bookmark File::SmartNL 0.05
File::SmartNL 0.05 Copyright
WareSeeker periodically updates pricing and software information of File::SmartNL 0.05 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of File::SmartNL 0.05 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
computer operating systems
operating system
new line transport
operating engineers credit union
options publishing
new line promotions
text files into excel
صور بنات عاريات صور عرات صور سكس options
operating room
new lineage homes
options mastercard
operating lease
new line cinema
operating systems for computers
dataquick
optionsxpress
linensnthings
text messages
Related Software
Alerttail executes actions when "some text" has been written to a file. Free Download
vidprofile project is a collection of a few components designed to fully test mpeg2enc from mjpegtools. Free Download
Data::Startup is a Perl module with startup options class, override, config methods. Free Download
AudioLink is a tool that makes searching for music on your local storage media easier and faster. Free Download
xmlformat is a configurable formatter (or pretty-printer) for XML documents. Free Download
Prima::Edit is a Perl module for standard text editing widget. Free Download
XML::TiePYX is a Perl module to read or write XML data in PYX format via tied filehandle Free Download
AsItHappens is a real-time network performance monitor. Free Download
Latest Software
Popular Software
Favourite Software