RE: Access to current directory

2003-09-16 Thread Mohammed Khatib
Thanks. -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 September 2003 1:49 PM To: [EMAIL PROTECTED] Cc: Perl Subject: Re: Access to current directory Mohammed Khatib wrote: > Does anyone know a way of accessing the current working direct

RE: Auto Detect Reference Type ?

2003-08-29 Thread Mohammed Khatib
>Is there a way to determine the type of a reference at runtime ? Sure is. Use the 'ref' function. e.g. if (ref($pointer) eq "HASH") { ... } See http://www.perldoc.com/perl5.6.1/pod/func/ref.html for more detail. MK. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

RE: Class variables

2003-06-06 Thread Mohammed Khatib
erl Subject: Re: Class variables Mohammed Khatib wrote: > Dear Perl people, > > I'm just wondering about the set up of class variables in a Perl class. > Say I have something like the following: > > == > sub new > { > # fetch class name >

Class variables

2003-06-06 Thread Mohammed Khatib
Dear Perl people, I'm just wondering about the set up of class variables in a Perl class. Say I have something like the following: == sub new { # fetch class name my $class = shift; # create object my $self = { _path => shift, }; # open input

Freeing up memory

2002-12-18 Thread Mohammed Khatib
Hi Everyone, I've been working on a program which handles large amounts of data (around 400MB of Folio markup) and builds data structures from this input. The program makes heavy use of hashes of hashes, arrays of hashes and all that stuff and stores large amounts of data in those data structures

RE: regex question

2002-12-02 Thread Mohammed Khatib
Basil, You mention that: "One also must take the time to understand HOW the module works" I think that this sends out the wrong message to beginners who are already afraid of using modules. The whole point of using a module is that you don't need to know HOW it works, only WHAT it does. That is

Perl equivelant of C's switch function

2002-11-27 Thread Mohammed Khatib
Hi Everyone, I'm looking for a function in Perl that is equivelant to C's "switch" function, where multiple conditionals (sort of like multiple "elsif" statements, only more compact and neater) can be set out and action taken on each chosen option. Does anyone know of such a function in Perl? Th

RE: Coding style filter

