473,541 Members | 12,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl Forum

Perl programming language - ask questions about perl programming, syntax, variables, scoping, constructs, operators and functions, files, I/O, regular expressions, regex, subroutines, OO (object oriented), perl modules, CGI and more.
6
10,926
thread by: lilly07 | last post Dec 3 '09 by: sweetypie
Hi I tried a simple script to remove the directory as below: #!/usr/bin/perl -w use File::Find; #finddepth(sub{rmdir},'.') system('rm -rf test3'); 1. finddepth(sub{rmdir},'.') removed all the empty directories. 2. But I wanted to remove all the directories which are not empty. Hence I tried system('rm -rf test3'); to remove all...
4
10,922
thread by: alimsdb | last post Mar 17 '08 by: nithinpes
Exactly match a 4 digit number My program but output is 2569 but I want it to output four digit no 2004. use strict; my $string = "I have 256987, 2004 and I a 587458"; if ($string =~ /(\d{4})/) { print $1;
32
10,908
thread by: poolboi | last post Feb 21 '08 by: poolboi
hi guys, i've read a lot of thread of converting excel data into CSV files. however, i need a perl script to convert CSV file into excel file now, if required modules is needed, it would be preferable if win32::OLE is used.. currently what i know is when i change my extension as .csv file mannually, it get changed to an excel file through...
11
10,888
thread by: thanawala27 | last post Oct 20 '10 by: George Kaffejis
Hi guys, I had a problem while writing into an Excel file. What i want to do is: i want to write the contents of 2 variables in one cell of the Excel field. to write the contents of one variable, i use $worksheet->write_string($row, $col, $value1, $format); this works fine.
4
10,768
thread by: rdoneil | last post Sep 27 '07 by: rdoneil
I am in unix and in my perl program, I am trying to move back to the directory the program was originally started in. Obviously, at somepoint in my program it has to move to another directory, and now I want to go back. I tried this lines of perl at the start of the program: $directorylocation=`pwd`; and then this command later on when it is...
2
10,765
thread by: vishaltomar | last post Sep 28 '07 by: numberwhun
Hi, I post this question at a time when my neck is on the line. i have a problem in getting the directory permission using the -w operator. i need to get the permission before I run the xcopy system command. I have to use core Perl modules and nothing else. So the restriction. My code had a problem working with this operator "-w",...
2
10,752
thread by: Ming Wei | last post Jul 19 '05 by: Sunder Chakravaty
Is there a Date module which I can use to compare Date Strings ? e, g. if I have the following two date strings in different format: Feb 9 15:00 2004/02/18 21:29:05 How do I convert them into a common format and then compare them to see which date is more current ?
12
10,733
thread by: MimiMi | last post Apr 17 '10 by: AsiaWired
Hi y'all! I'm new at perl, and I'm trying to automate a file fetch. I have this url (in this example called 'https://GetMyFile'), which, when I paste it into a browser, gives me the pop-up "File Download" - Do you want to open or save this file?.. And clicking 'save' gives me the file I want. I would like to achieve the same result...
2
10,717
thread by: Chris | last post Jul 19 '05 by: nobull
This seems inconsistent: #!/usr/bin/perl -w use strict; my @y; if(!defined(@y)) {
3
10,700
thread by: autodidact | last post Sep 5 '07 by: autodidact
Hello, Guys I'm TOTALLY new at programming (in fact i HATE it) but i heard so much good things about Perl (that its also EASY) i decided to start with it. But I'm having trouble installing it on Windows Vista, i used the website below and i thought i installed Perl using the MSI installer below. But to no avail i can't even get the...
3
10,654
thread by: cdd | last post May 4 '07 by: cdd
Hi, I have a perl script that is running in windows environment. This is calling python BodyTextExtractor. My problem is: I have to move the script to run on linux and I have to change the following part of the script and I don't know how. Please help me! use Win32::Job; ............................................... $job =...
3
10,620
thread by: MyMarlboro | last post Jul 23 '08 by: KevinADC
i wonder am i make a mistake or not... use Data::Dumper; my @array= qw(1 2 3 4 5 6 8 9 2 5); my $highest=@array; foreach my $number (@array) { if (@array > $highest) { $highest = @array;
6
10,590
thread by: ezechiel | last post Nov 9 '09 by: ezechiel
Hi everyone, I have a question about spaces in directory names. If I want to use mkdir something, everything works out, but in this case: #!/usr/local/bin/perl # use warnings; $homedir = "C:/SCRIPT/CJ0249A.1/\"Project Information\""; $file = "$homedir/exist.txt";
8
10,572
thread by: Natti | last post Feb 23 '07 by: miller
Hello, I have a perl program which parses an input file for specific error patterns and generates an output file with all these lines. One of the error patterns that I am looking at spans across multiple lines. I can detect it can as error pattern using information from the first line but cannot print out the remaining lines. Is there a way...
2
10,567
thread by: Manzoorul Hassan | last post Jul 19 '05 by: Manzoorul Hassan
Isn't there a simple way to add a dir to my PATH env? Seems like all the examples I've seen so far all in one way or another is parsing the current PATH and puts it all together, including the new dir. Isn't there a simpler version of this whole process? - manzoor
1
10,551
thread by: RAGHAVENDRAS | last post Oct 3 '06 by: deep022in
Hi All, I am writing a script for getting the ASCII value for the keyboard input. The script: #!c:\perl\bin -w # sascii - Show ASCII values for keypresses use Term::ReadKey; ReadMode('cbreak');
1
10,539
thread by: Mark | last post Jul 19 '05 by: Joe Smith
I am creating a search engine that will scan pages on my Web site. I do not want any false-positive hits, being defined as any match that does not appear on the page using a Web browser. I am using a string of regexp statements to do this. The first one removes anything before the <body> tag since it contains, among other things, general...
6
10,532
thread by: atinti | last post Oct 19 '08 by: numberwhun
I'm tyring to write something that will send a simple email using Perl so far this is what I have #!/usr/bin/perl -w use strict; my $executable = "saplotus.exe'; my $server = 'test@domain'; my $from = 'aetinti@gmail.com';
1
10,528
thread by: mike | last post Jul 19 '05 by: Roel van der Steen
hi i have a piece of code my $text = "<A>ABC</A>"; if ( $text =~ m/ <A>(.*)<\/\1> / ) { print "text is $text\n"; }
7
10,528
thread by: STUPIDFORUM | last post Aug 8 '07 by: numberwhun
ADODB.Recordset "The connection cannot be used to perform this operation." "Microsoft Access Driver" ERROR 0X800A0E7D OLE exception from "ADODB.Recordset": The connection cannot be used to perform this operation. It is either closed or invalid in this context. Win32::OLE(0.1707) error 0x800a0e7d in METHOD/PROPERTYGET "Open" !stupid...
5
10,519
thread by: Amy G | last post Jul 19 '05 by: Mike Simone
I looked at perl.com and tried to install the perl for windows. Neither of the Win98 nor the NT version worked... Is there support under XP?
5
10,509
thread by: jjliu | last post Jul 19 '05 by: Gunnar Hjalmarsson
Could someone tell me how to remove all html tags (and anything inside tags) by perl. Some people suggested me to use HTML::TagFilter but i could not find window version. Thanks very much for your help. JJL
6
10,504
thread by: Pierre-Yves | last post Jul 19 '05 by: Jim Gibson
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this program is already running, please try again in a couple of minutes). For doing this, I guess I have to check the running processes... but I don't...
4
10,499
thread by: Brian | last post Jul 19 '05 by: Brian
'Ello, I'm writing a perl script to spawn child processes to execute jobs. The jobs are system calls. I use open(SYSCALL, "cmd |), to make the system calls because I need the pipe so I can log STDOUT to a file. On Windows my script locks up after the first job is done. It works fine on unix. I am using fork to spawnt the child...
3
10,358
thread by: jbenezech | last post Feb 4 '07 by: miller
Hi All, I have a perl script which starts a java process using Win32::Process. Here is the code to start the java proces: Win32::Process::Create($ProcessObj, shift(@args), join(" ", @args), 0,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.