Hi all,

I'm very new to perl but I will try to explain where I am at the
moment.
I have a lot of information in a .csv file. The 2nd columb has
different values relating to different things. For example "no" =
nokia, "se" = sony ericsson, "ip" = iphone and so on. So the 2nd
columb will have a value like this no, se or ip. I am printing to
screen what type of phone it is based on the information in the other
columbs.

I have something like this implemented:

$dat_file = 'sample.csv';
@data =('no', 'se', 'ip' ....... );

open (F, $dat_file), print "File Opened\n\n" || die ("Could not open
file");
  #...@raw_data=<F>;

  while ($line = <F>)
  {
    ($time,$dat_type,$dat_from,$from_base,$dat_to,$to_base) = split
',', $line;

:
:
:
:
:
}

Within this while loop I am trying to print out all the information, I
can do this in order to output no, se ip etc. However I am trying to
set up an if loop as follows:
if dat_type = no
print nokia
elseif dat_type = se
print sony ericsson
else dat_type = ip
print iphone
end

I am having trouble getting the if loop to work with my code to output
the correct output.
Currently it is going into the 1st if loop and not coming back out of
it.

Anyone any ideas how I could sort this out?

Thanks very much.

N


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to