Perl is a powerful, high level programming language. Questions about Perl should be limited to the Perl development environment, running Perl, or using Perl to automate tasks on your computer.

learn more… | top users | synonyms

1
vote
2answers
171 views

Split a file by two consecutive newlines

I have text file like this 1. some topic a 20p ID: 20 2. something topic another here there ID: 30 3. ... here come another ID: 40 They are separate by two newlines. How could I split this into ...
1
vote
3answers
2k views

How do I delete a certain line from a file with Perl?

How would I delete the line [[ -f /var/tmp/Li.ksh ]] && /var/tmp/Li.ksh from a file by a perl command in a ksh script? I tried: perl -i -pe "s/[[ -f /var/tmp/Li.ksh ]] && ...
1
vote
1answer
101 views

CPAN install to many directories

When I install stuff locally (not as root) with CPAN, it ends up putting things in a multitude of places. So much so, that I have to set PERL5LIB to five directories! Here's the CPAN settings where ...
0
votes
2answers
609 views

Make Tor use Unique IP for each instance open

How can I get Tor to use a unique IP for each instance of Tor open in C++, Python or Perl? Is there a command to force it to use a unique IP that I can just call using subprocess? *cheers
33
votes
12answers
3k views

How do I remove a file in Linux whose name looks like it's ONLY a hyphen, as in “-”

I've tried rm -- - rm "-" rm "\-" rm \- Gave Perl a shot ~$ perl -e '$junk = glob("-"); chomp $junk; print "$junk\n"; `rm $junk`;' - rm: cannot remove `-': No such file or directory ...and... ...
0
votes
1answer
233 views

Use “find” command to list files IN specified directory

I'm putting together a perl script, and I'm using the following command to list all files and directories under a specified directory `find $dir -print` This lists all files and directories UNDER ...
3
votes
1answer
153 views

How do I model a Perl class with “::” in StarUML?

In StarUML, how can I model a Perl class which uses :: in its name? It doesn't allow :: in the class name, reporting: Element name cannot contain "::" Is there a way to work around this ...
1
vote
2answers
521 views

Automatically Running Perl Script

Is it possible to have a Perl Program constantly running while my PC is on? If so, how do you do it?
10
votes
6answers
9k views

How do I queue multiple files for copying on a Mac?

When I copy multiple files on a Mac, the system tries to copy them all at the same time. The problem is two-fold. First of all, when you select multiple files and copy them, they all go into one ...
1
vote
3answers
399 views

SW to replace a string in Windows

