Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Tie::File 0.96

    Download button

    No screenshots available
    Downloads: 351  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Mark Jason Dominus | More programs
    Perl Artistic License / FREE
    June 12th, 2006, 14:56 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Tie::File description

    Tie::File can access the lines of a disk file via a Perl array.

    Tie::File can access the lines of a disk file via a Perl array.

    SYNOPSIS

    # This file documents Tie::File version 0.96
    use Tie::File;

    tie @array, 'Tie::File', filename or die ...;

    $array[13] = 'blah'; # line 13 of the file is now 'blah'
    print $array[42]; # display line 42 of the file

    $n_recs = @array; # how many records are in the file?
    $#array -= 2; # chop two records off the end


    for (@array) {
    s/PERL/Perl/g; # Replace PERL with Perl everywhere in the file
    }

    # These are just like regular push, pop, unshift, shift, and splice
    # Except that they modify the file in the way you would expect

    push @array, new recs...;
    my $r1 = pop @array;
    unshift @array, new recs...;
    my $r2 = shift @array;
    @old_recs = splice @array, 3, 7, new recs...;

    untie @array; # all finished

    Tie::File represents a regular text file as a Perl array. Each element in the array corresponds to a record in the file. The first line of the file is element 0 of the array; the second line is element 1, and so on.

    The file is not loaded into memory, so this will work even for gigantic files. Changes to the array are reflected in the file immediately. Lazy people and beginners may now stop reading the manual.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl module | Perl library | Perl array | Tie::File | Perl | module

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM