Click here to Skip to main content
15,881,173 members
Everything / Programming Languages / Perl

Perl

Perl

Great Reads

by Omar Al Zabir
Protect ASP.NET and WCF from various brute force and Denial of Service attacks and speed up response time using nginx.
by Oscar-Tark
If you are looking into white hat hacking, it's good to know old school tactics used for overflows.
by Oscar-Tark
In this article, we will be looking at a more advanced version of a buffer overflow attack.
by anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools

Latest Articles

by Paul Aurelian Gagniuc
This article shows how to mix two signals into a third, in variable proportions.
by Oscar-Tark
In this article, we will be looking at a more advanced version of a buffer overflow attack.
by Oscar-Tark
A basic formatted string exploit shows you how small errors in programming with the printf function can be a lethal weapon for hackers looking to compromise a system.
by Shameel
Part 2 of this multi-part article series compares SQL Server and PostgreSQL article, database structure, language differences, data type mappings, functions and operators and other important considerations for migration..

All Articles

Sort by Score

Perl 

28 Jul 2016 by Omar Al Zabir
Protect ASP.NET and WCF from various brute force and Denial of Service attacks and speed up response time using nginx.
30 Aug 2019 by Oscar-Tark
If you are looking into white hat hacking, it's good to know old school tactics used for overflows.
27 May 2021 by Oscar-Tark
In this article, we will be looking at a more advanced version of a buffer overflow attack.
10 Aug 2010 by anshulskywalker
Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
20 Mar 2022 by Paul Aurelian Gagniuc
This article shows how to mix two signals into a third, in variable proportions.
28 Aug 2001 by Uwe Keim
Tiny little Perl library to retrieve an arbitrary URL as a string
20 May 2010 by Sauro Viti
This looks like homework... Why don't you try doing it by yourself? After that if you have problems with some specific issue you can ask here: post a code snippet of what you have done, and a description of what doesn't work like you expected.
4 Apr 2011 by eh.azimi
You can use "Lingoes" dictionary. It is a free powerful dictionary. Follow link:http://www.lingoes.net
8 Oct 2011 by Mehdi Gholam
Career language choices usually involve what jobs are out there in the market place.The best advise is to learn as much as you can and see where that takes you, and which language you prefer and is easier for you.What is important is not the language itself but the logical problem...
8 Oct 2011 by Sander Rossel
What do you mean with "a background in C, Java, COBOL, Perl and Python"? That does not sound like you are a starter. Anyway, it's a nice point to start. Pick up any of those languages. Isn't Java the most popular programming language in the world and aren't Java programmers paid the best as well...
19 Oct 2011 by fjdiewornncalwe
You could do this in a couple of different ways.The best would be to create the appropriate regular expression to clean the data as you want it, but another solution could be to do the following and then just add in a check for non-numeric characters in each column: I found this...
14 Oct 2015 by Jochen Arndt
You won't be able to find a batch file to Perl converter or vice versa. pl2bat is not a converter. It is a tool that creates a batch file that is executing perl and passes the perl code contained in the same file (see here for an example:...
29 Feb 2020 by Oscar-Tark
A basic formatted string exploit shows you how small errors in programming with the printf function can be a lethal weapon for hackers looking to compromise a system.
12 Feb 2010 by Kythen
Ten seconds with our friend Google gave me this: http://perldoc.perl.org/utf8.html[^]
16 Jan 2011 by Dan_Sc
I am working on a thesis project and would like to run the program X-Plane for Mac from within a presentation (the presentation could be it's own program if necessary). At one point in the presentation, I would like X-Plane to be framed inside a slide and be able to operate the program with...
16 Feb 2011 by jswolf19
Hashes in perl are called hashes because they store the data in a hash table. Hash tables use a hash function to calculate a key based on the value you give it and allow for fast searches at the expense of memory.Using your example, say the hash table has 26 entries, and the hash function...
19 Jul 2011 by Uilleam
I believe your error is rooted in not really understanding the meaning of my. You are using it all over the place, but when you do that you are creating a new variable in the enclosing block. You should really go back and check every instance of my to see if that is what you really want to...
16 Oct 2011 by Espen Harlinn
If you have a background in COBOL – recruiters for insurance companies have been looking for you for a while – if you can translate COBOL to java and/or c#, and that seems likely, they’ll probably be even happier to have a chat with you ...Best regardsEspen Harlinn
24 Mar 2012 by Sergey Alexandrovich Kryukov
I'm really afraid my help could be not very useful. I'm presenting a complete solution based on .NET and C#. The problem is way too simple: just a combination of two rotations. If you did not know how to calculate that, I would afraid just using the code would also be a problem. Anyway, let's...
17 Mar 2013 by Matthew Faithfull
Right now you probably know more about this than most people here as you're in the middle of it so you may get a better response by having a go at it and asking more specific questions when you get stuck. It's been a very long time since I looked at anything like this so don't take my word for...
5 Jun 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Try Google[^] first and try yourself.Here we answer specific questions which members face during programming. We can't work on the whole source code. You need to do that yourself.If you face any difficulty while coding, feel free to come back here and ask another question with specific...
20 Aug 2014 by Richard MacCutchan
C++a programming language widely used in Windows and Unix/Linuxbasha shell used on Unix/Linux systemsperlanother scripting language. Ugh!Ra capital letterpythona snakerubya jewelAnd if you do not know what the internet is then I am quite surprised you managed to find this...
4 Mar 2015 by rjdudley
1&1 has become one of the most successful and popular hosting companies in the world by offering simple, inexpensive ($0.99/month for three months, then $8.99/month thereafter) and feature-rich hosting plans.
22 Dec 2015 by Richard MacCutchan
I already gave you a suggestion yesterday in your original of this question[^].
7 Mar 2017 by Jochen Arndt
Use my solution to your question How do I remove the subdirectories from the directory struture using Perl?[^] as starting point (untested EDIT: tested and fixed errors):sub DelTaskFiles{ my ($workdir) = shift; #print "Processing '$workdir'\n"; my $mask = $workdir . '/*'; #...
6 Jul 2017 by Simon Sparkes
A simple way of extracting all images from a RESX file using a simple perl script
17 Mar 2021 by CPallini
Try fin = open('input.txt', 'r') fout = open('output.txt', 'w') linesin = fin.read().splitlines() seqnum = 1 previous = None for lin in linesin: if previous != None: if lin == 'APPLE': previous += str(seqnum) seqnum = seqnum +...
4 Jan 2024 by Richard MacCutchan
Yes, whether it will work or not is a different matter.
3 Mar 2010 by Graham Breach
The simplest way to install Perl modules is to use CPAN:% perl -MCPAN -eshellCPAN[1]> install DBIIn your case it looks like you are missing some headers - try installing the kernel-headers RPM (using up2date, yum, apt-get, etc.) before trying to install DBI.
10 Jun 2010 by Peter_in_2780
The error message says it all:Chetrabbu wrote:verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()You need to tell your PHP environment how to contact an SMTP server. There obviously isn't a local one running, so you need to either set one up or use your ISP's one. To use...
17 Nov 2010 by Manfred Rudolf Bihy
Hi Matthew,this kind of smells like homework, but I'll give you a couple of hints anyhow.I hope you understand the 8 queens problem so I wont go into that."Hill Climbing" algorithms start at a randomly selected start point, andtry to do small gradual optimizations trying to obtain a...
2 Dec 2010 by wizardzz
As far as using StringBuilder, it is good to be aware of its uses even if it is not the problem. You can use it instead of string but it is not an exact replacement. On a high level, it simply makes better use of memory than a string because it does not recreate a string every time you modify...
16 Jan 2011 by #realJSOP
I think the only way you could pull this off is if the application in question could be constrained in a window that your own application creates. Since X-Plane is a game, and since most game companies would never even consider running their game in a window that wasn't borderless and full...
16 Jan 2011 by Espen Harlinn
One alternative could be to use VNC.Here is an osx compatible product:OSXVNC[^].You should be able to embed a VNC client inside your presentation program.RegardsEspen Harlinn
2 Feb 2011 by Manfred Rudolf Bihy
If I'm not completely mistaken I think that the backslash is an escape character in Perl. So if you really mean to use it will have to escaped as well:{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fcharset0 Arial;}}From the look of the start of your file it...
30 Mar 2011 by OriginalGriff
AFAIK, there is no such tool: the possibility of eval($string) makes it unlikely! If it is that small, I would suggest you will find it quicker to do it manually.
2 Apr 2011 by Hans Dietrich
I don't know if these meet all your requirements, but there are some free dictionaries available here: http://www.dict.org/w/databases/dict[^]
11 Dec 2011 by Sergey Alexandrovich Kryukov
Well, this is a problem. And the problem is not just the dictionary, but the dictionary format.The only open format I know is XDXF, see http://xdxf.sourceforge.net/[^]. This standard supports Unicode (of course, as it is XML-based); and one important point of using Unicode was support of...
12 Jul 2011 by Uilleam
It would be good if you would show what you have tried, but in absence of that, I think all you likely need to do is look up printf, and use a format like %03d. Assuming you have a decent Perl installation, you should be able to find out all you need at the command line with perldoc -f sprintf....
12 Jul 2011 by mla154
Here is a program that prints line numbers:$file = 'results.log';open(INFO, $file);$count = 0;while ($line = ){ $count++; print "$count $line";}close(INFO);According to the tutorial, to solve the second part, one only needs to change one line by inserting an extra four...
16 Oct 2011 by Abhinav S
It would depend a lot on the area where you are located and what opportunities you have around you.Java would probably be the right choice in terms of number of opportunities.However, if you can carve a niche for yourself in C and Cobol, you are likely to get paid more as there is less...
16 Oct 2011 by RaviRanjanKr
This link-[Search and replace across many files with a perl one-liner][^] might help you.
4 Nov 2011 by E.F. Nijboer
You might want to add this first:use PDL;If it still can't find the library. You need to specify the path to it or add it to the environment.use lib "./PDL-2.4.3";Check out this link for more info:http://docstore.mik.ua/orelly/perl/prog3/ch31_13.htm[^]Good luck!
12 Nov 2011 by Oliver Bleckmann
Are you talking about a voice chat? This may be a hard task and the hosting well be even harder (a lot of traffic). For a text chat see this example here http://sourceforge.net/projects/ajaxperlchat/[^] using perl and ajax. But be aware, most hosting companies limit the execution time and...
8 Dec 2011 by #realJSOP
296 MILLION google results regarding "perl"[^]...and you couldn't find the info you seek?
23 Dec 2011 by Graham Breach
Your $baseStream variable is including the newline character(s). Try this:print "Enter the name";$baseStream = ;chomp $baseStream;$b = 1;$strName = "${baseStream}_Strm_${b}";print $strName;"chomp" is a function that removes the line separator from the end of a string.I've...
7 Jan 2012 by Carlos Luis Rojas Aragonés
How to backup multiple databases using Perl
5 Jan 2012 by mahalatchumi
Hi, Remove the chomp and use concatenation operator(.).
6 Jan 2012 by Andreas Gieriet
Classical application of XSLT: XML to XML.
20 Mar 2012 by nv3
Ok, I think that I now know what you mean. Let me repeat it in my words, so you can cross check that I have understood your goal. We have two wheels (circles) mounted with their axels in different positions and touching each other at the 12 o'clock point. Both rotate with 1 rpm. On each wheel...
5 Apr 2012 by nv3
In my opinion, OriginalGriff has given a very good description what awaits you with C++ and .Net. But before you decide, which programming language to pick as your first one (others will follow!) consider the following:- The programming language is most often the easiest part to master....
10 Jul 2012 by Wes Aday
rename OLDNAME, NEWNAMEhttp://forums.devshed.com/perl-programming-6/moving-files-in-perl-7833.html[^]
11 Jul 2012 by Richard MacCutchan
Yes, and it's really quite easy to find[^].
13 Jul 2012 by Carlos Luis Rojas Aragonés
Simulate user interaction in console apps with perl
28 Jul 2012 by David Jeske
You can begin by reading some regex documentation. The trailing "\s*" does nothing. It is interpreted as zero or more occurances of a whitespace character.Here is a simple to understand regex review ...http://www.cs.tut.fi/~jkorpela/perl/regexp.html[^]As for more specific trouble.....
15 Aug 2012 by Faez Shingeri
@func is an array containg names. I want to assign values to each name as below, but it does seem to work.for ($i=0;$i
15 Aug 2012 by Faez Shingeri
This solved my issue :-Dfor ($i=0;$i
30 Sep 2012 by Maverick143
use following linkhttp://www.perlmonks.org/?node_id=646596[^]Thanks,-Mangesh.
6 Oct 2012 by Manfred Rudolf Bihy
That's easy to do by adding a dummy random parameter to the image URL like this:Instead of using a random number you could just use an increasing counter that gets incremented every time you change the images.Another approach would be to...
18 Jan 2013 by Hasham Ahmad
try this??my $ST=$DB->prepare("call apps.package_name.proc(?, ?, ?)");my ($ST_result, $arg1, $arg2);...$ST->bind_param(1, $arg1);$ST->bind_param(2, $arg2);$ST->bind_param_inout(3, \$ST_result, 0, { ora_type=>ORA_RSET } );$ST->execute();while (my $hr =...
23 Feb 2013 by Pranit Kothari
Fortunately many of the languages you mentioned are open source. Download their code, try to understand it. Very first step is to able to work with these languages and technology. I am not sure weather you are able to program (professionally) using HTML and PHP etc.
25 Aug 2013 by H.Brydon
What you want to learn about is "Data marshalling" and "serialization". Google should give you many links that are helpful.
30 Jan 2014 by Kornfeld Eliyahu Peter
There is no error - error code 0 means, no error!
16 Feb 2014 by OriginalGriff
It doesn't quite work like that.We do not do your work for you.If you want someone to write your code, you have to pay - I suggest you go to VWorker.com and ask there.But be aware: you get what you pay for. Pay peanuts, get monkeys
5 Jun 2014 by johannesnestler
Hi Prakash,Have a look at Dynamic Screen Resolution[^]In short, the Windows-API function[DllImport("user32.dll")] static extern int ChangeDisplaySettings(ref DEVMODE devMode, int flags);does the trick. I see you are a quite new member here on CP, so some "advice"...
31 Jul 2014 by KarstenK
Thats a lot of questions. You can stay on the Mac because it has the power of C++ in its language Objective C. Register by Apple to access the online documentation: it is fine and has some sample. Tip: Consider NOT using the new language Swift, because the web is full of objective C...
10 Aug 2014 by Groulien
Inside your 'for' loop:if (i % 100 == 0) { $nr += 1;}
27 Oct 2014 by Prasad Khandekar
Hello,Have a look at following Open Source Projects, They should help you get started. Please note that these projects are not developed in C# though.GnuCashSQL LedgerTurbo CASHRegards,
14 Aug 2015 by Wendelius
Based on the tag you're using Perl. In that case you can use a question mark (?) as a place holder for the parameter and then use bind_param to set the value for the parameter before execute.Have a look at:- A Short Guide to DBI[^]- 5.3. Binding Parameters to Statements [^]
23 Oct 2015 by Sergey Alexandrovich Kryukov
As a first line of defense, you can check up the HTTP referral, which is one of the HTTP header fields of an HTTP request:https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields[^],https://en.wikipedia.org/wiki/HTTP_referer[^].All scripting modules for all non-nonsense...
25 Oct 2015 by Andreas Gieriet
Google?E.g. enable perl apache?E.g. http://www.perlmonks.org/?node_id=9060[^].RegardsAndi
6 Feb 2016 by John Jiyang Hou
An algorithm to determine if a point is inside a 3D convex polygon for a given polygon vertices in Perl
20 Apr 2016 by Richard MacCutchan
Try some research: perl split string - Google Search[^].
9 May 2016 by AnvilRanger
A perl script is just another text file with a pl extension. You can use VB or VBA to write to a text file.You tagged the question VBA, but then as VB in the actual question. Which are you really using? Because writing to a file is different between the two.VBA:VBA - Text...
21 Feb 2017 by Jochen Arndt
That is because the file result_file.txt is still opened for writing and the content has not yet been written physically (flushed) when you are opening it again for reading.While you can force flushing using $fh1->flush(), a better solution is closing file handles when not needed...
21 Feb 2017 by Jochen Arndt
See the file test operations at perlfunc - Perl builtin functions - metacpan.org[^].use Cwd;my $curdir = cwd();if (-e $dir && -d $dir){ print "$dir is an existing directory at $curdir\n";}
1 Mar 2017 by Jochen Arndt
You have to iterate over the directories.A possible solution:use File::Basename;sub ProcessDirectory{ my ($workdir) = shift; print "Processing '$workdir'\n"; my $mask = $workdir . '/*'; # glob: Return list of filename expansions for search mask # grep -d:...
5 Mar 2017 by Jochen Arndt
You are using GetOptions at one place and access command line arguments via $ARGV at other places. When using GetOptions, all matching arguments are removed from $ARGV[].So when executing the script with./generate.pl -prjroot "/home/rpsa/EMO/ct_space" -outdir "/home/rpsa/output" -mapfile...
9 Mar 2017 by Jochen Arndt
Your expression looks for optional white spaces (\s*) followed by an equal sign. Change it to match any characters before the equal sign:$href=/^.*=.*\n//g; Or if there is alway text (letter, digit, or underscore) without spaces:$href=/^\w+=.*\n//g;
15 Mar 2017 by Jochen Arndt
You can't use a transliteration for this because those operate on characters from a list but you want to match the substring _..So you have to use a regular expression:$str =~ s/_\././g;s: Search and replacepattern _\.: underscore and dot (dot must be escaped)replace with .: dot...
27 Oct 2017 by CPallini
I usually go with the first option (even with return, if appropriate) because of less code to type and see. However it is just personal taste.
27 Oct 2017 by W Balboos, GHB
I would prefer the internal break - it's absolutely clear and makes it easier to follow if one has, for example, multiple handlers for a desired value and a break; Alternatively, the while() test could grow and grow, becoming more difficult to understand and easier to code with errors. Also,...
27 Oct 2017 by Patrice T
My like goes to first option. But I use both depending on situation, there is no absolute rule.
27 Oct 2017 by BillWoodruff
I don't think the two examples shown are comparable. When the loop on the second example exits, information persists in a variable 'tentatives that will tell you how many iterations occurred to find the match ... if it found the match. The first example does not persist the iteration count. The...
5 Feb 2018 by CPallini
Using different programming languages makes the developer take adavantage of both (or more) language features. In a typical sceneario, you embed a scripting language (e.g. Lua or Python) into an application (written with a non-scripting one like C++, C# or Java) to make it easily customizable to...
9 Jun 2018 by Richard MacCutchan
PHP and Perl are two completely different beasts. And as it is a school project you should do your own homework, rather than expecting someone else to do it for you.
29 Sep 2019 by Dave Kreskowiak
If you're not familiar with Perl, what do you want from anyone answering this? Step 1: You MUST learn the language before you start writing code in it.
24 Aug 2020 by Sandeep Mewara
You can use exists() function. # Calling the exists() function if(exists($fruit{'apple'})) { print "Exists\n"; } else { print "Not Exists\n" } Refer: Perl - Hashes - Tutorialspoint[^]
24 Aug 2020 by Garth J Lancaster
For the first part, you could think about using the 'exists' Perl keyword, as in : if (exists($fruit($praticular_product)) { print "Found Apple in fruit\n"; } else { print "Apple not found in fruit\n" } you can use 'for' to iterate (loop...
25 Nov 2020 by OriginalGriff
You're running late - the rest of your class was trying to get us to do this homework last week ... But I'll tell you what we told them: Quote: We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it...
28 Sep 2021 by OriginalGriff
We do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers. If you want to know how to create such things, you need to visit a hacking site: but...