I have a text file (actually XML) that I want to be able to change using a command line. In other words, as part of a Windows batch, I want to locate a string (in this case @@@@, which uses a ...
5
votes
2answers
2k views

perl slurp module issue

root@bt:~/wepbuster-1.0_beta# ./wepbuster Can't locate File/Slurp.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 ...
1
vote
1answer
263 views

What does this Linux shell script line do?

I'm trying to determine exactly what the following line of shell script is doing.: grep --files-with-matches '>' . | sort | uniq | xargs perl -pi~ -e 's/9Kp/9K /' /home/user/DATAFILE.DAT I'm ...
1
vote
1answer
643 views

How do I install Perl/Tk 804.29 from CPAN on OS X with the Xcode tools?

A friend tried to install Perl/Tk 804.029 from source on his MacBook Pro, but it failed during the build of the internal zlib archive: $ cpanp -i Tk [...] cd zlib && make libz.a "CC=llvm-gcc-4.2 " ...
1
vote
1answer
403 views

Trying to use XML::Parser and XML::XPath, where do I type the command?

Here's the tutorial I am using, which I have been assured is of high quality by Google: http://www.kitebird.com/articles/mysql-xml.html#TOC_5 Now, what I am trying to do is run some test scripts ...
1
vote
1answer
509 views

Installing dropbox-api on SUSE fails

I am trying to install the dropbox-api onto my suse 11.4 but i keep getting this error: Can't locate DateTime.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.12.3/i586-linux-thread-multi ...
1
vote
1answer
996 views

How to fix CentOS 5.5 update dependency?

It always has this problem. --> Finished Dependency Resolution perl-AnyEvent-5.240-1.el5.rf.noarch from rpmforge has depsolving problems --> Missing Dependency: perl(Net::SSLeay) >= 1.33 ...
3
votes
3answers
483 views

Creating UNIX-style shortcuts on Windows?

I have a unique problem... I develop Perl on a Windows machine, but my test/prod servers are AIX. I want to be able to test locally with an installation of Apache & Perl, but I don't want to have ...
2
votes
2answers
512 views

Log-off Scripts in Windows 7

I have Public machines that I need to run log-off scripts, which are in Perl. I want the script to run for a Standard user. It seems that the UAC is blocking this from happening. So, I have turned the ...
0
votes
1answer
57 views

How to dump data to DVD when the disk space reach 80% on RAID 1, and clean the dumped space from disk after burn

How to monitor in unix (FreeBSD) /linux (CentOS 5.6) the disk space if its greater or equal to 80%? If its equal or greater then 80%. How can i tell dump the data from a specific /misc/ folder to ...
2
votes
1answer
547 views

perl5.14 OS X - what is the best way manage it?

Im an heavy macports user. Have a lot of ports installed with +perl variants. (and much p5-modules too, and zilion others installed by cpan). Now, I need perl 5.14. (because improved utf8 handling), ...
1
vote
1answer
595 views

Problems installing Subversion Perl

I'm trying to setup Bugzilla's VCS integration with Subversion. I've installed the CollabNet Subversion client CollabNetSubversion-client-1.6.16-1.i386.rpm which installs its libs to ...
2
votes
2answers
3k views

How do I get the path to the perl script that I only know the PID of?

I had a problem recently, where a perl script was consuming server resources. I found out it was a perl script by using "top". But it didn't give the path to the script. Nor did ps. Also, ps -ef ...
2
votes
1answer
1k views

sh.exe and ls significantly slower than usual on MSYS bash and GIT

I use MSYS Git and have the MSYS shell installed. I run Windows XP. All of the sudden basic tasks like runnig ls take many many seconds (>7 seconds) in the Git Bash shell or in the MSYS shell. ...
1
vote
3answers
262 views

New version of Perl

I installed Perl 5.12 on my server, but when I try to check what version is running is says 5.10. I had 5.10 installed previously, so how can I deactivate this older version and make 5.12 the default ...
2
votes
2answers
840 views

How to make «grep -P “foo (b.r)”» display only what's in the brackets? Do I need perl?

I have a large file, and I'm trying to get all matches of a regular expression from it. grep -P "foo (b.r)" Displays all the lines containing «foo b.r», and I'd like to display only what's inside of ...
1
vote
0answers
60 views

Have to write a program using a perl language using the following idea [closed]

i need to write a program, to fetch a number, when i enter the number as input, it should display from the number which i gave as input to the preceeding number the file may be like this B456 ...
1
vote
5answers
400 views

Port perl script to Windows

I have a great perl script I use to untar/unzip a tarball of a file, then correlate a dozen+ files for smart troubleshooting of a NAS system. Now people want to see a version for windows =/ I am ...
0
votes
1answer
646 views

How to run a script constantly in background under linux

I have a perl script which runs a mini webserver allowing me to do various things. I'd like to have this script run when the machine starts up, and constantly run in the background. How should I ...
5
votes
4answers
865 views

How to rename files in batch with Unix rename command?

I have files whose names look like this: Sim1-2_40.36.chr20_sb.foo.indel.novoalign.sam Sim1-2_40.36.chr20_sb.foo.indel.bwa.sam What I want to do is to replace all indel with snp in the names ...
0
votes
1answer
878 views

Perl CPAN: Can't install module dependencies - Could not find a version X or above

Whenever I try installing a perl module on my system, it fails to install the dependencies. I had this working before, I'm not sure why it's not working on my fresh setup. For example, I try to ...
0
votes
1answer
409 views

rsync command works in Bash but hangs when invoked from Perl

I have an rsync command that works fine from either the Bash command line or a Bash script. The command is: rsync -qtz user@hostname:/tmp/p /tmp When I run the command, it copies the file and runs ...
0
votes
1answer
318 views

Perl + failed to install Pogo module on RedHat 5.4

Please advice how to install the Person module "use Person;" on my linux machine The perl script use - obj oriented why I get the following: [root@linux /tmp/Pogo-0.10]# perl Makefile.PL Note ...
4
votes
1answer
513 views

suddenly Windows 7 requires UAC for perl programs?

I've been happily running perl programs on my Windows 7 PC for almost a year, and now suddenly they won't run without UAC intervention. When I give permission, they run in a new window, blink their ...
1
vote
1answer
194 views

“Marking” a windows 7 icon

I read a ton of small PDF files for work, I would like to "mark" these to show that they've been read? I keep them organized in specific folders (like over 1000). I was imagine a PERL script or ...
0
votes
1answer
386 views

Powershell overruling Perl binmode?

I have a Perl script which creates a binary file while scanning a very large text file. It outputs to STDOUT which I redirect in the commandline to a file. To optimize it I'm making changes then ...
1
vote
1answer
207 views

Rebuilding Perl the get it ready for padre

When I tried to install padre I got a message that I need a Perl with ithreads enabled. So when I rebuild my Perl, are these configure-options OK? sh Configure -de -Duseithreads And if I rebuild ...
3
votes
5answers
1k views

Setting up scripts in Amazon EC2 Cloud

I am currently running a few perl and python scripts on a windows pc and would like to port over to the Amazon EC2 servers running 64-bit LINUX. The scripts are basic web scrapers that go to a ...
0
votes
2answers
1k views

perl module issue [closed]

sh-3.2# ./backup.pl Can't locate Net/RawIP.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 ...
1
vote
1answer
400 views

Easy way to get gcc and make in OSX

I want to install a few CPAN modules in OSX. It filed since the module I want requires make and gcc to be installed. A quick google on the subject tells me that I need to install "Apple developer ...
0
votes
1answer
615 views

Subversion installation on CentOS 5 - Missing Dependency perl(URI)

Trying to install subversion on CentOS 5 server. "yum install subversion" runs into the prob of Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386 ...
5
votes
1answer
2k views

convert .dbx (outlook express) mail files to a mbox format (for thunderbird) w/o Windows?

Recently, my hard drive crashed (click... click... clickly clickly click click...). I was using XP and do NOT have my install discs (lost them 3 moves ago...). i make backups regularly and only lost ...
0
votes
1answer
580 views

(Perl) Cannot do `initialize' in Term::ReadLine::Gnu in Mac OSX 10.6

I recently installed MacPorts and I think it might have messed up some of my libraries. Now when I try to run the Perl debugger I get this: >perl -d -e 0 Cannot do `initialize' in ...
2
votes
3answers
1k views

Make test failing when installing packages with CPAN on Cygwin

I'm trying to install Date::Manip::Date, which requires YAML::Syck. I'm running Cygwin on Windows XP. Both packages fail their make tests. I have installed other packages sucessfully, such as ...
4
votes
7answers
12k views

How to convert .xlsx to .txt?

I want to know if there is a Linux tool or a script available to convert .xlsx file to .txt.
5
votes
1answer
6k views

Getting the process id for current perl script

How do I get the process id for the perl process that's running the current script? getppid() doesn't return the same pid as ps -ea| grep . Is there is an easy way or do I just run the ps -ea command ...
2
votes
3answers
2k views

How to get file size before downloading the file LWP::useragent

I wrote a script, so I can automatically download from a hotfile using LWP::UserAgent. I've managed to get the file to download properly. How do I get the file size of the file before downloading? I ...
2
votes
3answers
1k views

perl + append WORD in the end of the last line in the file

I use the following perl one line in order to append WORD in the end of the last line in the file perl -p -i -e 's/$/WORD/;' file But it's append the WORD in every line - How to fix the perl ...
9
votes
4answers
3k views

Can I use perl regular expressions in the vim command line?

I want to use perl regular expressions on the vim command line. For example, to capitalize the words on the current line, you could type: :s/(\w+)/\u$1/g
0
votes
2answers
180 views

ack utility + how to stop search in the file when the first string was found

subject ack utility I don't sure if it possible but I must to ask the following question Because I have a big problem - I use the ack utility to find string in very very very large files The ...
0
votes
2answers
1k views

Install perl Template-Toolkit for bugzilla on windows

Im attempting to install Bugzilla on my local development server (based on a windows machine). My server is the standard xampp install. Ive got to the point where i need to install the relevant perl ...