in reply to open file or pipe ?

How about:
$i = 0; for my $rec_ref(@records) { $new_rec = join('', $rec_ref->[0], $rec_ref->[1], $rec_ref->[2]); push(@new_records, $new_rec); } open(PASSF,">$ENV{HOME}/.perlpasswd") or die "Can't write $ENV{HOME}/. +perlpasswd: $!\n"; for $i (0 .. $#new_rocords) { print PASSF $new_records[$i]^substr($newenckey,0,length($new_recor +ds[$i])); } close(PASSF);

Replies are listed 'Best First'.
Re^2: open file or pipe ?
by Anonymous Monk on Nov 15, 2004 at 12:32 UTC
    I have the same problem with this as I did with one of my earlier attempts at avoiding temporary files
    The encryption is only being applied to the first element in the record not to the whole record. So what I end up with is a .perlpasswd file in this format
    encrypted notencrypted notencrypted encrypted notencrypted notencrypted
    Unfortunately the third field is the password, which remains unencrypted. I've tried using map as well but always seem to end up with only the first field encrypted but not the others.
    Any ideas on how I fix this would be welcome