Category "perl"

using histogram to determine colored object presence?

I'm trying to determine if portion of the picture contains red-white striped object (liftramp). If it is present, it looks like this: , and when not like this:

Perl splitting on multiple occurrence of the same pattern

I wrote the following Perl script to split on multiple occurrences of the same pattern. The pattern is: (some text) This is what I've tried: foreach my $line

How to find maximum and minimum value in an array of integers in Perl?

I have an array with values 33, 32, 8, 100. How can I find the maximum and minimum value in this array? Do I need to include any special libraries?

How to override exit() call in Perl eval block

I need to eval some code in Perl that might some times contain an exit() call in it. A very simplified example of this would be: use strict; use warnings; ev

Perl to Python hash table Translation

Hi I'm working on converting perl to python for something to do. I've been looking at some code on hash tables in perl and I've come across a line of code that

Removing leading, trailing and multiple spaces within a string

I would like to remove all leading and trailing spaces. As well as replace multiple spaces with a single space within a string, so that all words in a string ar

What type is STDOUT, and how do I optionally write to it?

Does STDOUT have a "type"? printf STDERR ("STDOUT = %s\n", STDOUT); printf STDERR ("\*STDOUT = %s\n", *STDOUT); printf STDERR ("\\\*STDOUT = %s\n", \*STDOUT);