Jun 11, 2017, 7:01 AM
Re: [BillKSmith] can't declare a simple list from a book example...
I do not know what your original problem was. I certainly did not have anything to do with "$,". As I suggested before, try removing that statement. Everything will still work, but not look as good.
yeah, I realized now.. it had to do with the <use strict> statement, somehow it prevented me to write this code:
If I remove strict, then it works, pretty funny
($foo, $fubar, $foobar) = (<AndSoOn>);
$, = "\n";
print ($foo, $foobar, $fubar);
I guess this is the one who demands the <my> statement.
I tried the same thing with some pop&push operators and the same, it works when I:
1) use strict, then declare variables with my
2) don't use strict and no my-statement necessary.
So here is the question. The book mentions that I "shall use always warnings and strict and for safety measures also implement the #!/usr/bin/perl (I am from a bash scripting background, so it makes sense to me). But isn't <use strict> completely optional and unnecessary feat?
(This post was edited by Wildcard on Jun 11, 2017, 7:02 AM)