I create a txt file that have 3 element and i wrote this code :
my $in_file1 = 'file.txt';
open DAG,$in_file1;
my @shell=<DAG>;
close DAG;
chomp(@shell);
foreach my $shell(@shell){
# and etc code
and i want if the number of element is 0 do something and if 1 do other thing and if 2 ... . for example
if (@shell[0]) print "hi"; if(@shell[1]) print "bye" if(@...
what am i going to do ? what is the best and simplest way for doing this ? Thanks .