in reply to Storing Info in a text File

Maybe you could do this: read all user lines, find the largest id, increment it for the user being added.
#! perl -w use strict; my @users = grep /[^\s]+/, <DATA>; my $max = 0; $max = $_ > $max ? $_ : $max for map { /(\d+)|/; $1 || 0 } @users; ++$max; push @users, "$max|Rudif|scribe\n"; print for @users; __END__ 1|Title|Description 3|Title|Description 4|Title|Description
Rudif

Replies are listed 'Best First'.
Re: Re: Storing Info in a text File
by merlyn (Sage) on Mar 10, 2001 at 20:33 UTC
      But it costs an extra trip to CPAN.

      Would you know offhand what this diagnostic (while installing Scalar-List-Utils-1.02) points to - wrong kind or build of Perl? I have the AS build 623 here on Win2k. I did not try to investigate - the package also has a pure Perl version.

      Util.c Util.xs(183) : error C2198: 'Perl_Irunops_ptr' : too few actual parame +ters


      Rudif