Re: mysql driver problem? (slightly off topic)

2005-04-28 Thread Felix Geerinckx
On 28/04/2005, Graeme McLaren wrote: Hi all, this is slightly off topic but I'm sure someone here has come across this problem. I cannot connect to mysql on my redhat 9 box. I ran: shell perl -MCPAN -e 'install Bundle::DBD::mysql'; and it did say that there was a problem but all I've

Re: Installing Downloaded Modules from CPAN

2005-04-05 Thread Felix Geerinckx
On 05/04/2005, Joel Divekar wrote: I am using Activestate Perl Ver 5.8.4 under Windows 2k and due to firewall I am not able to install packages using ppm / ppm3. Open your ActivePerl HTML documentation and locate PPM in the ActivePerl Components section of the TOC. Scroll down to the PPM,

Re: Lost here.. Use of uninitialized value in print?

2005-04-04 Thread Felix Geerinckx
On 04/04/2005, [EMAIL PROTECTED] wrote: open (TEXT, list.txt) or die Error. No such file\n; @rawtext=TEXT; close(TEXT); According to your own follow-up, @rawtext will have the following content: $rawtext[0] = '$file1.txt$' . \n; $rawtext[1] = '$file2.txt$' . \n; etc ... $list1 =

Re: Program error

2005-04-01 Thread Felix Geerinckx
On 01/04/2005, GR Kumaran wrote: #!c:/sieperl/perl/5.8.0/bin/MSWin32-x86-perlio/perl use CGI; use warnings; use strict; my $page = new CGI; if (DEBUG) { open(DEBUGFILE, debug.txt) || die; $page-save(DEBUGFILE); close(DEBUGFILE); }

Re: My own die message

2005-03-30 Thread Felix Geerinckx
On 30/03/2005, Ankur Gupta wrote: I have the following code : eval{ require file or die unable to find file; }; print $@; But it always prints Can't locate file in @INC. blah blah I want $@ to contain unable to find file. What am I doing wrong or it is not possible to override

Re: db handles with fork()

2005-03-30 Thread Felix Geerinckx
On 30/03/2005, Ramprasad A Padmanabhan wrote: I am writing a perl application that connect to a database and then does a fork() The child completes the process and does a exit(), but the problem is it closes the database connection which the parent would like to use. Can I exit the

Re: HTML parsing

2005-03-29 Thread Felix Geerinckx
On 28/03/2005, Daniel Smith wrote: I was tasked with parsing a set of .html files in order to extract the data contained within some terribly formatted tables. [...] Can anyone shed some light? I used HTML::Treebuilder on a similar project once: #! /usr/bin/perl use warnings;

Re: Net::SSH::Perl error

2005-03-29 Thread Felix Geerinckx
On 29/03/2005, Lohit wrote: i have installed openssh for windows and am able to connect using ssh client. Now, while trying out Net::SSH::Perl module i get an error at my $sshh= Net::SSH::Perl-new($host); Can't map service name 'ssh' to port number. What happens if you specify the port

Re: Module installation problem

2005-03-29 Thread Felix Geerinckx
On 29/03/2005, GR Kumaran wrote: I'm in Win98, I'd downloaded the SIEPERL from CPAN and installed. And I had downloaded MYSQL DBI also from CPAN, but do not know how to install it into SIEPERL. I had read PPM will do, so I tried 'ppm' alone in command prompt, then I got the following error

Re: Internal links with cgi

2005-03-26 Thread Felix Geerinckx
On 26/03/2005, Ankur Gupta wrote: a href=http://127.0.0.1/link.cgi#word;word/a. When I click on the link word, I want the link.cgi to execute and then it should navigate to the word word. Add a name=word attribute to you anchor element: a name=word href=word/a -- felix --

Re: Web Service Client

2005-03-23 Thread Felix Geerinckx
On 22/03/2005, Atul Vohra wrote: [Top-posting fixed] Does anybody have a Web Service client in perl (SOAP stuff) to consume a Web Service. I have created Web Services using Remedy (ARS) and now need to write a cleint for the external customer. [...] I was hoping somebody actually

Re: System o/p to a varaible

2005-03-15 Thread Felix Geerinckx
[EMAIL PROTECTED] (Anish Kumar K.) wrote in news:[EMAIL PROTECTED]: system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; my $line = qx(tail -1 cipe.log); -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to read and delete mail from a cron job

