I am sure one of the experts can make these two regex lines into one, but
here it is..
$z = '001.022.003.040';
print "$z\n";
$z =~ s/^0+//;
$z =~ s/\.0+/\./g;
print "$z\n";
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.c
Try for example
$ip = join '.',map {int} split /\./,$oldip;
or (if you resist on a regular expression)
$oldip =~ s/(?:^0+|(\.)0+([1-9]+)|(\.0)00)/$1.$2 || $3/eg;
JB
-Original Message-
From: CARPENTER,STEPHEN (HP-Corvallis,ex1)
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 17, 2002
The following:
use strict;
sub try1;
try1 "001.001.001.001";
try1 "1.1.101.1";
try1 "002.2.102.001";
exit(0);
sub try1{
my $str = shift;
my $str2 = $str;
$str2 =~ s/(^|\.)(0*)(\d*)/$1$3/go;
print "in: '$str' out: '$str2'\n";
}
gives:
C:\TEMP>c:\temp\t1.pl
in: '0
Hi,
I'm a beginner with Perl and I'm sure this has been done before: I
would like to take a string like this '001.202.033.400' and turn it into
'1.202.33.400'. In other words, strip leading zeros from each octet of an IP
address. I could just split each piece into a different variable, do
I have a script which needs to determine the class of
a number of variables. I have a VSlick tag file which
contains the information. Does anyone know of a way
to either A) export the tag file to searchable text
(it's a binary file) or B) open some sort of interface
(a la OLE style) to talk to V
user2048 wrote:
>(from a list newbie:)
>
>Does anybody know -
>
>Is a .chm help file available for build 631, like there was for build
630?
>
>And how about an index file, for either? Hopefully including entries
for
>the Perl built-in functions, at least.
>
>Personally, I like having both the HT
Thanks Bill!
Now I only need:
Iprocess-1_32.zip
Isync-1_11.zip
If anyone can provide these, I would really appreciate it.
Charles
-Original Message-
From: Charles Washburn
Sent: Wednesday, January 16, 2002 11:28 AM
To: '[EMAIL PROTECTED]'
Subject: Help... does anyone have these file
On Wed, 16 Jan 2002, Kuhnibert wrote:
>
> ok guys,
>
> i need a starter on this one.
> have a file which looks like this
>
> name: @a age: @b
> gender: @c bla: @d blub @e
> blabla: @f
>
> and so on ...
>
> the @ signs are placeholders for a template and mark the position for later
> entries.
In order to create 2 children you have to fork twice.
When you use fork() it returns twice.
-
$pid = fork();
if ($pid > 0) {
### parent here ###
execute parent code
{
elsif (defined $pid) {
### Child here ###
execute child code.
I am trying to write a program in ActivePerl for win32, needing to fork my
code into three processes. I am trying the code below, but I only get one
child (2 processes counting the parent).**defined
($pid1=fork())||die "fork failed $!";if ($pid1>0) {#Parent
Here.defined($
Hello,
I'm trying to re-set up my Perl environment and I found that I do not have
access to the following files:
Iprocess-1_32.zip
Isync-1_11.zip
Mmap-2_03.zip
These were originally downloaded from Aminer's site. Since then they have
been upgraded but, I cannot use the latest versions yet. Can
Very cool. Thanks a bunch Jack.
Larry S.
-Original Message-
From: Dunnigan,Jack [Edm] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 10:41 AM
To: 'Swartwood, Larry H'; Perl-Win32-Users (E-mail)
Subject: RE: Binding events to tk::comboentry
Use this script to find out:
#!
Use this script to find out:
#!/usr/bin/perl -w
#
# $Source: ptkkeysym $ $Revision: 1.1 $
#
use strict;
use Tk 'Ev';
my $keysym;
my $mw = MainWindow->new;
$mw->Label(-text=>"-- Press any key --\n\nKeysym is:\n\n")->pack;
$mw->Label(-textvariable=>\$keysym)->pack;
$mw->Button(-text=>'Exit',
I need to bind the down and up arrow keys to my tk::comboentry. I'm not sure
what the text string would be for those keys. Anyone have an example?
Thanks,
Larry S.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailm
At 18:41 2002-01-16 +0530, Abhra Debroy wrote:
>Can anybody tell me where from I can down load 'Win32::ActAcc'. I tried it
>from CPAN but failed.
http://search.cpan.org/search?dist=Win32-ActAcc
http://www.cpan.org/authors/id/P/PB/PBWOLF/Win32-ActAcc-1.0.zip
/J
-- --- -- -- -
pos(), huh? never stumbled over this function, didn't think that it would be
*that* simple ...
anyway, it does exactly what i want - thanks a lot, you assuredly prevented
me from writing me a really ugly (and error prone) piece of code
--till
One way is to use to use file://g and pos. The prog
Hello everybody,
I have a Perl script in Unix which monitors the health of a server. and also
runs some other jobs in a infinite loop.
It forks children to monitor the health, and run other jobs. To maintain the
state it uses a hash mapped to shared memory so that the main script which is
the pa
One way is to use to use //g and pos. The program
while () {
while (/@(\w)/g) {
# The pos function returns the position
# where the last //g search left off. The next //g
# search wil
ok guys,
i need a starter on this one.
have a file which looks like this
name: @a age: @b
gender: @c bla: @d blub @e
blabla: @f
and so on ...
the @ signs are placeholders for a template and mark the position for later
entries. they have always 1 alphanumeric digit, followed by either one
- Original Message -
From: "Peter Eisengrein" <[EMAIL PROTECTED]>
> That just adds a field to my output, like so:
>
> 7943641|ARRAY(0x1b9efb8)||
>
>
> Perhaps I'm contructing it wrong? I'm doing it like this...
>
> @_=$features{$dn};
> push(@_,$line[1]);
> $features{$dn}=\@_;
>
Title: RE: Task Scheduler?
Win32-Schedular is available from ROTH.NET.
http://www.roth.net
Kind regards,
Trevor Joerges
-Original Message-
From: Mark G. Franz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: Task Scheduler?
There's a Win32::TaskScheduler project on SourceForge. Though it hasn't
been fully released yet and is a 1.0.0 release, it is very functional and
allows most all the options to be set.
I'd like to thank Umberto Nicoletti for all his work for this project.
Here's a link to the sourceforge projec
BINGO! Thanks Rob.
> -Original Message-
> From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 10:58
> To: 'Peter Eisengrein'
> Subject: RE: hash of arrays
>
>
> Hmmm...
>
> If $features{$dn} is a reference to an array you dereference
> it like this...
>
> @tables = $dbh->table_info();
@tables = $dbh->tables();
--
Simon Oliver
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
That just adds a field to my output, like so:
7943641|ARRAY(0x1b9efb8)||
Perhaps I'm contructing it wrong? I'm doing it like this...
@_=$features{$dn};
push(@_,$line[1]);
$features{$dn}=\@_;
> -Original Message-
> From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wedn
25 matches
Mail list logo