J
justme
hi
i have a text file with some info like this:
[local]
/home/user
[files]
test1.txt
test1.htm
[dest]
/home/dest
[server]
127.0.0.1
i want to get the line between [local] and [files] so i did a small code
open(FILE , "<$input") or die "Cannot open $input for reading!: $!\n";
while(<FILE>)
{
print if (/\[local\]/ .. /\[files\]/ );
}
but i get the output :
[local]
/home/user
[files]
i only want to get "/home/user" and not the [local] and [files]
how can i do that?
thanks
i have a text file with some info like this:
[local]
/home/user
[files]
test1.txt
test1.htm
[dest]
/home/dest
[server]
127.0.0.1
i want to get the line between [local] and [files] so i did a small code
open(FILE , "<$input") or die "Cannot open $input for reading!: $!\n";
while(<FILE>)
{
print if (/\[local\]/ .. /\[files\]/ );
}
but i get the output :
[local]
/home/user
[files]
i only want to get "/home/user" and not the [local] and [files]
how can i do that?
thanks