2005-03-15 Thread Felix Geerinckx
on di, 15 mrt 2005 17:07:10 GMT, John Moon wrote: Plus I am not an admin but a developer and procmail is not a product I believe I can use... (at least I can't find it on this UNIX box) Anyone else? http://search.cpan.org/~simon/Mail-Audit-2.1/ and a line in .forward perhaps? -- felix

Re: checking if its a real number

2003-02-27 Thread Felix Geerinckx
on Thu, 27 Feb 2003 00:30:56 GMT, [EMAIL PROTECTED] (T. Murlidharan Nair) wrote: I have a cgi that need to accept only numeric values. ie +ve or -ve real numbers. Is there a quick and easy way to check this. This is a FAQ. See perldoc -q float -- feliex -- To unsubscribe,

Re: checking if its a real number

2003-02-27 Thread Felix Geerinckx
on Thu, 27 Feb 2003 13:34:40 GMT, [EMAIL PROTECTED] (Zentara) wrote: if (/\D/){ print has nondigits\n } if (/^\d+$/) { print is a whole number\n } if (/^-?\d+$/) { print is an integer\n } if (/^[+-]?\d+$/){ print is a +/- integer\n } if (/^-?\d+\.?\d*$/) {

Re: DBI question

2003-02-27 Thread Felix Geerinckx
on do, 27 feb 2003 16:57:59 GMT, Scot Robnett wrote: I have a script which is supposed to e-mail a user their username/password info as long as their e-mail address is in the database. The following code works if the address is in the database (it prints the approval page and sends the mail

Re: NULL insertion

2003-02-25 Thread Felix Geerinckx
on Mon, 24 Feb 2003 22:54:59 GMT, [EMAIL PROTECTED] (T. Murlidharan Nair) wrote: I need to insert NULL into the database using a perl CGI . So if a variable is to be made NULL in perl and it needs to be used in an sql statement what is best way to do it. Do I assign ' \N' to it or 'NULL' ?

Re: help with HTTP::Request for POST

2003-02-18 Thread Felix Geerinckx
on di, 18 feb 2003 16:43:22 GMT, Scott Lutz wrote: What I am attempting to do, is do a server side form action redirect based on a regex on a field from the form. It now seems that this is just going to POST the form data, and leave the user hanging. Is HTTP::Request the best way to direct

Re: file attributes under Win32

2003-02-18 Thread Felix Geerinckx
on Tue, 18 Feb 2003 08:42:11 GMT, [EMAIL PROTECTED] (Zeno Jauch) wrote: is it possible to access file attributes in a Win32 environment via Perl. I am interested not only in getting the DOS attributes like creation and modified date, but also the stuff that can be found on the second tab

Re: help with HTTP::Request for POST

2003-02-18 Thread Felix Geerinckx
on Tue, 18 Feb 2003 00:57:57 GMT, [EMAIL PROTECTED] (Scott Lutz) wrote: This is a vary slightly modified version of the example in the docs, and yet it returns no more data than this in my log : [Mon Feb 17 17:04:05 2003] [error] [client 66.51.160.131] Premature end of script headers:

Re: substitute for NTs net use

2003-02-17 Thread Felix Geerinckx
on Mon, 17 Feb 2003 13:37:57 GMT, [EMAIL PROTECTED] (Joe Mecklin) wrote: Thanks for the info. I appreciate the ideas. Seeing your response, I obviously didn't phrase my request as well as I could have: I'm looking for a Perl module for Linux that allows net use functionality; does

Re: linked lists?

2003-02-16 Thread Felix Geerinckx
on Sun, 16 Feb 2003 18:29:23 GMT, [EMAIL PROTECTED] (Jc) wrote: How would such a thing be done with Perl? This may help me understand C's version a little better. You may want to take a look at O'Reilly's Mastering Algorithms with Perl, by Jon Orwant, Jarkko Hietaniemi and John Macdonald,

Re: How to resolve properly exception

2003-02-14 Thread Felix Geerinckx
on Fri, 14 Feb 2003 12:38:16 GMT, [EMAIL PROTECTED] (Khalid Naji) wrote: How can I write exception with Perl ? See, e.g., Object Oriented Exception Handling in Perl by Arun Udaya Shankar, available at http://www.perl.com/pub/a/2002/11/14/exception.html -- felix -- To unsubscribe,

Re: Want to find and process all *.csv files

2003-02-14 Thread Felix Geerinckx
on Fri, 14 Feb 2003 14:39:48 GMT, [EMAIL PROTECTED] (Chuck) wrote: I have ActivePerl 5.6.0 on Win2000 (in a DOS box). I want to find all .CSV files starting in the directory where the perl script is. I have a program but no files are processed. Can someone help me to get this to work?

Re: How to get a dir file list sans sub-dir names.

2003-02-13 Thread Felix Geerinckx
on Thu, 13 Feb 2003 00:21:03 GMT, [EMAIL PROTECTED] (Gan Uesli Starling) wrote: Am wanting to get a list of files in a directory, but only files which are not themselves further sub-directories. When I do this... opendir(DIR, $this_path) or die Can't opendir $this_path: $!;

Re: The email format of this list.

2003-02-13 Thread Felix Geerinckx
on Thu, 13 Feb 2003 13:17:03 GMT, [EMAIL PROTECTED] (Zeus Odin) wrote: I am trying to avoid Windows. A little help will be greatly appreciated. Point your newsreader at nntp.perl.org. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help retrieving data from Win server

2003-02-13 Thread Felix Geerinckx
on Thu, 13 Feb 2003 14:29:41 GMT, [EMAIL PROTECTED] (Brian McGraw) wrote: ... but I'm kind of stumped as to the best way to retrieve disk space data from my Win machines. Have a look at Dave Roth's Win32::AdminMisc module. http://www.roth.net/perl/adminmisc/#GetDriveSpace I'm using

Re: nt event log

2003-02-12 Thread Felix Geerinckx
on Wed, 12 Feb 2003 15:18:00 GMT, [EMAIL PROTECTED] (Thomas Browner) wrote: Could some one give me example of how to print out nt event log's to an file or screen. If you are using ActivePerl, have a look at the Win32::EventLog module (especially example 1, which seems to do exactly what you

Re: web server 500 error

2003-02-11 Thread Felix Geerinckx
on Tue, 11 Feb 2003 06:59:53 GMT, [EMAIL PROTECTED] (Samuel Mauntz) wrote: the error log on the web server spits out this line every time I try to access my script via a browser 63.201.89.246 - - [11/Feb/2003:00:42:48 -0600] GET /cgi-bin/schedule.pl HTTP/1.1 500 546 That line is not from

Re: Workaround needed for epoch time truncation with gmtime

2003-02-11 Thread Felix Geerinckx
on Tue, 11 Feb 2003 00:31:22 GMT, [EMAIL PROTECTED] (Chris) wrote: Nice. Do you know a hack? I am limited to a small perl 5.6.1 distro. The hack you are looking for can be found in the source code of the Date::Manip module. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: if exists with array

2003-02-11 Thread Felix Geerinckx
on di, 11 feb 2003 17:22:20 GMT, Dan Muey wrote: if(exists $hash{$key}) { ... } is there a way to do that with arrays? IE if there is an array element that is 'bob' then do this :: without having to do a foreach on the array See perldoc -q array contains in the Frequently Asked

Re: if exists with array

2003-02-11 Thread Felix Geerinckx
on di, 11 feb 2003 15:54:36 GMT, Janek Schleicher wrote: On Tue, 11 Feb 2003 11:22:20 -0600, Dan Muey wrote: is there a way to do that with arrays? IE if there is an array element that is 'bob' then do this :: without having to do a foreach on the array Unless the arrays become too big,

Re: MySql LAST ID

2003-02-10 Thread Felix Geerinckx
on ma, 10 feb 2003 19:04:01 GMT, Mario Kulka wrote: $sth = $dbh-prepare (SELECT LAST_INSERT_ID() FROM $table); $sth - execute(); $ad_id = $sth-fetchrow_array(); $sth-finish(); ... The above works fine and gives me the last id, but what worries me is the possibility of someone submitting

Re: Install Mod as NON-Root

2003-02-10 Thread Felix Geerinckx
on ma, 10 feb 2003 21:19:18 GMT, Jeff Westman wrote: How do you install a perl module to your home directory if you do not have root access ?? This a Frequently Asked Question. See perldoc -q own module -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Data Validation Issues

2003-02-07 Thread Felix Geerinckx
on vr, 07 feb 2003 18:54:25 GMT, Will wrote: Second, suppose they try a username that has already been taken. I need a way to kick back an error message to them. I tried setting the username field in the usrs table to UNIQUE, so that might help if someone tried to insert something already

Re: changing passwords on nt

2003-02-07 Thread Felix Geerinckx
on vr, 07 feb 2003 16:50:08 GMT, Thomas Browner wrote: Is there a way to use perl to change nt password. If so could some tell me how to do it. See http://www.roth.net/perl/adminmisc/#SetPassword -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: how to test for numeric user input?

2003-02-05 Thread Felix Geerinckx
on Wed, 05 Feb 2003 06:52:18 GMT, [EMAIL PROTECTED] (Gary Merrick) wrote: I need to somehow test for user input being numeric. I think. :-) This is a frequently asked question: perldoc -q number/whole my $input = 'undef'; Here you are putting the literal string 'undef' into $input.

Re: Modifying the string entered

2003-02-05 Thread Felix Geerinckx
on Wed, 05 Feb 2003 05:04:34 GMT, [EMAIL PROTECTED] (Debraj Bhattacharyya) wrote: Enter the FILENAME : /usr/bin/xyz.sql My question is how to separate the directory path from the filename ,store it in different variables and then go to that particular directory to look for the file ?

Re: Mysql Connection

2003-01-28 Thread Felix Geerinckx
on Tue, 28 Jan 2003 01:27:15 GMT, [EMAIL PROTECTED] (Pankaj Kapare) wrote: Hi, I am trying to connect to MYSQL through my perl script.I am using windows 2000 and activeperl. I am using Net::MySQL to connect with database.But it is giving error : Couldn't connect to /tmp/mysql.sock: at

Re: mail

2002-11-15 Thread Felix Geerinckx
on Fri, 15 Nov 2002 08:23:57 GMT, [EMAIL PROTECTED] (Thejaswi narayana) wrote: I have an assignment in which i have to separate mails based on the from field. I am working on Linux(Redhat 7.2). I want guidance from u ppl regarding this.I want to know how i can parse a mail header and

Re: md5 encryption.

2002-11-13 Thread Felix Geerinckx
on wo, 13 nov 2002 18:23:15 GMT, Christopher Burger wrote: Just a quick question. How can encrypt something with md5 encryption. I have passwords in a mysql database that are md5 encrypted. I was wondering if I can use something like $password = md5($input{'password'}; to get the

Re: Integrating Perl scripts in VB?

2002-11-12 Thread Felix Geerinckx
on Tue, 12 Nov 2002 10:11:05 GMT, [EMAIL PROTECTED] (Ben Crane) wrote: anyone know how to use perl scripts WITHIN a VB application? I want to get a directory listing of certain files into a VB array and wanted to use some of my already created perl scripts... Check out ActiveState's Perl

Re: how did they do it?

2002-11-12 Thread Felix Geerinckx
on Tue, 12 Nov 2002 04:47:04 GMT, [EMAIL PROTECTED] (Mariusz) wrote: They give an option to save ads for later display on one page. I looked up the source code and noticed that all their checkboxes have the same name (printad) and the values grow from zero up. That's easy, but how do you

[OT]: URGENT virus warning

2002-11-12 Thread Felix Geerinckx
Through private communication I've been informed that another list member has received an email message from '[EMAIL PROTECTED]' with a subject line of 'Weekly postins statitistics - 37/2002'. This email message contained the so-called 'W32.Bugbear@mm' virus. I posted this message

Re: Population of variables in hash values...

2002-11-07 Thread Felix Geerinckx
on do, 07 nov 2002 17:13:22 GMT, Tim Yohn wrote: Hey All, Is there an easy way to have variables in the value of a hash that are not populated until the value of the hash is used... my($domain); my(%hash) = ( 1 = '$domain' ); print_domain(test.com); sub

Re: Securing/Encrypting Source

2002-11-07 Thread Felix Geerinckx
on do, 07 nov 2002 13:04:11 GMT, Dan wrote: It's occured to me with my perl program near completion, that the person that's hosting my program isn't.. let's say.. trustworthy enough to not steal source. [...] Any clues as to where I go from here? Find yourself a trustworthy person to host

Re: line feeds in perl scripts

2002-11-06 Thread Felix Geerinckx
on Tue, 05 Nov 2002 19:19:37 GMT, [EMAIL PROTECTED] (Sean Finnigan) wrote: What is the best way to replace line feeds in perl scripts that I copy from my PC to my Unix machine? They don't run on the Unix side unless I open an editor and find/replace the line feeds/carriage returns.

Re: checking input syntax

2002-11-05 Thread Felix Geerinckx
on Tue, 05 Nov 2002 01:10:51 GMT, [EMAIL PROTECTED] (Jose Malacara) wrote: I would like to be able to force them use the server[number].[location] syntax and generate a warning if they don't. Would it be possible to add a second argument test after the first? Something like: ( $#ARGV eq

Monthly posting statistics - October 2002

2002-11-01 Thread Felix Geerinckx
Monthly posting statistics for perl.beginners - October 2002. From 2002-10-01 to 2002-10-31 there were 1675 articles posted (81799 lines) by 326 authors, giving an average 5.14 articles per author, and an average article length of 49 lpa. The average number of articles per day was 54. There

Re: APACHE CGI Configuration

2002-10-31 Thread Felix Geerinckx
on Thu, 31 Oct 2002 04:50:43 GMT, [EMAIL PROTECTED] (Vinai Ar) wrote: [ Please don't post multipart messages - post text only] I am entirely new to apache and CGI. Can any one help me out in making apache server to execute the CGI scripts. The error message that I got it couldn't spawn

Re: Grabbing a process ID

2002-10-31 Thread Felix Geerinckx
on Wed, 30 Oct 2002 19:48:24 GMT, [EMAIL PROTECTED] (Guy Davis) wrote: I am calling another perl script and it has failed occasionally from errors that I have not yet tracked down. What I want to do is grab and store the process id. Then check to see if that process id is still running at a

Re: bad interpreter

2002-10-31 Thread Felix Geerinckx
on Thu, 31 Oct 2002 08:22:08 GMT, [EMAIL PROTECTED] (Karin Friberg) wrote: When I run my perl program I get: bash: ./checkit.pl: bad interpreter: No such file or directory What does that mean? Check your #! line at the top of your program. Does this point to a valid Perl interpreter?

Re: code in CGI forms

2002-10-31 Thread Felix Geerinckx
on Thu, 31 Oct 2002 03:54:23 GMT, [EMAIL PROTECTED] (George Georgalis) wrote: and in the middle of a form, I want to run some code to generate some monotonous stuff. start_form, 'Name: ',textfield('name','',55),br, 'Phone/Fax: ',textfield('phone','',55),br,

Re: splitting

2002-10-28 Thread Felix Geerinckx
on ma, 28 okt 2002 10:15:46 GMT, Javeed Sar wrote: i have big files, i want to split it and do a ftp to other sites, at the other site i should be able to join them and execute them, any of you are doing this type of thing, can anyone help me?? Look for 'split' and 'join' at

Re: Any Perl versions of ...

2002-10-27 Thread Felix Geerinckx
on za, 26 okt 2002 09:16:33 GMT, Paul Company wrote: I'm looking for the following programs written in portable Perl. What I mean by portable is the script doesn't contain system() or backticks (``). vi written in perl cvs written in perl gzip written in perl Stop looking - you won't

Weekly posting statistics - 42/2002

2002-10-21 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 42 of 2002. From Monday 2002-10-14 to Sunday 2002-10-20 there were 373 articles posted (18397 lines) by 114 authors, giving an average 3.27 articles per author, and an average article length of 49 lpa. The average number of articles per day

Re: replacing numbers around a decimal

2002-10-18 Thread Felix Geerinckx
on wo, 16 okt 2002 20:03:31 GMT, Andrew Hughes wrote: I am creating a little calculator that is going to need to take a user entered number that will always have 2 decimal places (using sprintf). It could be 89562321.29 or it could be 101.00) and take the last 4 digits (with the period

Re: Single Quote marks in a string

2002-10-18 Thread Felix Geerinckx
on do, 17 okt 2002 08:01:07 GMT, Andrew Hubbard wrote: I'm having problems with a text file I'm working on. I need to get the descriptions in from the text file and into a string for use in an SQL statement however some of the descriptions use a single quote mark in the

Weekly posting statistics 41/2002

2002-10-14 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 41 of 2002. From Monday 2002-10-07 to Sunday 2002-10-13 there were 454 articles posted (22004 lines) by 124 authors, giving an average 3.66 articles per author, and an average article length of 48 lpa. The average number of articles per day

Weekly posting statistics - 40/2002

2002-10-07 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 40 of 2002. From Monday 2002-09-30 to Sunday 2002-10-06 there were 382 articles posted (17592 lines) by 114 authors, giving an average 3.35 articles per author, and an average article length of 46 lpa. The average number of articles per day

Re: SQL Table Rows

2002-10-01 Thread Felix Geerinckx
on Tue, 01 Oct 2002 10:50:26 GMT, [EMAIL PROTECTED] (Gary Stainburn) wrote: Nobody's mentioned: $countrow=$sth-rows; This way is more efficient that doing the 'select count(*)' as it's done from the same select query, and it also means that yo know beforehand how many rows you will be

Re: Is there a searchable archive for this list

2002-10-01 Thread Felix Geerinckx
on Tue, 01 Oct 2002 15:24:40 GMT, Anidil Rajendran wrote: I dont find any search option in following site http://archive.develooper.com/beginners%40perl.org/ Try http://groups.google.com/advanced_group_search?group=perl.beginners -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Monthly posting statistics - September 2002

2002-10-01 Thread Felix Geerinckx
Monthly posting statistics for perl.beginners - September 2002. From 2002-09-01 to 2002-09-30 there were 1896 articles posted (87758 lines) by 322 authors, giving an average 5.89 articles per author, and an average article length of 46 lpa. The average number of articles per day was 63. There

Re: Insertion and Quotes

2002-10-01 Thread Felix Geerinckx
on Tue, 01 Oct 2002 17:55:21 GMT, Jessee Parker wrote: I'm a bit confused on why this is happening and I'm hoping someone can shed some light on things for me. I read in information from a file which is comma delimted and I use the parsing routine I found in the Perl Cookbook. When

Weekly posting statistics - 39/2002

2002-09-30 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 39 of 2002. From Monday 2002-09-23 to Sunday 2002-09-29 there were 483 articles posted (22798 lines) by 136 authors, giving an average 3.55 articles per author, and an average article length of 47 lpa. The average number of articles per day

Re: CGI Script and getting the PID

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 19:39:05 GMT, Jessee Parker wrote: Hi all, I've run into a bit of a problem. I need to see if a program is currently running. If it is, I want to display this on a web page that tells the status of the program (either on or off). The script I created which is probably

Re: Expect-like Perl script

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 20:52:54 GMT, Jose Malacara wrote: Hello. I am interested in writing a Perl script that can do the following: 1. read a list of user defined commands from a file 2. telnet (or possibly ssh) to a device such as a router, login, and interactively issue the commands read

Re: Last day of Month

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 21:12:56 GMT, Charlie Farinella wrote: I have an error popping up in an application that runs monthly reports and everymonth seems to leave off the last day's entries. The subroutine that determines the last day of the month is here: sub GetLastDayOfMonth { my(

Re: Last day of Month

2002-09-30 Thread Felix Geerinckx
on Mon, 30 Sep 2002 21:38:34 GMT, Charlie Farinella wrote: I don't know if this is helpful. Let me know. a) how this function is called, and if( $hashref-{'period'} eq '1' ) { $starttime = GetFirstDayOfMonth( $curtime ); $endtime = GetLastDayOfMonth( $curtime

Re: opening a list of files

2002-09-25 Thread Felix Geerinckx
on Wed, 25 Sep 2002 10:13:45 GMT, [EMAIL PROTECTED] (Adriano Allora) wrote: Hi to all, I need a script to open all the files in a directory and count all the words of them, but it doesn't work: $folder = pathname; opendir(KART, $folder); foreach (readdir(KART)){ if(grep /\.txt$/,

Re: Creating tables?

2002-09-25 Thread Felix Geerinckx
on Wed, 25 Sep 2002 17:16:19 GMT, Dan wrote: I've managed to get SQL working now. Just one query. How can I get perl to create a new table? I have the table's name set in $acctab, this is what i have, but it doesn't work.. how so? Try $dbh-do(CREATE ...); -- felix -- To

Re: Array Handling

2002-09-24 Thread Felix Geerinckx
on Tue, 24 Sep 2002 13:46:32 GMT, Rohit Mishra-R53658 wrote: Is there any way to open a handle to an array as we open a handle to a file?? The condition being we can use that array handle everywhere we can use a file handle

Weekly posting statistics - 2002/38

2002-09-23 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 38 of 2002. From Monday 2002-09-16 to Sunday 2002-09-22 there were 507 articles posted (23944 lines) by 127 authors, giving an average 3.99 articles per author, and an average article length of 47 lpa. The average number of articles per day

Re: Perl MySQl query syntax

2002-09-23 Thread Felix Geerinckx
on Sun, 22 Sep 2002 17:53:29 GMT, Wiggins D'Anconia wrote: larry lefthook wrote: my $sth = $dbh-prepare('delete from cl_items WHERE date_time $exp_time2 '); You are single quoting your statement which means $exp_time2 is taken literally rather than interpolated should be: my $sth

Re: MySql - Perl question

2002-09-23 Thread Felix Geerinckx
on Sun, 22 Sep 2002 17:06:01 GMT, Mariusz wrote: I have a discount table that carries percentage discounts that should be looked up when the customer submits a discount code and taken into calculation of the total price. My table looks something like this: field names:

Re: something awry

2002-09-11 Thread Felix Geerinckx
on Tue, 10 Sep 2002 17:39:25 GMT, [EMAIL PROTECTED] (Mike Singleton) wrote: my @files = glob('3D2*.log'); my @f = split /s+/,$_,9; What's in $_? Did you mean /\s+/ ? print OUTF join(',',@f).\n; Never openend OUTF -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: s/// in a list -- How to do it ?

2002-09-10 Thread Felix Geerinckx
I have a list @listing whose output is like ... data/23_59_54_20_08_2002 how do i search and replace occurances of data/ with nothing ( ) s|^data/|| for @listing; -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Weekly posting statistics - 36/2002

2002-09-09 Thread Felix Geerinckx
) 13/2 405 31 [EMAIL PROTECTED] (Felix Geerinckx) 12/0 386 32 [EMAIL PROTECTED] (Jeff 'Japhy' Pinyan) 7/0 348 49 [EMAIL PROTECTED] (Drieux) 7/1 283 40 [EMAIL PROTECTED] (Timothy Johnson) 6/1 305 50 [EMAIL PROTECTED] (Wiggins D'Anconia) -- felix

Re: sorting of arrays

2002-09-05 Thread Felix Geerinckx
on Thu, 05 Sep 2002 08:46:08 GMT, [EMAIL PROTECTED] (Zanardi2k2) wrote: Felix Geerinckx wrote: push @array, 3; is the same as $array[2] = 2; (...) Maybe a typo? push @array, 3; should be the same as $array[2] = 3; Indeed. Thanks for spotting

Re: Tips, optimizing script.

2002-09-04 Thread Felix Geerinckx
on Wed, 04 Sep 2002 07:44:01 GMT, [EMAIL PROTECTED] (David Samuelsson) wrote: [Why are you quoting yourself in an original post?] I want tips, on optimizing, and things that can be done smaller and better. Changes goes inside the box. use strict; my

Re: Cookbook example

2002-09-04 Thread Felix Geerinckx
on Wed, 04 Sep 2002 06:23:20 GMT, [EMAIL PROTECTED] (Anidil Rajendran) wrote: expand the filename manually with substitution $filename =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1)) [7] : ( $ENV{HOME} ||

Re: handling microsoft word file

2002-09-04 Thread Felix Geerinckx
on Wed, 04 Sep 2002 10:53:41 GMT, [EMAIL PROTECTED] (Massimiliano Cialdi) wrote: there exist a perl module to manage ms word file? No, not to my knowledge. Unless you are working on Win32 and have MS Word available, in which case you can use Win32::OLE. -- felix -- To unsubscribe,

Re: Cookbook example (fwd)

2002-09-04 Thread Felix Geerinckx
on Thu, 05 Sep 2002 10:02:03 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: Not sure if this mail was sent properly, my apologies if you already have recd this. It was, as you could have found out yourself by going to http://nntp.x.perl.org/group/perl.beginners/ (or by using a

Re: substr or anything like that

2002-09-04 Thread Felix Geerinckx
on Wed, 04 Sep 2002 16:00:06 GMT, Zanardi2k2 wrote: Is there something better than: $var1=substr($_, 0, 10) $var2=substr($_, 11, 16) $var3=... See perldoc -f pack perldoc -f unpack If you have e.g. the following layout: my $string = 123 456 ABC; i.e. 9

Re: sorting of arrays

2002-09-04 Thread Felix Geerinckx
on Tue, 04 Sep 2001 12:15:37 GMT, Quincy Ntuli wrote: I understand that perl desides how it stores data in an array. Perl doesn't, you do. Data in an array is indexed by an integer. You, the programmer, choses at which position you put your data: $array[0] = 0; $array[1] = 1; Or,

Re: Read, Write and Append -- is there more?

2002-09-03 Thread Felix Geerinckx
on Tue, 03 Sep 2002 13:11:47 GMT, [EMAIL PROTECTED] (James Edward Gray II) wrote: This is the easiest way, in my opinion. It'll work on files passes as command line arguments. Beware the replacing though, files will be modified in place and data may be lost! #!/usr/bin/perl -pi The

Re: How did perl -d find perldb.pl?

2002-09-02 Thread Felix Geerinckx
on Sun, 01 Sep 2002 15:37:59 GMT, [EMAIL PROTECTED] (Chris) wrote: My question is How did perl -d manage to find perldb.pl? Have you read perldoc perldebug (especially the section on 'Debugger Customization')? -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Locating columns based on headings

2002-09-02 Thread Felix Geerinckx
on Mon, 02 Sep 2002 13:15:56 GMT, [EMAIL PROTECTED] (Sl003b0462) wrote: I have a csv file with column headings. As the file may be amended and the columns reordered I wish to read the headings and determine their location on each pass. How do I generate a list of fixed headings and

Re: IO::Socket problem how to receive data?

2002-09-02 Thread Felix Geerinckx
on Sun, 01 Sep 2002 15:15:27 GMT, [EMAIL PROTECTED] (Anthony) wrote: I'm trying to learn IO::Socket and i have a little problem is that i DO NOT know how to receive data i use the recv function but doesn't work at all. [...] But I can send data to a perl program but I don't know how to

Weekly posting statistics - 35/2002

2002-09-02 Thread Felix Geerinckx
29/01419 48 [EMAIL PROTECTED] (David) 29/1 698 24 [EMAIL PROTECTED] (Felix Geerinckx) 21/31218 58 [EMAIL PROTECTED] (Drieux) 20/0 593 29 [EMAIL PROTECTED] (Sudarshan Raghavan) 13/0 542 41 [EMAIL PROTECTED] (John W. Krahn) 12/4

Monthly posting statistics - August 2002

2002-09-02 Thread Felix Geerinckx
122/17 6634 54 [EMAIL PROTECTED] (Drieux) 103/62719 26 [EMAIL PROTECTED] (Felix Geerinckx) 81/03587 44 [EMAIL PROTECTED] (John W. Krahn) 75/03614 48 [EMAIL PROTECTED] (David) 55/14 3255 59 [EMAIL PROTECTED] (Nikola Janceski) 55/01864 33

Re: Error: requires explicit package name

2002-08-30 Thread Felix Geerinckx
on Fri, 30 Aug 2002 13:58:47 GMT, [EMAIL PROTECTED] (T) wrote: Global symbol $auto requires explicit package name [...] if ($Country eq Argentina) {my $auto = $q-param( '[EMAIL PROTECTED]' ); } and if ($Country eq Argentina) {$auto = $q-param( '[EMAIL

Re: uniq elements of an array

2002-08-30 Thread Felix Geerinckx
on Fri, 30 Aug 2002 17:32:36 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: Why do you need to do a pattern match anyways? Just a @unique = grep{!$seen{$_}} @all_elements; should do You forgot to increment. The correct way is: @unique = grep{!$seen{$_}++} @all_elements; -- felix

Re: find the lowest number?

2002-08-30 Thread Felix Geerinckx
on Fri, 30 Aug 2002 08:22:56 GMT, [EMAIL PROTECTED] (David Samuelsson) wrote: i get an array conataining a lot off numbers like this: 567 [snipped] 520 how do i find the lowest or the higest number in this series? There is no need to sort the full array (as others suggested) to just

Re: find the lowest number?

2002-08-30 Thread Felix Geerinckx
on Sat, 31 Aug 2002 02:23:20 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: On 30 Aug 2002, Felix Geerinckx wrote: There is no need to sort the full array (as others suggested) to just find the lowest and highest number when an O(n) operation will suffice: Precisely the comment

Re: find the lowest number?

2002-08-30 Thread Felix Geerinckx
on Sat, 31 Aug 2002 03:51:39 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: I thought on similar lines too when that thread was on, but I convinced myself saying that an unsorted array of 1000 or more elements in your code is a poor design to start with :-) I beg to differ. From perldoc

Re: find the lowest number?

2002-08-30 Thread Felix Geerinckx
on Sat, 31 Aug 2002 04:30:34 GMT, [EMAIL PROTECTED] (Sudarshan Raghavan) wrote: My statement was far too general, what I should have said was to have a unsorted array of 1000 or more elements when your problem requires finding the max or min of that list is not a good design. Again, I beg

Re: uniq elements of an array

2002-08-30 Thread Felix Geerinckx
on Fri, 30 Aug 2002 18:26:03 GMT, Tom Allison wrote: david wrote: @hash{@all_elements} = (); now keys %hash gives you the unique elements. Would these exist but be undef? Why don't you write a little program to try it out, using the aptly named 'exists' and 'defined' functions? --

RE: Need help

2002-08-29 Thread Felix Geerinckx
on Thu, 29 Aug 2002 20:40:19 GMT, David Wagner wrote: my %h = (); $h {1} = [ some string,other string,3 ] ; $h {2} = [ some string,other string,2 ] ; $h {3} = [ some string,other string,1 ] ; foreach my $MyKey (sort { $a-[1]=$b-[1] } map{[$_,$h{$_}[2]]} keys %h) { printf %-s -

Re: Customer Name Parsing

2002-08-28 Thread Felix Geerinckx
on Wed, 28 Aug 2002 10:11:16 GMT, [EMAIL PROTECTED] (Harry Jackson) wrote: What I would like to know is if there are any modules that can find similar matches in this data (soundex in Oracle is not quite up to the task). Have you already checked out

  1   2   3   4   5   >