in reply to Re^2: While is not working when using variable
in thread While is not working when using variable

Try this:

print '$filename', "\n"; print "$filename", "\n";

And for more information, you can read this tutorial on quotes in perl.

Replies are listed 'Best First'.
Re^4: While is not working when using variable
by parthodas (Acolyte) on Aug 31, 2015 at 09:08 UTC
    This helped a lot. Using double quote and double slash resolved the issue. Thanks a lot.