Skip to content
Advertisement

Tag: perl

Run a perl script with the ending .pl

I have a question to perl scripts. I can write and understand C and C++ codes but have no experience in perl. I have a perl script with the extension .pl and want to run it on a Raspberry Pi Model B. I get the script (its a part of the Raspberry Pi B extension ‘Busware SD0’ Firmware) from this

Bash oneliner to rename filenames

I often would like to easily rename a bunch of files. I always have to struggle with find, grep, xargs and sed to simply to the job. I would like to understand how I can do a better job using PCRE Here my files: I would rename the dot files properly as I can do with this oneliner: However I

Extract section of xml from result of curl command on Linux

I am issuing the following command: Which returns xml that looks similar to this: What is the easiest way to extract an xml element from the response, e.g. the element “true”? Note, I want the complete opening tag, content, and closing tag (and the content may also be empty. Thanks Answer Would xmllint be an option for you as well?

Alternative to writing many files. MongoDB?

I have a Perl script that produces ~10000 files in the 1kB – 10kB size area, which is not optimal for performance, so I though about using MongoDB instead of writing the many files. I need to run the script on my laptops Linux and OSX. Question Would MongoDB be overkill? Or are there something more suited for this sort

Edit linux capabilities in Perl

In a C program, you can edit your capabilities with cap_set_proc from libcap. How can I achieve the same in a Perl program? Answer Linux::Prctl may meet your needs. If not, you can use syscall() and try to do it the hard way. If that’s unpalatable, too (and I would find it so), I’m sure CPAN would welcome you to

How can I use the Perl debugger’s *supported* editor?

The Perl debugger always says: “Editor support available”. I believe every one can see this, but how can I use it? By the way, I got the above prompt on a Linux/UbuntuĀ 11.04 (Natty Narwhal) machine. Answer The message is a little confusing. It’s telling you it can support running inside an editor, not that there is a special Perl debugger

perl byte code generation with too many file.pl

How to make perl bytecode if sub is there in another file.pl so that I can get all perl script in to binary to give for usage but I am getting codedump warning. Here is the example how I have done! File: add.pl File: util.pl Then when I run: I get I also tried but it says Note: If both

Advertisement