Re: POE

2001-09-18 Thread Alfred Vahau
Hello, I experienced similar error messages and found that the solution involved the following steps: 1. visit www.cpan.org to download the missing module. 2. unarchive the module according to the prescribed instructions and 3. made sure that the module was in the perl directory. So either you

Re: Off-Topic (200%) - Where are you from?

2001-11-13 Thread Alfred Vahau
PNG, short for Papua New Guinea. Look at northern tip of Australia to locate PNG, in the South West Pacific. A lonely perl user and one of few unix users in this part of the world. You get it. MS rules here. I'm a break free. Cheers, Alfred Vahau Uni. PNG -- To unsubscribe, e-mail: [

Re: Why a program ran with mod_perl runs slower?

2004-12-24 Thread Alfred Vahau
rogram runs slower with mod_perl? I have also tried to put a: PerlRequire f:/web/presafierbinte/perl/benchmark.pl In the corresponding virtualhost section in httpd.conf, in order to preload this program at the server start, but it didn't change anything. Thank you. Teddy -- Alfred Vahau Inf

Re: Copying a hash-of-hashes

2004-12-30 Thread Alfred Vahau
2 => 5 ); my @res = &RANDOMSUB; #call a random subroutine print "$hoh{1}{a} $hoh{2} \n"; sub RANDOMSUB { my %hohcopy = %hoh; $hohcopy{1}{a} = 2; $hohcopy{2} = 2; } Search for "clone" on search.cpan.org -- Alfred Vahau IT Services -

Re: Trouble using shift

2004-12-31 Thread Alfred Vahau
uot; will get very confused if you add or remove elements within the loop body, for example with "splice". So don't do that. The following seems to work for me: @a = qw(a b /c d e); shift @a while @a && $a[0] !~ m!/!; print "@a"; -- Alfred Vahau IT Services - University of Papua New Guinea PO Box 320 - University PO - NCD 134 Papua New Guinea Ph. (675) 3267277 - Fax. (675) 3267187 - Mobile: (675) 6888926 email: [EMAIL PROTECTED]

Re: Becoming Another User

2005-01-03 Thread Alfred Vahau
Can anyone suggest where to look? hi, try searching CPAN. http://search.cpan.org/ alfred, [EMAIL PROTECTED] wrote: How can we test if a user is allowed to login? How can we exec programs as another user? I'm writing a script to translate SASL usernames into UNIX usernames, test if the user is a

Re: file and dir time stamps

2005-01-03 Thread Alfred Vahau
Hi, The CPAN module File and its various methods e.g Find comes in-built with Perl distributions. perldoc File::Find, etc. provide online documentation on how to use them. Randal L. Schwartz has written some feature articles for Linux Magazine showing how to use these modules. See for instance: ht

Re: DLL and Perl

2005-01-03 Thread Alfred Vahau
renard wrote: Could someone point me to document(s) which describes how to use a dll in a perl script. I have a dll and information describing its function calls. I have tried to google but unfortunately I did not use the appropriate search words. Thank You -- Alfred Vahau IT Services

Re: DLL and Perl

2005-01-03 Thread Alfred Vahau
Hi, Could you provide more information on your problem. Perl provides pack and unpack functions for handling binary data but it is difficult to provide pointers as is, IMO. Sorry pushed the Send button too fast the first time. alfred, renard wrote: Could someone point me to document(s) which descri

Re: functions that returns two arrays

2005-01-03 Thread Alfred Vahau
return (@array1, @array2); This will result in list flattening. One big list. I read something about passing by reference Take references to the arrays. return (\array1,\array2) Perl comes with extensive online tutorials/documentation. but does not found anything on return by references. See perld

Re: functions that returns two arrays

2005-01-03 Thread Alfred Vahau
t does not found anything on return by references. Help please. Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- Whatever you do will be insignificant

Re: Our Perl file

2005-01-04 Thread Alfred Vahau
Hi, Is there a code I can use in perl to check to see if it is the current dates data or at least the last 3 days dates, if it is older than 3 days then delete the data in the file it creates? The following online references may be relevant for your project. perldoc -f stat perldoc -f -M alfre

