in reply to Re^2: Split array and join with results
in thread Split array and join with results

to simply, how do i adapt the following: @phones=qw(iph1 iph2 iph3); so that it reads the phone titles from the text file:
chomp $results; push (@oid,$results[0]); $_ = defined($_) ? $_ : '' for @results;
I hope that makes sense?

Replies are listed 'Best First'.
Re^4: Split array and join with results
by cheekuperl (Monk) on Aug 22, 2012 at 16:00 UTC
    Assuming your text file contains one entry on each line like this:
    iph1 iph2 iph3 ...
    You can simply slurp this file into an array like this:
    @phones=<FILE_HANDLE>;
    Make sure you use chomp on the array elements appropriately!

    Does this make sense?