> Hi,

Hi.

> 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 ..."

What line?

> Here is the code:

Try this:

__ START __
#!/usr/bin/perl -w
# ^^ not /user/

use strict;

my $dlast;
my $daddy;
my $dphone;

open (DYNIXDBF, "dynixte.txt");
my @dynixdata = <DYNIXDBF>;
close(DYNIXDBF);
# there's no need for the file to be open all the time during processing
# the file's data is in @dynixdata, so the file can be closed immediately
# and the data in @dynixdata remains.

foreach my $dynixrec (@dynixdata) {
        ($dlast,$daddy,$dphone) = split(/ /,$dynixrec);

        # here $dynixrec holds the information you want, not @_
        # i've done that assuming each field is separated using a space, if
not, use
        # split(/\,/,$dynixrec) # for , separated
        # split(/\|/,$dynixrec) # for | separated
        # you get the idea?

        print "Dynix: $dlast $daddy $dphone\n";
}
__ END __

> All I want to do is to split it so I can fo some comparing later.

This should do what you want.

> Anyone have any ideas?
>
> Joseph Ruffino
> Automated Systems Assistant
> Gail Borden Public Library District
> Elgin., IL
> [EMAIL PROTECTED]
>

Dan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to