in reply to Re: Reading data from a document.txt
in thread Reading data from a document.txt
========= from my READIT.PLPOSTIT.PL #!/usr/local/bin/perl my $nam = param ('name'); my $srn = param ('surname'); my $sex = param ('sex'); my $age = param ('age'); open (LOG, ">>messages.txt"); print LOG "$nam $srn $sex $age"; close LOG;
====== THAT'S ALL THE CODE I'VE GOT SO FAR!#!/usr/bin/perl open (LOG, "<messages.txt") while (<LOG>) { chomp; my @attributes = split /\|/; for my $attribute (@attributes) { print $attribute, "\n"; # or do whatever here } } close LOG;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ALL MY SCRIPT
by Joost (Canon) on Jun 12, 2002 at 15:37 UTC | |
|
Re: ALL MY SCRIPT
by dsheroh (Monsignor) on Jun 12, 2002 at 15:28 UTC | |
by jsprat (Curate) on Jun 12, 2002 at 18:07 UTC |