Posts
 
Reputation
Joined
Last Seen
Ranked #180
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
92% Quality Score
Upvotes Received
41
Posts with Upvotes
37
Upvoting Members
29
Downvotes Received
4
Posts with Downvotes
3
Downvoting Members
3
35 Commented Posts
~104.63K People Reached
Favorite Tags
Member Avatar for pjrey

I suggest you look into existing programs on script archives such as [url]www.hotscripts.com[/url] and see if you can find something that does what you want or comes close to doing it.

Member Avatar for clickmind
-1
1K
Member Avatar for Narayanank

as far as I know there should be no quotes on the shebang line: #!c:\xampp\perl\bin\perl.exe but you're better off using forward slashes, which Windows fully supports: #!c:/xampp/perl/bin/perl.exe backslashes in perl code create escape sequences, not on the shebang line which is a special line in a perl program, but its …

Member Avatar for srija.divakar
0
453
Member Avatar for KevinADC
Member Avatar for typomaniac101

Using "strict" is important , especially for new perl coders, but it is not necessary to use it. But you will see that 99% of all perl scripts use "strict" and most use "warnings". The -T switch (not -t) is also important for a CGI script. It is there to …

Member Avatar for semontuffel
0
161
Member Avatar for Newten
Member Avatar for srvinu

Use a hash to compare the lines. [CODE]use strict; use warnings; my $f1 = 'E:\upload\new\2.txt'; my $f2 = 'E:\upload\new\a.txt'; my $outfile = 'E:\upload\new\1.txt'; my %results = (); open FILE1, "$f1" or die "Could not open file: $! \n"; while(my $line = <FILE1>){ $results{$line}=1; } close(FILE1); open FILE2, "$f2" or die …

Member Avatar for cod3r
0
671
Member Avatar for grr

The character class you have will match all of the characters in the list of characters you posted. Is there a problem?

Member Avatar for YoussefUSF
0
197
Member Avatar for chandrag

save the data to a file with an html extension and then up it up in a browser. Or access the url from the internet using a browers.

Member Avatar for creativesuri
0
686
Member Avatar for brax4444
Member Avatar for voidyman
0
466
Member Avatar for bhavna_816

alternatives that do the same thing: print directly from file: [CODE]print "Content-type: text/html\n\n"; open (HTML, "<../path/to/your/file.htm"); print <HTML>; close (HTML);[/CODE] use a scalar instead of an array (slurp mode) [CODE]print "Content-type: text/html\n\n"; open (HTML, "<../path/to/your/file.htm"); my $html = do {local $/; <HTML>}; close (HTML); print $html;[/CODE]

Member Avatar for hsincredible
0
373
Member Avatar for orwell84

Your code is quite close to getting it right, here is a way to do this type of looping guessing game: [code] use strict; use warnings; my $thinkingof = int(rand 10)+1; while (1) { print "Pick a number 1 to 10\n"; my $guess = <STDIN>; chomp $guess; if ($guess > …

Member Avatar for mdawg252
0
837
Member Avatar for FoX_

It would be simpler to use perls inplace editor for this type of task; [CODE]sub edit { my $file = 'path/to/file.txt'; print "Enter the person's name and surname which you'll update the record: "; chomp($dest = <STDIN>); my ($name, $surname) = split(/\s+/,$dest); print "Enter new phone number: "; chomp($newNum = …

Member Avatar for boshu
0
218
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 NevadaSam

[QUOTE=Comatose]Look up the substitution operator. s//. You can replace the data like so: [CODE] $myvar = "hello|world|yes!"; $myvar =~ s/|/\t/gi; print "$myvar"; [/CODE][/QUOTE] I'm wondering if you or the OP ran the code you suggested, I think you will find the results not what is expected if the code is …

Member Avatar for d5e5
0
378
Member Avatar for kahaj

You are running a CGI script. It is expecting data from a CGI form: $name = param ('Salesperson'); $sales = param ('Sales'); $rate = param ('Rate'); the above scalars will have no values (they are uninitialized). Why are you running a CGI script from the command line? That is OK …

Member Avatar for d5e5
0
345
Member Avatar for Akase

Akase... You insult everyone helping on this forum by posting your plagarized code and making it appear as if you wrote it. [url]http://www.programmersheaven.com/mb/perl/372885/392147/re-analysing-text-files-to-obtain-statistics-on-their-content/?S=B20000#392147[/url]

Member Avatar for penfold58
0
455
Member Avatar for thego!team

two ways to go about it: [CODE] chdir("path/to/dir") or die "$!"; opendir (DIR, ".") or die "$!"; my @files = grep {/students_.*?\.html/} readdir DIR; close DIR; { local @ARGV = @files; while(<>){ #each file will be read line by line here } }[/CODE] [CODE]opendir (DIR, "path/to/dir") or die "$!"; my …

Member Avatar for raul15791
0
501
Member Avatar for ramagiri

I didn't get the impression it was homework/schoolwork but I have no idea how to answer such a question: [QUOTE]what are all the scenarios under which perl is used for software testing[/QUOTE] I don't even know what "testing software" means? Testing it for what?

Member Avatar for testuser_forum
0
94
Member Avatar for kishore5001

[QUOTE=lordspace;334645]It seems __END__ is a "synonym" of __DATA__[/QUOTE] [url]http://perldoc.perl.org/perldata.html[/url] [QUOTE]For compatibility with older scripts written before __DATA__ was introduced, __END__ behaves like __DATA__ in the toplevel script (but not in files loaded with require or do) and leaves the remaining contents of the file accessible via main::DATA .[/QUOTE]

Member Avatar for afbach
0
2K
Member Avatar for bradleykirby

/^\D\w{3,7}\d+/; the above means: ^\D starts with one non-digit character \w{3,7} followed by 3 to 7 word characters, same as a-zA-Z0-9_ \d+ followed by one or more digits what you probably want is is two regexps: /\d/ has at least one digit /^[a-zA-Z][a-zA-Z0-9]{3,7}/;

Member Avatar for peter_budo
0
346
Member Avatar for pjrey

Sorry, I have read your question three times and I can't understand what you want to do.

Member Avatar for pjrey
0
266
Member Avatar for chandrag

You have to use the -e switch to execute code from the command line: perl -e "print \"Hello World\";"

Member Avatar for dangidipu
0
925
Member Avatar for Davo1977
Member Avatar for d5e5
-1
239
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
245
Member Avatar for samaru

I think hes really checking to see how many people will respond to a very old thread. So far 3, counting me. ;) Do you need to be a programmer to be a mathmatician? Or does the inverse logic not apply?

Member Avatar for happygeek
0
2K
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
428
Member Avatar for Prakash_8111

[QUOTE=Prakash_8111;987870]Hi Guys, Can any one suggest to generate a random number of eight digit. All suggestions are welcomed :)[/QUOTE] [url]http://www.daniweb.com/code/snippet216771.html[/url] A search engine would also find many examples of code to do what you are asking.

Member Avatar for KevinADC
-1
110
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
635
Member Avatar for Kelicula

You should put all the code in the same post. In your function you should use if/elsif/else instead of if/if/elsif.

Member Avatar for Kelicula
0
216
Member Avatar for Kelicula

Image-Size has dependencies, so adding it via the lib pragma may not work unless the depenedencies are also added. It is a good way though to get image dimensions.

Member Avatar for Kelicula
0
164