Perl concatenate files directory
Viewed times. Improve this question. JB JB 7 6 6 bronze badges. What is the current encoding used for the files? Why do you think you need Perl for this?
I need to use perl because it's the only language I know lol. So, if you are on a unixy system, use HunterMcMillen's suggestion. Add a comment. Active Oldest Votes. Improve this answer. To make it more flexible — Hunter McMillen. In cmd. ARGV; , but that would be quite unconventional. I recommend against it — ikegami. I always forget that readdir just returns a list of relative filenames, not the entire path! Thanks for discouraging the use of globbing for this task.
Another downside of using globbing for this is, that it will not find hidden files those starting with a dot. Matthew Vines Matthew Vines You should check opendir for failure opendir Also, am I missing something? I don't see anything relevant in the question.
Todd Gardner Todd Gardner 13k 37 37 silver badges 51 51 bronze badges. Matthew Lock Matthew Lock The Overflow Blog.
Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked When you work with Perl, you're often working with strings, and very often you need to concatenate strings. For instance, I recently had a need to create a temporary filename, and wanted to use the original filename as part of the temporary name.
I was going to get the first part of the filename the filename prefix by calling a function that generated temporary filenames. Here's how I did it. Another way to concatenate Perl strings is to use the "dot" operator i. In some circumstances it can make your Perl script easier to read than the syntax shown above.
0コメント