Joseph Ruffino wrote:
>
> Hi,
Hello,
> Hopefully someone here can help me. I'm reading in a text file, and
> setting it to an array, and I want ot split that array in 3 variable,
> but I kepp coming up with, 'uninitiated value in contatenation (.) or
> string and line ..."
>
> Here is the code:
>
> #!/user/bin/perl -w
> use strict;
>
> my $dlast;
> my $daddy;
> my $dphone;
>
> open (DYNIXDBF, "dynixte.txt");
You should _always_ verify that the file opened.
open DYNIXDBF, 'dynixte.txt' or die "Cannot open dynixte.txt: $!";
> my @dynixdata = <DYNIXDBF>;
>
> foreach my $dynixrec (@dynixdata) {
Is there any reason that you are reading the whole file at once?
while ( my $dynixrec = <DYNIXDBF> ) {
> ($dlast,$daddy,$dphone) = @_;
The @_ array is available in subroutines not loops.
my ( $dlast, $daddy, $dphone ) = split ' ', $dynixrec;
Or if you use the default $_ variable:
while ( <DYNIXDBF> ) {
my ( $dlast, $daddy, $dphone ) = split;
> print "Dynix: $dlast $daddy $dphone\n";
> }
>
> close(DYNIXDBF);
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]