Re: Regex

2001-12-19 Thread $Bill Luebkert
Mohammed Khatib wrote: > 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, WITHOU

RE: Regex

2001-12-19 Thread Toby Stuart
show some sample data. t0by > -Original Message- > From: Mohammed Khatib [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, December 20, 2001 3:26 PM > To: Perl > Subject: Regex > > Hi Gurus, > > I've got the following "if" statement in my program: > > if ($rec =~ m!^tableofstatutory

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

Re: Rewinding position in file

2001-12-19 Thread $Bill Luebkert
Mohammed Khatib wrote: > 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? perlfunc man page - seek/sysseek

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
Thank you to all those who helpedand thanks to Larry Wall for giving us such an easy (an elegant) way of doing things.problem solved. Mk -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, December 19, 2001 10:22 PM

RE: Autoincrementing

2001-12-19 Thread Hemphill, Barry
You're code seems to have a few problems, so it's hard to tell what you're trying to do with Bug${file_count}.txt. It looks like you're using a hash called %Bug indexed on $file_count, or you're trying to create a string like "Bug0001.txt". I'm going to guess the latter from your description, but

RE: Autoincrementing

2001-12-19 Thread Arms, Mike
You just need to turn it into a string: perl -e "$c='0001'; for (1..10){ print $c++ . ' '; }" produces as output: 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 -- Mike Arms -Original Message- From: North, Wesley J [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001

Re: Autoincrementing

2001-12-19 Thread Travis Wilder
Try using sprintf to format the decimal value to have leading zeros. The sprintf documentation shows how. >>> "North, Wesley J" <[EMAIL PROTECTED]> 12/19/01 01:55PM >>> I have a script that auto-increments new files. Currently it starts at 1 and goes from there. I would like it to create a f

RE: Autoincrementing

2001-12-19 Thread Wagner-David
One way: my $MyBugFile = sprintf "bug%04d.txt', $file_count; Then replace each place you had bug${file_count} with $MyBugFile. Wags ;) -Original Message- From: North, Wesley J [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 11:55 To: '[EMAIL PROTECTED]' Sub

Autoincrementing

2001-12-19 Thread North, Wesley J
I have a script that auto-increments new files. Currently it starts at 1 and goes from there. I would like it to create a file using 0001 instead of 1, but I can't seem to figure out a way to do this. Any suggestions are more than welcome. Here is the script: #! /usr/sbin/perl if ($#ARGV < 0 ) {

Any help with why checking cpu utilization runs slow?

2001-12-19 Thread Michael . Mittentag
Here is a script I have been working on to check CPU Utilization, I borrowed some of it from another script I found online, the part where it actually retrieves the cpu utilization. I am curious if you run this, why does it run so slow when checking the cpu? It seems to take approximately 10 sec

RE: Perl and COM

2001-12-19 Thread MacAlpine, Tim
There is documentation in the ActiveState Perl distribution about using WSC (Windows Script Components) which shows you how to turn Perl code into a COM component. I have had some success with this, though it took a little experimentation. If you search the ActivePerl documentation (build 630) for

getting registry info from a list of servers

2001-12-19 Thread King, Byron
Greetings, all. I'm trying to query a list of servers for a particular registry key. Given a list of servers in an array (or maybe a hash?), I'd like to have the script spit out whether or not a certain registry key exists. This is what I've come up with so far, but it doesn't quite work as I'd

Re: System commands

2001-12-19 Thread Igael AZOULAY
is it not just the use of the reverse quotes to delimit the string ? like my $a = `dir /w` or my $x = "toto*" ; my $dir = `ls -c1 $x` ; Joyeux Noel et Bonne année hannucah and ramadan itou itou Cordialement Igael Azoulay - Original Message - From: <[EMAIL PROTECTED]> To: "Perl" <[EMAIL

System commands

2001-12-19 Thread brianr
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 don't want the system > application to show up on

PleaseRemoveMyName

2001-12-19 Thread David M.Hogan
Please remove my name from the maillist. Thanks! begin:vcard n:Hogan;David tel;pager:01426 641509 tel;fax:01271 338121 tel;work:01271 338057 x-mozilla-html:TRUE url:www.ndevon.ac.uk org:North Devon College;Research & Development version:2.1 email;internet:[EMAIL PROTECTED] title:Head of Researc