Quote:
I didn't really learn that this was the right way to do things until I started working in a mixed Unix/Windows environment: I used to run perl scripts using this shebang line. Code:
#! /usr/bin/perl -w (What's worse is when someone opens one of your perl files in a windows text editor... then saves it without makeing any changes... except for the nice little ^M characters littered throughout the code. This will mess up the shebang line because /usr/bin/perl is not the same as /usr/bin/perl^M... meaning that the shebang line won't work under Unix, either). |
Quote:
Why this is happening? |
Quote:
|
Quote:
If you interpolate an array in double quotes and print it, you get each item separated by a space. If, however, you print the array unquoted, you get all the items concatenated together without any separation of any kind. Code:
#!/usr/bin/env perl Code:
telemachus ~ $ perl array_print |
Quote:
|
Quote:
I will continue to answer in my style. You can continue to disagree with my choices. Such is life. |
Quote:
As someone else wrote in this forum - instead of learning nowadays "Internet forum learning" or something like this has become immensely popular. I.e. instead of making an effort to read and understand people just ask questions in forums without making an effort first. Unfortunately, I too often had to work with people who never bothered to read the documentation on tools they were systematically/repeatedly using. It was a disaster, i.e. they didn't understand how the tools were working/what they were doing, they just new command line format for certain tasks they were routinely performing. They couldn't make even a minimal modification of the command lines when needed (i.e. all they could was, say, replacing file names on command lines), they couldn't analyze and correct mistakes they made (and we all make mistakes) - exactly because they didn't understand what they and the tools were doing. Kind of "command line monkeys" if you wish - similar to "coding monkeys". As you said, such is life. I.e. the more you do the job of others, the more the others take it for granted. |
Quote:
However, my hope is that if I give more explanation and people read what I write and think about it, they will learn. I also generally post links to fuller documentation or articles or mention books. If someone posts question after question about very basic things and doesn't show any increase in knowledge, I stop posting answers. But I don't mind writing fuller answers at first. Perl's documentation is excellent, but it can be overwhelming for someone new to the language or new to programming. I remember how it felt for me at first. Everything was in there, but (1) I couldn't always find things and (2) sometimes the explanations went way over my head. Anyhow, that's why I often write fuller answers. |
All times are GMT -5. The time now is 01:49 PM. |