perl-Acme-InputRecordSeparatorIsRegexp - Actually, awk doesn't have to be

Distribution: ALT Linux Sisyphus
Repository: Autoimports noarch
Package name: perl-Acme-InputRecordSeparatorIsRegexp
Package version: 0.03
Package release: alt1
Package architecture: noarch
Package type: rpm
Installed size: 19.98 KB
Download size: 19.98 KB
Official Mirror:
In the section about the "input record separator", `perlvar' famously notes =over 4 Remember: the value of $/ is a string, not a regex. awk has to be better for something. :-) =back This module provides a mechanism to read records from a file using a regular expression as a record separator. A common use case for this module is to read a text file that you don't know whether it uses Unix (`\n'), Windows/DOS (`\r\n'), or Mac (`\r') style line-endings, or even if it might contain all three. To properly parse this file, you could tie its filehandle to this package with the appropriate regular expression: my $fh = Symbol::gensym; tie *$fh, 'Acme::InputRecordSeparatorIsRegexp', '\r\n|\r|\n'; open $fh, '<', 'file-with-ambiguous-line-endings'; @lines = <$fh>; while (my $line = <$fh>) { ... } The lines produced by the `<$fh>' expression, like the builtin `readline' function and operator, include the record separator at the end of the line, so the lines returned may end in `\r\n', `\r', or `\n'. Other use cases are files that contain multiple types of records where a different sequence of characters is used to denote the end of different types of records.




  • perl(Acme/ = 0.030
  • perl-Acme-InputRecordSeparatorIsRegexp = 0.03-alt1

    Install Howto

    1. Add the following line to /etc/apt/sources.list:
      rpm [Sisyphus] noarch autoimports
      rpm [Sisyphus] noarch autoimports
    2. Update the package index:
      # sudo apt-get update
    3. Install perl-Acme-InputRecordSeparatorIsRegexp rpm package:
      # sudo apt-get install perl-Acme-InputRecordSeparatorIsRegexp


    • /usr/share/doc/perl-Acme-InputRecordSeparatorIsRegexp-0.03/Changes
    • /usr/share/doc/perl-Acme-InputRecordSeparatorIsRegexp-0.03/README
    • /usr/share/perl5/Acme/