2002-11-18 Thread Mohammed Khatib
> -Original Message- > From: Mohammed Khatib > Sent: 18 November 2002 01:00 > Subject: Coding style filter > I am thinking of writing a coding style filter for the Perl > programs that we develop here; possibly one that can be > customised (by setting out different stand

Processing RTFs

2002-09-30 Thread Mohammed Khatib
Hello everyone, I need to develop some modules to parse and provide useful information about RTF documents. All I need to do at the moment is extract titles names, the number of pages of each RTF, and obtain summaries which have specific Word level styles applied. I've had a look at Win32::OLE, b

Coding style filter

2002-09-24 Thread Mohammed Khatib
Hi Everyone, When I started working here (TimeBase) 2 years ago, the programmers had not a hint of coding standards when developing their programs. I started to spread the word of coding standards and their importance, and now things have improved, but their still not good enough. I'll soon be d

RE: Using the 'g' modifier with regexs

2002-05-22 Thread Mohammed Khatib
Thanks. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > On Behalf Of $Bill > Luebkert > Sent: Thursday, May 23, 2002 4:11 PM > To: [EMAIL PROTECTED] > Cc: Perl > Subject: Re: Using the 'g' modifier with regexs >

Using the 'g' modifier with regexs

2002-05-22 Thread Mohammed Khatib
Hi All, A simple question (but this had me baffled for ages today). Take a statement such as the following: if (s!($string)!!g) { # code } Since we are using the g modifier in the substitution, is there a way to access an array or something which holds all the captured matches (assuming th

$0 in modules

2002-03-26 Thread Mohammed Khatib
Hi Everyone, I was looking through the list of Perl special variables but couldn't find a variable that holds the name of the current module/package (maybe I'm blind or just didn't look hard enough). I want to say something like: die "\n(package name) blah blah blah" where (package name) is th

RE: Perl bug? (incrementing and decrementing chars)

2002-03-26 Thread Mohammed Khatib
ts 'Ba' > print ++($foo = 'zz'); # prints 'aaa' > > The auto-decrement operator is not magical. > > > The last line is what you were missing. > > -- > Mike Arms > > > > -Original Message- > > From

Perl bug? (incrementing and decrementing chars)

2002-03-26 Thread Mohammed Khatib
Hi All, The following code prints out the letter "h" to the screen, as expected. $test = "g"; print ++$test; The code below, however, prints out the number -1, when I expect it to print the letter "f". $test = "g"; print --$test; Is this a Perl bug??? I've already worked around this problem

Perl + ColdFusion

2002-02-10 Thread Mohammed Khatib
Dear All, I was just wondering if it was possible to write ColdFusion custom CFX tags using Perl? One of our ColdFusion programmers has a request for a Perl program which he would like to integrate into ColdFusion code. We know it's possible to use C with CF, but Perl is the language of preferen

RE: Check variable type

2002-02-06 Thread Mohammed Khatib
e or too lazy to look things up yourself, then you are wasting our time as well as yours. -- Hank Barta At The Hull Group, Chicago (312) 655-4636 -Original Message- From: Mohammed Khatib [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 11:37 PM To: Toby Stuart; 'Gregg R. A

RE: Regular expression question

2002-01-28 Thread Mohammed Khatib
>How is this more complete? It's the exact same regex, >except for the case-insensitivity! Yep, I agree. > if ($file =~ /.*script.*\.exe$/i) { The .* at the beginning is absolutely not necessary. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jeffrey

RE: @INC

2002-01-28 Thread Mohammed Khatib
- Original Message - From: "Mohammed Khatib" <[EMAIL PROTECTED]> To: "Perl" <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 1:04 AM Subject: @INC > Hi Everyone, > > I'm writing a program in which I want to add to the @INC array BEFORE > anything

RE: @INC

2002-01-28 Thread Mohammed Khatib
I asked about @INC a good week and a half ago.. What's wrong with the ActivePerl e-mail server?? Mk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Brent Dax Sent: Thursday, January 17, 2002 7:33 PM To: [EMAIL PROTECTED]; Perl Subject: RE: @INC [EM

@INC

2002-01-16 Thread Mohammed Khatib
Hi Everyone, I'm writing a program in which I want to add to the @INC array BEFORE anything else in the program. The reason why I want to do this is because one of the modules I want to use is located at: p:\PERL\TimeBase\Folio\Utilities.pm This is the code I'm using, but Perl tells me that it

Passing array to subroutine

2002-01-16 Thread Mohammed Khatib
Hi All, I have something similar to the following: @legn = procLegn(\@legn); sub procLegn { my @legn = ?; code. } I'm trying to dereference the pointer (\@legn) which was passed to the sub-routine. How do I do that? Thanks in advance, Mohammed <>

RE: $/ special var.

2002-01-15 Thread Mohammed Khatib
ROTECTED]] Sent: Wednesday, January 16, 2002 1:01 PM To: [EMAIL PROTECTED] Cc: Perl Subject: Re: $/ special var. Mohammed Khatib wrote: > Hi All, > > Just wondering, if I specify $/ = "string" in the main body of a program, > does the value of $/ carry on if I call a sub-routi

RE: $/ special var.

2002-01-15 Thread Mohammed Khatib
Thanks for your help. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Peter Vogel Sent: Wednesday, January 16, 2002 12:13 PM To: 'Mohammed Khatib '; 'Perl ' Subject: RE: $/ special var. All the perl special vars are global

RE: PERL TK

2001-12-23 Thread Mohammed Khatib
Yeah, I did. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: Saturday, December 22, 2001 4:33 AM To: [EMAIL PROTECTED] Subject: PERL TK Anyone ever get PERL TK to run on Windows? Kim Zuber SEPG PVCS Support ext. 1048 __

File::Find

2001-12-23 Thread Mohammed Khatib
Hi All, Can you use the File::Find method "find" by specifying a sub-routine other than "wanted" as the first method arg? For example: ### find(\&delete, 'c:\temp'); sub delete { # code } ### Thanks, Mk <>

Regex

2001-12-19 Thread Mohammed Khatib
Hi Gurus, I've got the following "if" statement in my program: if ($rec =~ m!^tableofstatutoryrules((-table)?)((\d+)?)$!i) Note that the ((-table)?)((\d)?) section is optional, but if it matches, I want to be able to capture the \d+ in variable $4, WITHOUT receiving a warning when it doesn't ma

Rewinding position in file

2001-12-19 Thread Mohammed Khatib
Hi everyone, I'm currently writing a program where I'm reading in a file line by line, and there are instances in the program where I need to "rewind" the position in the file to the position of the last read. How can I do this? Thanks, Mk <>

RE: System commands

2001-12-19 Thread Mohammed Khatib
PM To: Perl Subject: System commands Mohammed Khatib writes: > Hi All, > > I need to call a command line application (called LinkD) from my perl > program. What I need is the output string that LinkD outputs to the screen > so I can use it in my program, but at the same time, I

Simple question - checking if a directory exists

2001-12-17 Thread Mohammed Khatib
Hi All, To check if a file exists, we use the expression "-e filename". I was wondering whether there was a similar function for determining if a directory existed? Knowing Perl, I'm sure this isn't very hard to do. Thanks in Advance, Mk <>

RE: some times I am losing all data

2001-12-11 Thread Mohammed Khatib
We get the message hold you horses! hahahhahhahaman. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of web tur Sent: Tuesday, December 11, 2001 7:05 AM To: [EMAIL PROTECTED] Subject: some times I am losing all data Dear Sirs, I am using follo