My name is abbi
My first perl script run on linux machine
This script read the INI file called (input) and print the values of val , param , name .....
How to create loop that print values of val1-valn OR loop to print values of param1-paramn... etc? (in place the print command's in the script )
- the loop must have option to match the parameter for example print only param1 until paramn values
n - Is the last number of each param
#!/usr/bin/perl
open(IN,"input") or die "Couldn't open input: $!\n";
while(<IN>) {
chomp;
/^([^=]+)=(.*)$/;
$config{$1} = $2;
}
close(IN);
print $config{val1};
print $config{val2};
print $config{val3};
print $config{param1};
print $config{param2};
print $config{param3};
print $config{name1};
.
.
.
.
example of the ini file from linux machine
cat input
val1=1
val2=2
val3=3
param1=a
param2=b
param3=c
name1=abbi
name2=diana
name3=elena