20 Topics

Member Avatar for KevinADC
Member Avatar for KevinADC

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 …

Member Avatar for sensamurai
1
1K
Member Avatar for KevinADC

This is a bare-bones search and replace script that uses perls in-place editor and the File::Find module to get the job done quickly. It will search in all sub directories of the start directory and find and replace the text you specify in the type of file you specify. Keep …

Member Avatar for roswell1329
0
249
Member Avatar for KevinADC

Code snippet to generate random passwords. Avoids using confusing characters such as lower case L (l) and the number one (1), the letter 'O' and the number zero. Upper-case alpha characters could be added to the character set if mixed-case passwords are desired.

Member Avatar for Prakash_8111
-1
432
Member Avatar for KevinADC

This code snippet will produce strings of numbers (1 thru 49) with no repeated numbers in the same string and no duplicated string of numbers in the list of strings. To change the range of numbers the script generates change 49 in the code to your requirements. Please feel free …

Member Avatar for KevinADC
0
651
Member Avatar for KevinADC

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 …

1
1K
Member Avatar for KevinADC
Member Avatar for KevinADC

Use the List::Util module. I believe List::Util is a core module starting with perl 5.8. For older versions of perl you may need to install the module. See the module documentation for more details: [URL="http://perldoc.perl.org/List/Util.html"]List::Util[/URL]

0
167
Member Avatar for KevinADC

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 …

0
278
Member Avatar for KevinADC

"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 …

0
174
Member Avatar for KevinADC

You will need to install the Email::Valid module if it's not already installed. See the module documentation for further details. [URL="http://search.cpan.org/~rjbs/Email-Valid-0.176/lib/Email/Valid.pm"]Email::Valid[/URL]

0
294
Member Avatar for KevinADC

The [URL="http://perldoc.perl.org/File/Basename.html"]File::Basename[/URL] module is used to parse file paths into directory, filename and suffix (or file extension). My simple example shows how to get just the file extensions.

0
884
Member Avatar for KevinADC

Daniweb.... please remove all the stupid comments posted by sultan6928 in this code snippet: [url]http://www.daniweb.com/code/snippet631.html[/url] Thanks

Member Avatar for Dani
0
94
Member Avatar for KevinADC

When I click the link to go to the second page of code snippets in the perl category, I get an error message instead of seeing more code snippets: "No code snippets available with the criteria specified. "

Member Avatar for KevinADC
0
70
Member Avatar for KevinADC

I had a need to read one of the code snippets I posted a while back (perl) and noticed the syntax highlighter has screwed up the code I posted by adding an extra backslash making the snippet no good. I thought I would just try and edit the snippet but …

Member Avatar for KevinADC
0
164
Member Avatar for KevinADC

I assume if it is happening to me it must be happening to others. I am using FireFox 2 on dial up (56k). See attachment.

Member Avatar for MidiMagic
0
496
Member Avatar for KevinADC

The amount, size, placement, and etc, of advertisements on the pages is getting a bit obnoxious (one ad that scrolled across the screen was very obnoxious). I understand the need and the desire for advertising, but the pages are starting to look like billboards with some content thrown in instead …

Member Avatar for Dani
0
582
Member Avatar for KevinADC

in the code snippets perl syntax highlighter, this regexp: [CODE]$string =~ s/^\s+//;[/CODE] the first 's' after the '=~' operator is correctly linked to the perldoc page concerning the 's' function, the second 's' however is also linked to the same page, which is not correct since it is the meta …

Member Avatar for Dani
0
121
Member Avatar for KevinADC

the Perl syntax highlighter is mangling some perl code, for example, this line: [CODE]my(undef, undef, $ftype) = fileparse($file,qr{\..*});[/CODE] using the perl syntax highlighter (which I guess does not work in this forum) the backslash in [B]qr{\..*}[/B] is removed, and becomes [B]qr{..*}[/B] which is no longer the correct code for the …

Member Avatar for Dani
0
784
Member Avatar for KevinADC

Just a short intro, I'll be posting in the perl forum 99.9999% of the time so don't expect to see too much of me, but I wanted to say hi and compliment ya'll on what looks like a good forum that is growing and I hope continues to grow. Kevin

Member Avatar for Dani
0
46

The End.