Re: DLL and Perl

2005-01-04 Thread Alfred Vahau
For a good intro. to perl internals, see the online documentation perldoc perlembed It's the first one you want. More specifically perlapi. You might also want to check out SWIG http://www.swig.org/ alfred, renard wrote: I have a .dll and the information on the functions available. The informatio

Re: perl template

2005-01-05 Thread Alfred Vahau
my $templateFile="\home\anish\temp\client.html"; Are you on a Win32 box? *unix uses forward slashes for path names, if that matters on your template. alfred, Anish Kumar K. wrote: I use a perl template and getting this error my $templateFile="\home\anish\temp\client.html"; $template->process($templ

Re: Warning: Use of hash a reference is deprecated

2005-01-07 Thread Alfred Vahau
10 my ($me, %hash )= @_; 11 my $type = %hash->{base_type}; In 10, is the structure of the hash preserved? What happens if you pass the hash by reference? In 11, you are using the hash as a reference. What you want is something like: my $type = $hashref->{base_type}; alfred, Siegfried Heintze

Re: Regarding strings

2005-01-07 Thread Alfred Vahau
perldoc -f substr alfred, [EMAIL PROTECTED] wrote: Hi Frnds, If I have a number of 6 digits. How to get the last 2 digits. This should be valid even when i have 2 digits as input. i.e If input is 991041 then output shud be 41 if input is 41 then output shud be 41 May be junk and simple questio

Re: A Beginner's problem

2005-01-14 Thread Alfred Vahau
When that happens, what happens with the error message? The error message remains but it will be printed only if the file cannot be opened for some reason e.g. the file does not exist. That is what the or is there for. but I am as much a *nix beginner as a Perl beginner Stick with Perl and it will

Re: how to

2005-01-15 Thread Alfred Vahau
Is there some documentation about how to make it work from my computer??? Check out this popular URL on a beginners guide to CGI programming. http://www.lies.com/begperl/ If you provide some snip of your code, esp. the first few lines, you'll get more help in troubleshooting your problem. alfred, G

Re: Is CYGWIN a unix like environment to run PERL modules?

2005-01-18 Thread Alfred Vahau
Hi, Bring up command prompt and run cygwin.bat in it. The contents of cygwin.bat should be [for my setup] @echo off C: chdir C:\cygwin\bin bash --login -i If you want the Linux GUI feel, then you need to load X-Windows. The cygwin URL is: http://www.cygwin.com/ alfred, Zapa Perl wrote: Hello, I in

Re: how do you get the prompt out of cygWIN?

2005-01-20 Thread Alfred Vahau
run cmd.exe or command.com and after that run cygwin.bat from cmd.exe He was directed previously on this list to try this option. He has not reported whether this option actually works. But that is besides his problem which is to get the cygwin command prompt by clicking on the cygwin icon on the d

Re: perl script to binary executible

2005-01-24 Thread Alfred Vahau
so that the code is not seen by the client ? Is shroud any good? http://cpan.cbn.net.id/scripts/ Distributors of indigoperl provide a tool for doing what you want in Windows. Haven't tried it on Linux though. http://www.indigostar.com/ alfred, Manas Kulkarni wrote: Hi, I would like to convert my

Re: How to read this array?

2005-01-26 Thread Alfred Vahau
That looks like a pirated copy of one of O'Reilly's bookshelf CDs. Thank you for pointing this out. I have been an O'Reilly customer on all things Unix and Perl and was shocked to see the online collection. In fact when I visited the site, I was greeted by a pop up banner in what looked like Russi

Re: Trying mod_perl for the first time

2005-01-26 Thread Alfred Vahau
Hi, The information not sufficient. You need to tell Apache that your scripts have the extension .pl. I hope you are doing that. Then you need to tell Apache to use a PerlHandler to process the scripts otherwise Apache will not process it and I think you haven't do this is your httpd.conf. Again ca

Re: How to find the Index of an element in array?

2005-01-27 Thread Alfred Vahau
You can use regular expression Eh? You mean a regular construct? alfred, [EMAIL PROTECTED] wrote: Hi Mallik You can use regular expression - $i=0; foreach $temp (@arr) { if ( $temp eq 'pqr' ) { print "index is == $i \n"; last; } $i++; }

Re: Converting a text file for printing

2005-01-28 Thread Alfred Vahau
Hi, Try the PostScript modules. http://search.cpan.org/search?query=PostScript&mode=all In particular, PostScript::Simple. BasicTypeSetter may work but the module on CPAN is reported to have failed for Win32. Also try posting to the Win32 Perl subscribers list. Some of the experts subscribe to bo

Re: Converting a text file for printing

2005-01-28 Thread Alfred Vahau
And the PostScript-MailLabels module could be a candidate. The author describes the module as flexible enough to handle any printing task. An example is given on printing the labels but could the code be adjusted for your needs? alfred, Alfred Vahau wrote: Hi, Try the PostScript modules. http

Re: CGI upload problem on IE

2005-01-29 Thread Alfred Vahau
Hi, My workaround in Windows to the space in file names (which the *nix don't allow) are the following: (1) Use an underscore instead of space in file names (2) Surround the file name with quotes if spaces are retained (3) Use the hex representation of space (%20) in file names HTH, alfred, Yw Ch

Re: CGI upload problem on IE

2005-01-29 Thread Alfred Vahau
> Unix allows spaces in file names. Agree. But for a Unix-centric person like me operating in an otherwise all Windows environment, I've found that the use of space in Windows filenames is more liberal than in Unix in so far as the use of commands go. So for anyone starting with Windows and headi

Re: remove a file ?

2005-01-30 Thread Alfred Vahau
Hi, perldoc -f unlink alfred Gerard Robin wrote: Hello, I am new on the list and I am sorry if my question is irrelevant with the list. In a program I have to remove a file. I did "perdoc perlfunc" and I found Functions for filehandles, files, or directories "-X", "chdir", "chmod", "chown", "chro

Re: operator equivalents

2005-01-30 Thread Alfred Vahau
Hi, perldoc -f substr alfred, Hawkes, Mick I wrote: All, Could someone please tell me the Perl equivalents of the following string functions Mid$ Left$ Right$ I have found that len$ = length but have not been successful with any of the others Any help is appreciated. Cheers Mick H -- Perl -

Re: operator equivalents

2005-01-30 Thread Alfred Vahau
look at the 'susbtr' function. you mean substr Clearly a typo. :-) alfred Toby Stuart wrote: look at the 'susbtr' function. it will do what you require -Original Message- From: Hawkes, Mick I [mailto:[EMAIL PROTECTED] Sent: Monday, 31 January 2005 3:32 PM To: beginners@perl.org Subject:

Re: Deleting selected files in a directory through perl

2005-02-04 Thread Alfred Vahau
Hi, use the File::Find module and its methods. An example of usage may be found at this URL. http://www.perl.com/pub/a/2004/10/14/file_editing.html You can modify the last example to delete recursively. alfred, Kamalraj Singh Madhan, Noida wrote: Hi All, Kindly let me know if this possible, de

Idiomatic Perl for GPA Calculation

2005-02-16 Thread Alfred Vahau
ut their positions in the program. What is the Perl idiom for doing such a calculation? For the sample data: id 386, $gpa = 35/25 = 1.40 id 216, $gpa = 92/53 = 1.73 Thanks in advance for the help. Alfred Vahau - One of my codes which does not produce correct results ---

Re: Idiomatic Perl for GPA Calculation

2005-02-16 Thread Alfred Vahau
Thank you for the pointer. I will check the calculation again for GPA of 1.98 against id 216. Clearly there is no problem for allowed grades so 1.40 has been confirmed for 386. Alfred, Ankur Gupta wrote: #!/usr/bin/perl # This is the GPA calculation routine for the # Eduadmin system again.

Re: Idiomatic Perl for GPA Calculation

2005-02-16 Thread Alfred Vahau
Jay wrote: On Thu, 17 Feb 2005 00:52:48 +1000, Alfred Vahau <[EMAIL PROTECTED]> wrote: Hi, I've been struggling with what should be a trivial problem. Perl is such a rich language that in formulating the logic, I've actually became confused. Partly because I took a C approach wh

Re: Idiomatic Perl for GPA Calculation

2005-02-16 Thread Alfred Vahau
Jay wrote: On Thu, 17 Feb 2005 06:06:30 +1000, Alfred Vahau <[EMAIL PROTECTED]> wrote: $inputfile = 'gpa.dat'; open (INF, "<$inputfile") || die "can't open file $inputfile $!:\n"; But this is another problem that I can address later. *

Re: Idiomatic Perl for GPA Calculation

2005-02-17 Thread Alfred Vahau
for the 30,000 records that had to be processed. I'm satisfied that 'The Camel' challenge had been met. Thanks to all Perl folks who follow the Sun. Alfred, Randal L. Schwartz wrote: "Alfred" == Alfred Vahau <[EMAIL PROTECTED]> writes: Alfred> $wcp = (

Re: Executing perl code on the command line

2005-03-11 Thread Alfred Vahau
Like: perl -e "print \"Hello World!\n\";" alfred, renard wrote: I am running ActivePerl 5.8.6 on Windows XP. I am unable to execute a statement like -- perl -e '' -- I always get this response: Can't find string terminator "'" anywhere before EOF at -e line 1. Does not matter if I use (', ", or

Re: Multiple variable initialization

2005-03-11 Thread Alfred Vahau
my ($var1, $var2, $var3... arbitrary number of vars) = 1, which obviously doesn't work, but I hoped it's only due to my lack of syntax knowledge. my $var1 = my $var2 = my $var3 = 1; works. Still ugly? alfred Peter Rabbitson wrote: On Fri, Mar 11, 2005 at 04:09:12PM -0500, Todd W wrote: "Peter

Re: Multiple variable initialization

2005-03-12 Thread Alfred Vahau
my ($var1, $var2, $var3) = (1) x 3; Now that is neat! This usage of the repetition operator (x) is actually described in 'The Camel' book, p. 94 Alfred Peter Scott wrote: On Fri, 11 Mar 2005 16:20:50 -0500, Peter Rabbitson wrote: On Fri, Mar 11, 2005 at 04:09:12PM -0500, Todd W wrote: "Pe

Re: Need first line of Excel Spreadsheet

2005-03-30 Thread Alfred Vahau
The Spreadsheet::ParseExcel will dump all the worksheets one after the other into one big file. Is this your observation. The first line of the file will be the first row of worksheet 1. From this the last column can be extracted which contains the file name. If the user still insists on the fil

Re: First time with CPAN

2005-04-13 Thread Alfred Vahau
Hi, In windows you use nmake which you can download from the MS site. Alfred, Walter A Poor Jr wrote: Hello. I am trying to install a CPAN module (Spreadsheet::ParseExcel) on a Windows PC. My difficulty is that the author had unix in mind, and is not sure how the makefile should be run in Window

Re: Uniq from array ?

2005-03-30 Thread Alfred Vahau
Michael, I noted from your original posting that you quoted from a URL which is controversial in that the Perl-related books from O'Reilly are actually pirated copies. This was pointed out by one of the subscribers to this list in a recent thread. Alfred, Michael Gale wrote: Hello, I fi

Re: write to an Excel document

2002-03-14 Thread Alfred Vahau
find error such as ParseRecDescent.pm not found, then visit CPAN and download it. In any case, there is ample documentation and examples on how to use the modules. Good luck. Alfred Vahau Project Breeze Coordinator School of Natural and Physical Sciences University of Papua New Guinea Papua

Re: looking for book on object oriented perl

2002-03-18 Thread Alfred Vahau
l forum and the matter closes here. Alfred Vahau SNPS UPNG PNG -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to eliminate ctrl character in a file ?

2002-03-25 Thread Alfred Vahau
Salute Franck, 1. To convert windows file to unix: perl -pe 's/\xd\xa/\xa/g' < windowsfile > unixfile 2. To convert unix to windows perl -ps 's/\xa/\xd\xa/g' < unixfile > windowsfile Hope this is of some help Alfred Vahau Project Breeze SNPS -- To unsub

Re: Learning Perl

2002-03-25 Thread Alfred Vahau
Hi Rune, Try Robert Pepper's win32 perl tutorial. You will need ActivePerl from ActiveState. http://www.netcat.co.uk/Rob/perl/win32perltut.html Alfred Vahau Project Breeze SNPS --- Hi I'm trying to learn perl. Are ther

Re: Default Input Record Separator

2002-03-26 Thread Alfred Vahau
;; @arr = split (//,$a); Then you can use join like: $line = join ":", @arr; $/ = ":"; # input record separate; Now reading the line should read character by character. Hope this helps. Alfred Vahau Project Breeze SNPS Is

Re: Looking for an old project

2002-04-16 Thread Alfred Vahau
Hi, Probably have PPT (Perl Power Tools) project in mind? Check under scripts directory at CPAN. Alfred Vahau Project Breeze SNPS UniPNG -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: add info to beginning of a line

2002-04-19 Thread Alfred Vahau
I agree. As an extention, the one liner can be used to insert a period. For example 011001 to 01.1001 perl -pi -e's/^(\d{2})/\1\./' yourfile.txt Alfred Vahau Project Breeze UniPNG --- RE: add info to beginning of a line Date

Re: remove duplicate values from array

2002-04-22 Thread Alfred Vahau
Assuming that the array has been converted to a scalar, then the following "Lookaround Assertion" works: #!/usr/bin/perl $_ = 'a a a b b c c'; 1 while s/\b(\w+) \s (?= \1\b ) //gxi; print $_, "\n"; The scalar can be reconverted to an array. Not sure if this is any faster. Alfred, Project Bree

Re: perl and java and html

2005-08-04 Thread Alfred Vahau
Hello Try xampp for Windows for development purposes. Has Apache, MySql and PHP. Great for testing out CGI scripts using Perl on the same box. http://www.xampp.org/ Alfred Vahau Tony Frasketi wrote: Hello I would appreciate it if you would steer me to one or more of those groups you

Re: Project planning

2005-10-22 Thread Alfred Vahau
Hi, The newly released book "Perl Best Practices" by Dr. Damien Conway may be helpful in addition to those recommended already. Alfred, Steve Bertrand wrote: Hi everyone, This question may seem odd, but here goes anyway. I've been working at an ISP for a few years now, and have been adding

Re: call java in perl

2005-10-22 Thread Alfred Vahau
Hi, Is Inline::Java module from CPAN any help? Besides there are others at http://search.cpan.org/ Enter Java as the keyword to search for. Alfred, ZHAO, BING wrote: Hi, I knew there are many ways to call java in perl or call perl in java, but I have been searching, still got no

Re: getting authors' names right (was Re: Project planning)

2005-10-22 Thread Alfred Vahau
Thanks Jeff. Apologies to Dr. Conway and the Perl community for the mistake. Alfred, Jeff 'japhy' Pinyan wrote: On Oct 23, Alfred Vahau said: The newly released book "Perl Best Practices" by Dr. Damien Conway may be helpful in addition to those recommended already.

Re: Query on databases

2005-11-17 Thread Alfred Vahau
If you are using ActiveState Perl, then install the module via PPM. Manual installation on the WinXP is time consuming and you will have to do a lot of googling on the solutions to the error messages you get or post to the relevant Mysql mailing list. The installation of the module itself is o.

Re: You've read the Llama, now what?

2005-11-28 Thread Alfred Vahau
nt. If you deal with Excel data a lot, then learning Perl can help automate some of the tasks. It's addressing problems in one particular computing environment but it's still Perl. Perhaps a hands on approach. Alfred Vahau IT Services University of Papua New Guinea

Re: Reading xls file

2005-12-01 Thread Alfred Vahau
http://www-128.ibm.com/developerworks/library/l-pexcel/ Alfred, Timothy Johnson wrote: If you are on a Windows system, the Win32::OLE module will work beautifully for this. As a matter of fact, the documentation for the Win32::OLE module uses Excel as an example. -Original Message-

Re: WIN32::OLE problem while reading the date format

2006-02-08 Thread Alfred Vahau
See Win32::OLE::Variant on ActiveState Perl Documentation on how to read the date correctly. Alfred, swayam panda wrote: Hi ALL, I am reading some values from the Excel file by using Win32::OLE,I am able to read all fields bur not able able read if the date is in dd/mm/yy( i.e / s

RE: Looking for module

2002-10-31 Thread Alfred Vahau
Try http://snake.cs.tu-berlin.de:8081/~schwartz/pmh/ Alfred Vahau Uni. PNG - Has anyone seen a module that will help me output a document in Microsoft Word format? Any hint in the right direction will be greatly appreciated. Thanks, Chris -- To unsubscribe, e-mail

Subject: RE: file editting

2002-11-13 Thread Alfred Vahau
follows: perl -p -i '.bak' -e 's/(?:!|SUB-TOTAL)//' yourfile.txt. The back up will be to the file yourfile.txt.bak. You will sometimes see the -p -i switches shown as -pi which has the same effect. I use these oneliners a lot to make quick changes on the fly.

[Fwd: push'ing items onto an array]

2002-11-14 Thread Alfred Vahau
the usage of the push function. Alfred Vahau IT Services Uni. PNG       --- End Message --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Subject: checking for special chars in a string

2002-11-14 Thread Alfred Vahau
string. CPAN should have a module to your problem (I'm sure). This is Perl so no doubt other suggestions will be posted. Good luck, Alfred Vahau IT Services Uni. PNG --- Subject: checking for special chars in a string Date: Thu, 14 Nov 2002 18:38:23

Re: excel

2002-07-26 Thread Alfred Vahau
5.6.1 and cygwin in Windows. You can run Perl in Windows using the ActiveState version if that's what you prefer. Best Wishes Alfred Vahau Principal Breeze Developer Discipline of Physics School of Natural and Physical Sciences University of Papua New Guinea PO Box 320 University PO,

Re: question to anyone using Perl for bio-sciences

2002-09-22 Thread Alfred Vahau
Have you checked out http://www.cshl.edu? Lincoln Stein's site may provide some leads. http://stein.cshl.org Alfred Vahau SNPS Uni. PNG -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

WHO IS NAVER-MAILER@naver.com ???

2002-10-06 Thread Alfred Vahau
I had been puzzled about this too in the past when I replied to some of the help requests. Similar experience too with modperl mailing list. Out of curiosity I visited the naver.com site. It looked like from Asia? One of the colleagues here suggested that I unravel the screwy characters using a

¸ÞÀÏ Àü¼Û ½ÇÆÐ ¾Ë¸²

2002-10-08 Thread Alfred Vahau
Here's one I had sent to me after postage in reply to Eric's email on naver.com. This's expected to bounce. Alfred, -- block that mailing address.  --- Eric Pretorious <[EMAIL PROTECTED]> wrote: > Hi, Bruno: > > Unfortunately, I don't have one laying around in

Join Problem

2002-10-18 Thread Alfred Vahau
question will avoid your problem in the first place. What database are you using? Is it that the first entry is deliberately left null as is deemed to be the case? Let the list know on the outcome. Alfred Vahau Uni. PNG Subject: Join problem Date: Thu, 17 Oct

Re: Join Problem

2002-10-18 Thread Alfred Vahau
>shift @columns if not defined $column[0]; ^ Thanks for the correction. It seemed almost like a natural extension of defined which I tried before posting. Alfred, Jeff 'japhy' Pinyan wrote: > On Oct 18, Alfred Vahau said: > > >

Re: newbie module question

2003-04-02 Thread Alfred Vahau
on the PPM which comes with the installation. If in doubt, ask your Win32 systems administrator on how to access the relevant documentation(I assume that you are not alone.) Good luck, Alfred Vahau IT Services University of Papua New Guinea Information Resources Centre Ph. 675 3267 277 Fax. 675