Hi, Im getting this error..
Can't modify constant item in scalar assignment at ./pattern_search1.1 line 12, near """)"
here is my code:
print ("Enter the search pattern:\n");
$pattern = <STDIN>;
chop ($pattern);
open(FILENAME, "/home/x1207/GetNode/listdb.txt");
print ("Matches found:\n");
while (FILENAME = "")
{
if (FILENAME =~ /$pattern/)
{
print ("found database $pattern\n");
} else {
print ("can not find database $pattern\n")
}
}
close (FILENAME);
~
Can't modify constant item in scalar assignment at ./pattern_search1.1 line 12, near """)"
here is my code:
print ("Enter the search pattern:\n");
$pattern = <STDIN>;
chop ($pattern);
open(FILENAME, "/home/x1207/GetNode/listdb.txt");
print ("Matches found:\n");
while (FILENAME = "")
{
if (FILENAME =~ /$pattern/)
{
print ("found database $pattern\n");
} else {
print ("can not find database $pattern\n")
}
}
close (FILENAME);
~