| Subject | Date Asked |
|
| find and replace | 11/17/2009 |
Q: I have one html file. I am reading the file line by line, and I want to find every occurrence of the ... A: When you do that, perl things you're ending the regular expression at </ and then you're giving it ...
|
| Testing HTML forms with cgi on Windows | 10/24/2009 |
Q: I need to test out a HTML form which has a cgi script to it on my Windows PC. I tested the cgi out ... A: You'll need to run an actual webserver to run the CGI. If it's a Perl scripts, you'll need to ...
|
| CGI script | 10/15/2009 |
Q: I'm trying to read in name-value pairs from a POST where the value pairs are "CD=2&CD=3&CD=4 I need ... A: Your best bet is to use the CGI script, which will parse it for you. Then, you'd do something like. ...
|
| Perl XML:Simple | 9/30/2009 |
Q: I'm trying to user xml:simple to break down an xml doc that I'm receiving from another website. I've ... A: Yes, you'll likely need a foreach or something like that to traverse the data. Your best bet is to ...
|
| XML::Simple | 8/29/2009 |
Q: I have an xml doc that is pulled from another site a copy is saved to a temp file on my server then ... A: Opening and writing to lib/temp/$id.xml isn't very safe. I'd suggest something more like this: use ...
|
| perl assignment question | 6/7/2009 |
Q: I don't understand what is being assigned to the $paper variable in the line below. I've checked 3 ... A: You're assigning an empty hash reference. It's the exact same as. my %hash = (); my $paper = ...
|
| Can't open a file with an extensionless script. | 5/29/2009 |
Q: I am using the code at the bottom in myscript.pl to open a counter file, get the number then ... A: Whether or not there's an extension on the file should not change the way it operates. The only ...
|
| PERL + HTML | 5/8/2009 |
Q: so I want to know if somehow I can use both of them at the same time? Actually I want to know if I ... A: Yes, you can do this. You'd have to write a perl script that would interpret the incoming form post ...
|
| Perl Programming Question | 5/8/2009 |
Q: ...I'm new to Perl and trying to pick up on things along the way. I'm trying to create a Perl ... A: In the else clause on your subroutine, you have this: return $prev_dt; $prev_dt = $a; So the ...
|
| non-working DBM script | 5/7/2009 |
Q: I am trying to get this script to work. The main html page is a simple 3-field entry form to enter a ... A: You can run your scripts on the command line and use them like you would in a browser to see if your ...
|
| data extraction | 4/15/2009 |
Q: Justin: I am not sure who to ask, so I'll try you. In my medical practice, I must verify ... A: Yes, just about any language should be able to perform that functionality for you -- Perl, PHP, ASP, ...
|
| My First Perl Program | 3/23/2009 |
Q: My Perl program that is getting a diagnostic (Global symbol "$filename" requires explicit package ... A: Neil, The issue is the 'use strict'. It enables variable declaration to use them. In the first ...
|
| Perl TCP Socket how to handle large records | 3/7/2009 |
Q: Howdy I have looked all over the place and can't seem to find how to do this in Perl. There ... A: How are you currently doing this in Perl? Reason I ask is because most of that kind of stuff is ...
|
| Declare variable dynamically | 3/3/2009 |
Q: I have a following array: use strict; my @arr=qw(computer laptop telephone); The contents of @arr ... A: Doing that is generally considered a bad practice, as it requires you to disable strict references ...
|
| Text encoding and perl | 2/10/2009 |
Q: I have a CLOB in an oracle database that contains various scientific symbols such as the micro (Alt ... A: The way this question gets answered is different based on which version of perl it is you're using. ...
|
| Array, sort | 1/17/2009 |
Q: I have a text file that contains lines like: name1/value1 name1/value2 name2/value3 name3/value4 etc ... A: Your best bet is to read the entire file into memory, and then sort the arrays as you see fit. ...
|
| Appending data to large file | 1/14/2009 |
Q: I wonder if you could help. I have a large text file (300,000 - 500,000 lines) in a specific format. ... A: Something like this would do it: open my $fh, '<', 'file1'; my $term_1 = <$fh>; my $term_2 = <$fh>; ...
|
| Unicode | 12/11/2008 |
Q: We use a third-party sms gateway to send out sms from our server. To send non usual characters ... A: The word тест is Unicode characters #1090, #1077, #1089, #1090. 1090 in hex ...
|
| edit | 12/4/2008 |
Q: this is a piece of document(copied from IRC channel in Xchat in XP version) i would like to edit by ... A: Unfortunately, I don't know the character mapping for the Chinese characters for the date, but you ...
|
| script to check for files added to a directory in a time interval | 11/21/2008 |
Q: Can you please tell me how to check if a file has been created into a directory within a time ... A: To get a file's modification time, simply: my $create_time = -M "some_file.txt"; Then $create_time ...
|
| looking for a way to write a regex line | 11/13/2008 |
Q: In my auction Script, the Description Line contains: <DIV ALIGN=center> <TABLE WIDTH=98% ... A: That is most certainly not what you want, because [] means a character class, which would cause the ...
|
| performing an action on multiple files | 11/4/2008 |
Q: Hey, I'm pretty new to Perl and couldn't quite answer my question with the current answers to ... A: You can just use the glob operator to get what you want: Something like: FILE: foreach my $file ...
|
| Write back to file | 10/30/2008 |
Q: Hey, I'm writing a script that has to do something like this: Read Line1 from File1 Look through ... A: This is a tricky subject in general. You'd be overwriting in normal cases. An example I just ...
|
| File locking etc | 9/16/2008 |
Q: On a server with a high traffic, what is the best way to be sure that 2 users won't update the same ... A: Depending on your operating system, you're going to want to look into real file locking. Either via ...
|
| perl Regular Expression '~' usage | 9/8/2008 |
Q: I would like to know about Perl Regular Expression syntax, which usually contains the tilde sign ... A: =~ is a perl operator that means 'run this variable against this regular expression. $group =~ ...
|
| Perl encoding problem | 9/4/2008 |
Q: Greetings! Hope that you will understand my problem :) 1- Perl script: #!/usr/bin/perl use CGI; ... A: There's a few issues that could be at-hand here. First, upload the file in BINARY mode, since ...
|
| CGI redirect with extra content header | 8/4/2008 |
Q: What I want is a redirect page saying something like "processing your request... you will be ... A: What you'll need to do is send them a static html page that says, 'please wait while we process', ...
|
| Generate pdf using perl | 7/30/2008 |
Q: I want to create and generate pdf file using perl but without installing any tool in Unix platform. ... A: No, you can't create a PDF without first installing some ps2pdf tools, or some Perl modules. Unless ...
|
| Write die command to log file | 7/29/2008 |
Q: This is password generating file, In this file, I have the following lines timeout=10; ... A: $SIG{__DIE__} is the handler that handles die()s. Its default is something like: warn @_; exit 1; ...
|
| Write die command to log file | 7/29/2008 |
Q: This is password generating file, In this file, I have the following lines timeout=10; ... A: To catch a die, you'd have to write a SIGDIE handler, or instead of dying, just print to the file ...
|
| Upload Multiple Large Files | 7/23/2008 |
Q: I am trying to set up a site to design calendars using my users pictures. In order to do that I have ... A: Unfortunately, unless your provider gives you a higher timeout, it's going to continue to happen ...
|
| changing IP's Path problems? | 7/9/2008 |
Q: Judy Loper Artdsign.com Hi I am definitely not a perl programmer. I have changed my IP and can ... A: I would suggest there's something wrong with the server's configuration or the script's settings, as ...
|
| to run linux commands using cgi | 6/7/2008 |
Q: how to run linux commands using cgi A: There's a few ways to do that. The first, and most simple is: $output = `/bin/ls /`; Anything you ...
|
| Script that works but still gives Internal server error | 6/4/2008 |
Q: I have taken an old cgi script that is working on one of my sites and stripped it down to serve a ... A: No, that won't work like you hoped. Making e-mails go in any other content type than text/plain is ...
|
| Script that works but still gives Internal server error | 6/1/2008 |
Q: I have taken an old cgi script that is working on one of my sites and stripped it down to serve a ... A: There's one of two things going on that's causing this issue. #1: It's not sending headers before ...
|
| Error produced on form submit | 5/29/2008 |
Q: I've set up a form for a client and used mailform.cgi. I have checked all the code in the script and ... A: This error means one of two things: 1) The script is outright crashing. or, 2) It's not sending ...
|
| é -> é | 5/7/2008 |
Q: I'm using a Perl script called SmartyPants <http://daringfireball.net/projects/smartypants/> to ... A: There's a bunch of issues to make sure of before going ahead with this. The biggest one being ...
|
| Perl on Microsoft word document | 5/6/2008 |
Q: Can a perl script be used to parse/edit (i.e. recognize fonts) in Microsoft Word document? A: Parsing MS Word documents is a bit of a crap shoot in that they changed their standard for every ...
|
| Devel::Size | 4/30/2008 |
Q: I'm trying to use "Devel::Size" which is an extension module to check memory usage of a Perl ... A: It sounds like your Solaris build environment is not set up correctly. You can find instructions ...
|
| Devel::Size | 4/30/2008 |
Q: I'm trying to use "Devel::Size" which is an extension module to check memory usage of a Perl ... A: If you're running debian, there's two options for installing the module. The first, is the debian ...
|
| Simple Perl Scripting | 3/8/2008 |
Q: I am new to Perl and programming in general and you may feel this question is very simple but your ... A: There is a CPAN module I'd suggest using in this place: Date::Parse. It will parse dates in ...
|