> my $match=qr{#match the whole record for a widget
> ^#start of the record
> $border #a border value
> \s* #optional spaces
> $size#a size value
> \s* #optional spaces
> $tag #a tag value
> $#optional sp
Another thing you can do is break your larger regexes into parts to
make them more readable/maintainable. It also helps to use the x flag
so that you can separate the individual tokens and comment them.
#!/usr/bin/perl
use strict;
use warnings;
use Regexp::Common;
#FIXME: the border value shou
On 1/27/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
snip
> I have tried a couple of things but I am struggling with how to optionally
> match the decimal point.
>
> I think what I need is the code equivilant of:
>zero or more numbers followed by
>zero or one decimal point followed by
Hi All,
I am still a newbie in Perl and it is only with the help of this list that I was
able to construct the following pattern match.
($v_size_str =~ /\d+\s*['"]\s*x\s*\d+\s*['"]/i)
The problem that I have just realized that this string will match the first line
of this input file but not t
Chas Owens
<[EMAIL PROTECTED]
.com>
Jay Savage
<[EMAIL PROTECTED]
l.com>
On 1/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
snip
> Thanks Jay for the hopefully final wrap up to the uninteded long email
> thread. This was a good thing however b/c
> I learned something new in this wonderful thing called Perl.
> I agree and it make sense to use $SIG{__DIE__} for o
On 1/27/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
> Hello,Chas,
>
> Thanks advanced for your good suggestions.
> I tidy up all the words said by you,and write the code as following.Is it
> right?
>
> while(<$sock>)
> {
> my ($key,$value) = split;
> my $timestamp = time();
> push @recor
Hello,Chas,
Thanks advanced for your good suggestions.
I tidy up all the words said by you,and write the code as following.Is it
right?
while(<$sock>)
{
my ($key,$value) = split;
my $timestamp = time();
push @records, { time => $timestamp,
key => $key,
On 1/26/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> > The problem with defining your own versions of die, warn, croak, and
> > carp is that only your code uses them. If another module croaks or
>
> Thats why you put it in a module and use it in all your scripts and if
> it has not already bee
On 1/27/06, Chas Owens <[EMAIL PROTECTED]> wrote:
> for (@records) {
> delete $_ if $_->{time} < time() - 5*60;
> }
Oops, I misused the delete() function. I needed to use the shift()
function instead:
shift @records while $records[0]{time} < time() - 5*60;
--
To unsubscribe, e-mail: [EMAIL
On 1/27/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
> Now I'm still confused on this work.Maybe I have not described the problem
> clearly.
> Fox example,there are some items coming in continuous time piece:
>
> 00:00:01 itemA 200
> 00:00:02 itemB 100
> 00:00:03 itemC 150
> 00:00:04 itemD 300
Now I'm still confused on this work.Maybe I have not described the problem
clearly.
Fox example,there are some items coming in continuous time piece:
00:00:01 itemA 200
00:00:02 itemB 100
00:00:03 itemC 150
00:00:04 itemD 300
00:00:05 itemE 250
...
(the item appear as 'name => vaule' s
13 matches
Mail list logo