CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [BillKSmith] can't declare a simple list from a book example...: Edit Log



Wildcard
Novice

Jun 11, 2017, 7:01 AM


Views: 4637
Re: [BillKSmith] can't declare a simple list from a book example...


In Reply To
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:


Code
($foo, $fubar, $foobar) = (<AndSoOn>);  
$, = "\n";
print ($foo, $foobar, $fubar);

If I remove strict, then it works, pretty funny Laugh
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)


Edit Log:
Post edited by Wildcard (Novice) on Jun 11, 2017, 7:02 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives