•
•
•
•
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 427,072 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,385 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
A bare-bones code snippet to remove duplicate lines from a file. There are a number of ways to accomplish this task but this is a fast and dependable method using perls inplace editor and a simple hash to get the job done.
This probably should not be used for really big files, but files with a... (View Snippet)
Search and Replace Script in perl
Given the date in mm-dd-yyyy (or M-D-YYYY) format (or any combination of that format) you can find out what day of the week that was on or is on or will be on, within the limitations of the system the script resides on.
This snippet uses only core functions and modules so nothing needs to be... (View Snippet)
This is a routine task best done with two regexp's when using perl. (View Snippet)
Adding commas to numbers in perl
Shuffling an array randomly in perl
I've seen this question (or similar) asked many times on forums:
I have a variable in a file (text) and want to expand it. For example, I have this line in a text file:
Mary had a little $lamb
and I want to be able to expand $lamb but text files are treated as single-quoted strings and perl... (View Snippet)
"How can I find all the permutations of a list (or a word)"? I have seen this question asked a number of times on forums. There is a module that makes this task very easy: List::Permutor. It is not a core module so you may need to install it. See module for more details: List::Permutor (View Snippet)
You will need to install the Email::Valid module if it's not already installed. See the module documentation for further details.
Email::Valid (View Snippet)