T
tamiry
Hi,
I wanted to know if the matching operator returns a boolean value.
I want to replace:
if($file_name =~ /_prev_txt$/)
{$idx = 1}
else
{$idx = 0}
print "$idx"
with:
$idx = ($file_name =~ /_prev_txt$/);
print "$idx"
But, with the second piece of code, where $file_name
was 'data_cur_txt', I got an empty line. so what does
=~ return ?
lots of thanks
I wanted to know if the matching operator returns a boolean value.
I want to replace:
if($file_name =~ /_prev_txt$/)
{$idx = 1}
else
{$idx = 0}
print "$idx"
with:
$idx = ($file_name =~ /_prev_txt$/);
print "$idx"
But, with the second piece of code, where $file_name
was 'data_cur_txt', I got an empty line. so what does
=~ return ?
lots of thanks