Forum: Perl Aug 29th, 2007 |
| Replies: 3 Views: 995 Hello. I started learning Perl some time in 2006 and found it very suitable for the development of a web based application. I was impressed by the way you can get so much done in just a few lines... |
Forum: Perl May 3rd, 2007 |
| Replies: 3 Views: 3,903 You could use the wget Unix utility in combination with Perl to do this. Even if you don't have a Windows port of it you could use this: http://pages.interlog.com/~tcharron/wgetwin.html. Just call... |
Forum: Perl Mar 14th, 2007 |
| Replies: 2 Views: 9,529 To expand on what masijade said (which is correct): .pm files are library files. This means they contain subroutines that many programs may find useful. They can be used in a program as follows
... |
Forum: Perl Feb 27th, 2007 |
| Replies: 3 Views: 19,358 Yes. I have checked out the Perl documentation and that's just the job. Thanks.
Steven. |
Forum: Perl Feb 23rd, 2007 |
| Replies: 7 Views: 11,023 Say your data is in a variable called $page. You can use the split function to split on the first line break only and then only apply your data processing code to the text that appears after that.... |
Forum: Perl Feb 20th, 2007 |
| Replies: 3 Views: 5,090 Hi Avik. What you require is a program that replaces each instance of \n with \n\n. This could easily be done in Perl, but is so simple it would be neater to use sed. Seeing as you said a Unix... |
Forum: Perl Feb 14th, 2007 |
| Replies: 2 Views: 1,835 Hi. When you say a column of numbers I'm thinking you mean one number per line. If I was doing this problem I would try this:
1. Split the column into it's component rows using the split... |
Forum: Perl Feb 14th, 2007 |
| Replies: 4 Views: 2,914 Just as a side note (seeing as you seem to have solved the OP's problem), setting an expiry date for things that is before Jan 1st 1970 may cause the integer representing that date at system level to... |
Forum: Perl Feb 7th, 2007 |
| Replies: 4 Views: 7,819 First, it would be highly advisable to start your Perl script like this:
#!/usr/bin/perl -T
use strict;
use warnings;
I know you used warnings with the -w flag already, but adding strict... |
Forum: Perl Jan 27th, 2007 |
| Replies: 1 Views: 3,604 Hello everyone. Is it allowed to have a "use" statement inside an eval that is compiled separately to the enclosing program (i.e. eval EXPR, not eval BLOCK). The reason I want to do this is, I have... |
Forum: Perl Jan 26th, 2007 |
| Replies: 1 Views: 2,127 I was wondering whether anyone else has experienced this. When a script I am working on got above a certain size, the line numbers quoted in the compile and run time error messages started to be... |
Forum: Perl Jan 22nd, 2007 |
| Replies: 4 Views: 4,830 I think what might be wrong here is that Perl treats both single and double quotes as string terminators, whether you started the string with a single or double quote. My advice is try escaping the... |
Forum: Perl Jan 16th, 2007 |
| Replies: 0 Views: 1,570 Hello everyone. I'm working on getting threads of replies to work in my forum system. I'm using this function:
sub read_fields {
my($offset1, $offset2, $offset3, $offset4, $this_offset,... |
Forum: Perl Jan 12th, 2007 |
| Replies: 4 Views: 2,290 You might be able to do this using the IPC tools built into Perl. This page describes how to open a child process and connect pipes to it's standard input and output:... |
Forum: Perl Jan 7th, 2007 |
| Replies: 3 Views: 2,343 Hello everyone. I always run Perl scripts on a web server with
#!/usr/bin/perl -T
at the top (i.e. taint mode on). I try to do the same when testing scripts on my local machine and this... |
Forum: Perl Jan 4th, 2007 |
| Replies: 0 Views: 1,403 Hello everyone and welcome to the next episode of Mushy-pea's blog. This entry is about my favourite language (except English of course) Perl. If you're a regular Perl user you might already know... |
Forum: Perl Jan 3rd, 2007 |
| Replies: 8 Views: 3,490 Thanks for the advice guys. I have rewritten the part of my program that contained the empty block to avoid it, as I agree its not good aesthetically.
Steven. |
Forum: Perl Dec 17th, 2006 |
| Replies: 1 Views: 1,989 Hello everyone. If you're a regular Perl user you might already know this; the developers of Perl 6 are using a prototype version of the Perl 6 interpreter written in Haskell to do various "proof... |
Forum: Perl Dec 16th, 2006 |
| Replies: 8 Views: 3,490 Thanks Kevin. Actually, I have decided to release the application I am working on (perlBB) as open source software. So, if you want to have a peek at the code you can visit the project home page on... |
Forum: Perl Dec 16th, 2006 |
| Replies: 8 Views: 3,490 Hello everyone. I was just wondering if it is OK to do this:
if ($beer == $wine) {# Some code}
elsif ($beer == $vodka) {}
else {die("Oh dear! Neither condition satisfied!")}
i.e. have... |
Forum: Perl Dec 12th, 2006 |
| Replies: 3 Views: 19,358 Hello everyone. Does anyone know if there is a way to start a child process from within a script, then capture the child's standard output and exit code? From looking at the docs it seems that
... |
Forum: Perl Dec 12th, 2006 |
| Replies: 4 Views: 2,247 Ah, I see. However, I am actually using strict in this program. I only posted a snippit of code so that can't be seen. At the top of the code you would find:
#!/usr/bin/perl -wT
use... |
Forum: Perl Dec 11th, 2006 |
| Replies: 13 Views: 2,825 You don't need to deal with ports or FTP to do this. What you require can be done with a form on your website and a Perl script to process the form on the server. There may be open source scripts... |
Forum: Perl Dec 11th, 2006 |
| Replies: 4 Views: 2,247 Hello everyone. I'm still working on that forum system I mentioned a bit ago (perlBB). Hopefully it'll be ready for Christmas :p . However, I ran into a strange problem while I was re-writing... |
Forum: Perl Nov 26th, 2006 |
| Replies: 7 Views: 3,542 Tutorials are good for learning the basics of a language. However, if you want a reference resource where you can look up a manual page on any keyword (with some tutorials thrown in as well) try out... |
Forum: Perl Nov 18th, 2006 |
| Replies: 4 Views: 7,991 To make a Perl script display a page you have already created, do this:
open(file1, "thanks.html");
@data = <file1>;
close(file1);
$page = join("", @data);
print "Content-type:... |
Forum: Perl Nov 15th, 2006 |
| Replies: 3 Views: 4,312 Actually (I should have said this at the start), the regexes were inside an eval so I'm not surprised that strange things were happening. At the time it appeared that the matches extracted from one... |
Forum: Perl Nov 12th, 2006 |
| Replies: 3 Views: 4,312 Hello everyone. I've run into a problem with regular expressions; the extraction "variables" ($1, $2, $3 etc.) are read only and scoped to the current block. If you need to do two regex extraction... |
Forum: Perl Nov 5th, 2006 |
| Replies: 2 Views: 3,599 Thanks Kevin. I read somthing on a site called www.pageresource.com about that issue. I usually use perldoc.perl.org for things specific to Perl. Guess it could have been a typo.
Steven. |
Forum: Perl Nov 5th, 2006 |
| Replies: 2 Views: 3,599 Hello everyone. I've tried several times to use associative arrays in my Perl scripts, but each time I have got syntax errors I can't understand. Based on the tutorials I've read I have tried to do... |
Forum: Perl Oct 20th, 2006 |
| Replies: 7 Views: 3,894 Here is the file I'm currently using for testing purposes:
<header>
<type>Perl BB version 1.00 post database file</type>
<id>6F43 89AF 15DD 18AB</id>
<title>Post log database file for... |
Forum: Perl Oct 19th, 2006 |
| Replies: 7 Views: 3,894 That is pretty much true, but I have my reasons. Part of the challenge in this project is to write a single script that provides the features of existing "script + database app" solutions. Inter... |
Forum: Perl Oct 19th, 2006 |
| Replies: 7 Views: 3,894 Hello again. I am writing a bulletin board script at the moment (Perl BB sound good :p )? While writing some code to update a text file I encountered this situation. I need to open the file,... |
Forum: Perl Sep 30th, 2006 |
| Replies: 3 Views: 5,549 Thanks Kevin. I'm sure one of those methods will do the job.
Steven. |
Forum: Perl Sep 30th, 2006 |
| Replies: 3 Views: 5,549 Hello everyone. I am writing a Perl script that will be installed on a Linux host. I need the script to be able to access the current time / date environment variable somtimes. I've looked through... |
Forum: Perl Sep 29th, 2006 |
| Replies: 2 Views: 4,740 |
Forum: Perl Sep 28th, 2006 |
| Replies: 6 Views: 9,480 Thanks for the advice. I guess this means I wasted my effort with that little subroutine. However, at least you know for sure whats going to happen when you implement the conversion yourself.
... |
Forum: Perl Sep 25th, 2006 |
| Replies: 2 Views: 4,740 This is my first working perl script that does anything useful; that being to count the hits made on a web page and display the count graphically. To make the counter work on your web page (should... |
Forum: Perl Sep 24th, 2006 |
| Replies: 6 Views: 9,480 After doing some reading I've found the answer:
$variable_2 = sprintf("%u", $variable_1);
Where $variable_2 and $variable_1 are of type character and integer, respectively. |
Forum: Perl Sep 24th, 2006 |
| Replies: 6 Views: 9,480 Hello Kevin. What I mean is, is there a library function that you can pass:
$variable_1 = 1234 (type: integer)
and it will return:
$variable_2 = "1234" (type: character)
Steven. |