perl

How to write a Perl, Python, or Ruby program to change the memory of another process on Windows?

I wonder if Perl, Python, or Ruby can be used to write a program so that it will look for 0x12345678 in the memory of another process (probably the heap, for both data and code data) and then if it is found, change it to 0x00000000? It is something similar to Cheat Engine, which can do something like that on Windows. ...

Reg Ex to match numbers and commas

I have a .csv file and I'm only interested in rows with comma delimeted integers: 23,2,4,56,78,9,4,6 The number of comma delimited values in a row should be more than 5 (or whatever). I'm doing this in perl. ...

How do I use MS C++ Express 2008 to build Perl Unicode::Map on Windows?

I am currently trying to make the Unicode-Map-0.112 module, but encounter an error, '0x1', that is evidently related to using nmake. I tried to follow suggestions on Perl Monks, i.e. http://www.perlmonks.org/?node_id=434813 However, I am unable to use ppm's capabilities because I am on a Windows machine without a network connection, a...

CSV into hash

I have a csv with the first column a label followed by comma separated values: LabelA,45,56,78,90 LabelB,56,65,43,32 LabelC,56,87,98,45 I'd like the first column (LabelA etc) to be the Key in a hash with the numeric values in an array. I can read the file into an array or scalar but I'm not sure what to do after that. Suggestions?? ...

Perl for loop explanation

I'm looking through perl code and I see this: sub html_filter { my $text = shift; for ($text) { s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/"/&quot;/g; } return $text; } what does the for loop do in this case and why would you do it this way? ...

How do I get the output of curl into a variable in Perl if I invoke it using backtics?

I'm trying to get the response of a curl call into a variable in perl. my $foo = `curl yadd yadda`; print $foo; does not work. When I run this at the command line the curl call prints all its output correctly in the terminal, but the variable is not filled with that data. Is there a way to do this without installing and calling th...

Perl module(s) for creating a simple Microsoft Windows GUI?

I'd like to create a simple Windows GUI for my Perl program. It basically needs to spawn a window, write log information to a text box, and have an input box and a couple of start/stop buttons. Does anyone have any tips as to which Perl modules I use? The people I work with like Qt, so that may be a preference, but I'm not bothered. ...

How can I easily add the uninstalled Perl modules in my development directory to @INC?

I'm writing Perl t/*.t tests for an existing project. During development, I'd like to use 'prove' to run select tests at arbitrary depths in the module directory hierarchy. I've created some t/ directories at the same depth as the *.pm files I'd like to test. Unfortunately, the lib/ at the base of the project's code is not in @INC. What...

What do these Perl regexes mean?

What does the following syntax mean in Perl? $line =~ /([^:]+):/; and $line =~ s/([^:]+):/$replace/; ...

What's a good development environment for Perl?

I develop applications using PHP or Java and will study Perl for the first time. For PHP and Java, there are integrated development environments such as Eclipse, and debugging environment was regulated well, but, in the case of Perl, what kind of development environment do people use? Is there a recommended IDE? I would prefer a fre...

Still nmake problem with Unicode-Map-0.112 after trying vcvarsall.bat

Many thanks to ephemient for recommending to try vcvarsall.bat. In DOS successfully ran vcvarsall.bat, which was part of MS C++ Express 2008 Next I continued to try to follow the PerlMonks advice by using ppm, i.e. http://www.perlmonks.org/?node_id=434813 So I tried to make, really nmake Unicode-Map-0.112 again. I received one more ...

How can I expand a string like "1..15,16" into a list of numbers?

I have a Perl application that takes from command line an input as: application --fields 1-6,8 I am required to display the fields as requested by the user on command line. I thought of substituting '-' with '..' so that I can store them in array e.g. $str = "1..15,16" ; @arr2 = ( $str ) ; @arr = ( 1..15,16 ) ; print "@arr\n" ; pri...

How can I strip invalid XML characters from strings in Perl?

I'm looking for what the standard, approved, and robust way of stripping invalid characters from strings before writing them to an XML file. I'm talking here about blocks of text containing backspace (^H) and formfeed characters etc. There has to be a standard library/module function for doing this but I can't find it. I'm using XML::L...

When should you use a package variable vs a lexical variable (and what's the difference)?

I'm looking at some older Perl code on Perl Monks to figure out programming with Win32::OLE and MS Word. Scattered throughout the code are variables with names like $MS::Word and the like, without a 'my' included in their declaration. After reading a bit on Google, I understand that these are called 'package variables' versus 'lexical va...

How do I loop over all the methods of a class in Perl?

How do you loop over all the methods of a class in Perl? Are there any good online references to Perl introspection or reflection? ...

How can I pass the environment from my Python web application to a Perl program?

How do I set Perl's %ENV to introduce a Perl script into the context of my web application? I have a website, written in a language different from Perl (Python). However I need to use a Perl application, which consists of a .pl file: #!/usr/bin/env perl "$ENV{DOCUMENT_ROOT}/foo/bar.pm" =~ /^(.+)$/; require $1; my $BAR =...

How can I convert a WMF image to PNG or JPG on Windows using Perl?

By any chance is anyone aware of a Perl module that will allow a WMF image to be converted over to the PNG or JPEG format? I searched CPAN, but did not come across anything. Due to installation limitations, must be a Perl module and work on Windows. ...

How can I install and use ack library on Windows?

I have never used Perl, but I am really impressed by the ack, which I would like to use for source code searching, etc. Can anyone guide me of how to make use of this excellent library on Windows? ...

Using Perl, how do I check if a process with given name is running or not?

Using Perl, how do I check if a particular Windows process is running or not? Basically, I want to start a process using 'exec', but I should do this only if it is not already running. So how to know if a process with particular name is running or not? Is there any Perl module which provides this feature? ...

How can I have variable assertions in Perl?

How can I check that a variable has a specific value in Perl? Is there a command to stop a script's execution to look up some of it's variables? I wonder if I can use the Pythonic practice of inserting: assert 0, (foo, bar) to debug scripts in a debuger-less way? ...