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
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
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
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
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
<>
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
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
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
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
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
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 ) {
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
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
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
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
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
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
17 matches
Mail list logo