But it accept! -- print "Hello", " ", "World!", "\n"; --
In your case you are just using the wrong syntax for optional file handle.. > De: Manish Jain <bourne.ident...@hotmail.com> > Assunto: Why can't print accept a comma between arguments ? > Para: beginners@perl.org > Data: Segunda-feira, 29 de Novembro de 2010, 10:33 > > > 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. > > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/