I started to play with perl for the past few months during my free time. I picked up programming perl which I think is among the very best of programming books...
Coming to the point, I found something along the lines in programming perl and it works when I test it on my command line. I believe programming perl is for intermediate perl programmers which I am not. Can any one help me understand why the print from the book is working fine, where as my print command is bombing other than the fact that one was written by Larry Wall and other one by lame me?
Jr. Monkperl -e 'my @scale=("A" .. "G"); my $note = -1; print (($note += 1) %= + @scale)' #Working fine 0 perl -e 'my @scale=("A" .. "G"); print (0 %= @scale);' # Not working Can't modify constant item in modulus (%) at -e line 1, near "@scale)" Execution of -e aborted due to compilation errors.
In reply to perl behavior with print command by raghuprasad241
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |