C
Cheok Yan Cheng
i have a file named 'list' with content:
--------------------------------------------------------------------------------
$ebb.runrv_out
$ebb.emsh_log
rv/$ebb.rv.audit
$ebb.notexist
--------------------------------------------------------------------------------
i try the following code:
#!/usr/intel/bin/perl
$ebb = '$ebb';
open(LIST, "list") || die "$!\n";
while(<LIST>)
{
print;
print " is going match with $ebb\n";
if(/^${ebb}(\.)/)
{
print "YEAH!\n";
}
else
{
print "NO!\n";
}
}
close(LIST);
the output i get is
--------------------------------------------------------------------------------
$ebb.runrv_out
is going match with
NO!
$ebb.emsh_log
is going match with
NO!
rv/$ebb.rv.audit
is going match with
NO!
$ebb.notexist
is going match with
NO!
--------------------------------------------------------------------------------
i expect to get "YEAH" frm pattern
if(/^${ebb}(\.)/)
but it failed may i noe how can i solve this prob?
thank you.
regards
yccheok
--------------------------------------------------------------------------------
$ebb.runrv_out
$ebb.emsh_log
rv/$ebb.rv.audit
$ebb.notexist
--------------------------------------------------------------------------------
i try the following code:
#!/usr/intel/bin/perl
$ebb = '$ebb';
open(LIST, "list") || die "$!\n";
while(<LIST>)
{
print;
print " is going match with $ebb\n";
if(/^${ebb}(\.)/)
{
print "YEAH!\n";
}
else
{
print "NO!\n";
}
}
close(LIST);
the output i get is
--------------------------------------------------------------------------------
$ebb.runrv_out
is going match with
NO!
$ebb.emsh_log
is going match with
NO!
rv/$ebb.rv.audit
is going match with
NO!
$ebb.notexist
is going match with
NO!
--------------------------------------------------------------------------------
i expect to get "YEAH" frm pattern
if(/^${ebb}(\.)/)
but it failed may i noe how can i solve this prob?
thank you.
regards
yccheok