Hi all,

I want to do this :

open(hndr, "/home/manjain/.bash_profile");
open(hndw, ">", "/home/manjain/bashrc.copy");

while ($nextline = <hndr>)
{
    $nextline =~ s/manjain/\$USER/g;
    print(hndw, $nextline);                  #problem here
}

But perl refuses to take a comma between hndw and $nextline, and consequently I 
have to rewrite it as : print hndw $nextline;

But this is much less intuitive to me as a C programmer. Perl's syntactical 
rules in general leave a lot to be desired : the syntax actually is overly 
flexible and can confound people familiar with structured code. This particular 
case of print is an example of something that should work by logic but does 
not.                                           

Reply via email to