Re: about utf8 translation

2005-11-29 Thread Jeff Pang
I have resolve this problem,as:

$subject = encode("euc-cn", decode("utf8", $subject));

Sorry for bothering.

在 05-11-30,Jeff Pang<[EMAIL PROTECTED]> 写道:
> Hi,lists,
>
> I have a file looking as below:
>
> <[EMAIL PROTECTED]> 145K179B  璧搴?
> <[EMAIL PROTECTED]>171K122B  ���璇�
> <[EMAIL PROTECTED]> 28K904B   ���K60830
> <[EMAIL PROTECTED]> 243K600B  ��规�寮�?
> <[EMAIL PROTECTED]>  178K626B  运筹学3
> <[EMAIL PROTECTED]>743K348B  寮
> <[EMAIL PROTECTED]>  182K406B  璧
> <[EMAIL PROTECTED]> 43K393B   �浠�
> <[EMAIL PROTECTED]> 249K335B  灞辫タ�ラ��璧���?
>
>
> as you see, the third column is coding with utf8,so it can't print
> output correctly on my screen.I have try these methods:
>
> binmode(STDOUT, ":encoding(gbk)");
>
> or
> binmode(STDOUT, ":encoding(gb2312)");
>
> or
> use Encode;
> $subject = encode("gb2312", $subject);
>
> or
> use Encode;
> $subject = encode("gbk", $subject);
>
> but all these ways can't work correctly for me.
> Can anyone here help me?Thanks a lot.
>


about utf8 translation

2005-11-29 Thread Jeff Pang
Hi,lists,

I have a file looking as below:

<[EMAIL PROTECTED]> 145K179B  璧搴?
<[EMAIL PROTECTED]>171K122B  ���璇�
<[EMAIL PROTECTED]> 28K904B   ���K60830
<[EMAIL PROTECTED]> 243K600B  ��规�寮�?
<[EMAIL PROTECTED]>  178K626B  运筹学3
<[EMAIL PROTECTED]>743K348B  寮
<[EMAIL PROTECTED]>  182K406B  璧
<[EMAIL PROTECTED]> 43K393B   �浠�
<[EMAIL PROTECTED]> 249K335B  灞辫タ�ラ��璧���?


as you see, the third column is coding with utf8,so it can't print
output correctly on my screen.I have try these methods:

binmode(STDOUT, ":encoding(gbk)");

or
binmode(STDOUT, ":encoding(gb2312)");

or
use Encode;
$subject = encode("gb2312", $subject);

or
use Encode;
$subject = encode("gbk", $subject);

but all these ways can't work correctly for me.
Can anyone here help me?Thanks a lot.


Re: how to hide passwd from INPUT

2005-11-29 Thread Jennifer Garner


Thanks for John and all.

On Tue, Nov 29, 2005 at 10:53 PM, John Doe wrote:


Jennifer Garner am Dienstag, 29. November 2005 15.40:

HI,Lists,

Sorry, this time I can't login into my primary mailbox of 30gigs.So I
change another email for this question.

When I get something from input such as:

my $passwd=;

the password typed on screen is clear plain text.How can I get it 
input

as hide type such as ***?Thanks.


perldoc -q password
=>
"How do I ask the user for a password?"
"...
   use Term::ReadKey;

   ReadMode('noecho');
   $password = ReadLine(0);
..."

I would add a
ReadMode('normal');

otherwise your terminal could stay in noecho mode.

hth, joe

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 





--
Sent using Laszlo Mail. Try it yourself.
http://www.laszlomail.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net



Charles K. Clarkson wrote:


JupiterHost.Net  wrote:
 
: Thanks for catching my misstatement :)


Thanks for finally making one. :)


No I make mistakes all the time, no doubt :)


: #!/usr/bin/perl
: 
: use strict;

: use warnings;
: 
: open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
: 
: open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";

: my @match_list = <$file2_fh>;
: close $file2_fh;
: 
: while(<$file1_fh>) {

:  my $line = $_;
:  chomp $line;
: 
:  for my $match_against (@match_list) {

:  chomp $match_against;
:  print "Got the string\n" if $line =~ m{$match_against}xms;
:  }
: }
: 
: close $file1_fh;


Yes, this is the option the OP chose in a message up thread
from here.


Gotcha, thats what I get basing my code off theirs without reading the 
intention :)



The only thing I would change is the repeated chomping of
the matches. 


Tur I do liek the chomp() once you did below, shame on me for not doing 
that :)


> On second thought I'll also complain about that

5-space initial indent. :)


That had to be the mail clients, I'm a strict 4 spacer :)


open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
chomp( my @match_list = <$file2_fh> );
close $file2_fh;

.
.
.

 for my $match_against (@match_list) {
 print "Got the string\n" if $line =~ m{$match_against}xms;
 }

Why the {}xms options on the regex? We aren't messing with $/,
so there shouldn't be any multi-line problems. Is it just a
precaution or is their some other reason?

Christmas*, perhaps? :)


Heheh, no just habit from the "Perl Best Practices" book. (*Excelletn* 
book by Damian Conway)



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net  wrote:
 
: Thanks for catching my misstatement :)

Thanks for finally making one. :)


: #!/usr/bin/perl
: 
: use strict;
: use warnings;
: 
: open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
: 
: open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
: my @match_list = <$file2_fh>;
: close $file2_fh;
: 
: while(<$file1_fh>) {
:  my $line = $_;
:  chomp $line;
: 
:  for my $match_against (@match_list) {
:  chomp $match_against;
:  print "Got the string\n" if $line =~ m{$match_against}xms;
:  }
: }
: 
: close $file1_fh;

Yes, this is the option the OP chose in a message up thread
from here.

The only thing I would change is the repeated chomping of
the matches. On second thought I'll also complain about that 
5-space initial indent. :)

open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
chomp( my @match_list = <$file2_fh> );
close $file2_fh;

.
.
.

 for my $match_against (@match_list) {
 print "Got the string\n" if $line =~ m{$match_against}xms;
 }

Why the {}xms options on the regex? We aren't messing with $/,
so there shouldn't be any multi-line problems. Is it just a
precaution or is their some other reason?

Christmas*, perhaps? :)


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


* Christmas is sometimes referred to as "Xmas" in my country.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: the time a program runs

2005-11-29 Thread Scott R. Godin

Octavian Rasnita wrote:

Hi,

I have tried to find out the time a perl program runs, and I have used:

#at the start of the program:
my $begin = (times)[0];
my $begin_t = time();

... The program follows

# at the end of the program:
my $end = (times)[0] - $begin;
my $end_t = time() - $begin_t;
print "end: $end\nEnd_t: $end_t\n";

After running the program, it prints:

end: 4.953
End_t: 19

Why does this difference appear?


The program is a very short one, for testing the speed of Storable module.

Thank you.

Teddy




This is a rather old post, but you might also look at a module I wrote a while 
ago, Time::Elapse on CPAN.


http://search.cpan.org/~sgodin/Time-Elapse-1.2402/

You may find it useful in the future.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net



Charles K. Clarkson wrote:


JupiterHost.Net  wrote:

: This will open both files and check each line of file2 against
: each line of file1 (and it alerts you to any problems, is easier
: to read, best pratice safe (hopefully ;p), ect etc):

Sorry, but it won't. It will open both files and check the
first line of file1 against all the lines of file2. All the rest
of the lines in file1 are not tested. The inner loop only runs
once. The pointer into file2 is never set back to the file start.


Good point :)

Perhaps I should have worded it "this does the same thgin you were doing 
in your example" :)


If file1 has:
1
2
3
4
and file2 has:
a
b
c
d
then the output of:

#!/usr/bin/perl

use strict;
use warnings;

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";

while(<$file1_fh>) {
my $line = $_;
chomp $line;
print "File 1 $line\n";
while(<$file2_fh>) {
my $match_against = $_;
chomp $match_against;
print "\tFile 2 $match_against\n";
# print "Got the string\n" if $line =~ m{$match_against}xms;
}
}

close $file1_fh;
close $file2_fh;

is:
File 1 1
File 2 a
File 2 b
File 2 c
File 2 d
File 1 2
File 1 3
File 1 4


But if you do it liek so:


#!/usr/bin/perl

use strict;
use warnings;

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";

my @match_list = <$file2_fh>;
close $file2_fh;

while(<$file1_fh>) {
my $line = $_;
chomp $line;
print "File 1 $line\n";
for my $match_against (@match_list) {
chomp $match_against;
print "\tFile 2 $match_against\n";
# print "Got the string\n" if $line =~ m{$match_against}xms;
}
}

close $file1_fh;

then the output is:

File 1 1
File 2 a
File 2 b
File 2 c
File 2 d
File 1 2
File 2 a
File 2 b
File 2 c
File 2 d
File 1 3
File 2 a
File 2 b
File 2 c
File 2 d
File 1 4
File 2 a
File 2 b
File 2 c
File 2 d

Thanks for catching my misstatement :)

So this will do what I originally said (IE instead of copying the 
original example I commented on):


#!/usr/bin/perl

use strict;
use warnings;

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";

open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
my @match_list = <$file2_fh>;
close $file2_fh;

while(<$file1_fh>) {
my $line = $_;
chomp $line;

for my $match_against (@match_list) {
chomp $match_against;
print "Got the string\n" if $line =~ m{$match_against}xms;
}
}

close $file1_fh;


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: formatting text

2005-11-29 Thread Brano Gerzo
Ing. Branislav Gerzo [IBG], on Tuesday, November 29, 2005 at 17:14
(+0100) wrote:


IBG> And I'd like to print:
IBG> |Name: Branislav  |
IBG> |Surname.: Gerzo  |
IBG>   26.^ 80.^

Nothing is tricky, if man want. So:

sub formie {
  print form 
  '|{<<}: {[[[} 
  |',
  {rfill=>'.'}, shift,   {rfill=>' '},  shift;  
}


-- 

 ...m8s, cu l8r, Brano.

[Don't bother with the shrimp baby, daddy's comin' home with the crabs!]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: You've read the Llama, now what?

2005-11-29 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz  writes:

Randal> Randal L. Schwartz Perl's of Wisdom, from Apress.

And I can't believe I just wrote "Perl's" instead of "Perls". :)

"Caffiene! Work! Now!"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




HTML::Parser Tutorial

2005-11-29 Thread Mandar Rahurkar
Hi,
Is anyone familiar with a doos tutorial on HTML::Parser module ?

Thanks,
Mandar

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: You've read the Llama, now what?

2005-11-29 Thread Randal L. Schwartz
> "Tom" == Tom Yarrish <[EMAIL PROTECTED]> writes:

Tom> No I haven't read that one yet.  I actually forgot about that one
Tom> until I heard your Perlcast interview over the weekend. ;)
Tom> Speaking of which, during the interview you mentioned a book that
Tom> contains all the articles you've writting over the years.  Is that
Tom> book out or are you still working on it?  I looked at O'Reilly's site
Tom> and didn't see it listed there.

Randal L. Schwartz Perl's of Wisdom, from Apress.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
 http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net  wrote:

: This will open both files and check each line of file2 against
: each line of file1 (and it alerts you to any problems, is easier
: to read, best pratice safe (hopefully ;p), ect etc):

Sorry, but it won't. It will open both files and check the
first line of file1 against all the lines of file2. All the rest
of the lines in file1 are not tested. The inner loop only runs
once. The pointer into file2 is never set back to the file start.

We can test it with this. If each file has four lines in it,
we should see this result.

1234
1234
1234
1234

my $i;
while(<$file1_fh>) {

 while(<$file2_fh>) {
print ++$i; 
 }
 print "\n";
}


: #!/usr/bin/perl
: 
: use strict;
: use warnings;
: 
: open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
: open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
: 
: while(<$file1_fh>) {
:  my $line = $_;
:  chomp $line;
: 
:  while(<$file2_fh>) {
:  my $match_against = $_;
:  chomp $match_against;
: 
:  print "Got the string\n" if $line =~ m{$match_against}xms;
:  }
: }
: 
: close $file1_fh;
: close $file2_fh;

HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12
(-0500 (EST)) wrote the following:

Jeff, Perl6::Form is so powerful. But I can't find how to properly do
this:

I have values:
('Name','Branislav');
('Surname','Gerzo');

And I'd like to print:
|Name: Branislav  |
|Surname.: Gerzo  |
  26.^ 80.^
   
Could you please help me with this one ? Other I need I already got,
but this one seems tricky for me.

Thanks.

-- 

How do you protect mail on web? I use http://www.2pu.net

[I wanna get my kicks now before I go.]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net


This will open both files and check each line of file2 against each line 
of file1 (and it alerts you to any problems, is easier to read, best 
pratice safe (hopefully ;p), ect etc):


#!/usr/bin/perl

use strict;
use warnings;

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";

while(<$file1_fh) {


He he, whups :) make that
  while(<$file1_fh>) {


my $line = $_;
chomp $line;

while(<$file2_fh>) {
my $match_against = $_;
chomp $match_against;

print "Got the string\n" if $line =~ m{$match_against}xms;
}
}

close $file1_fh;
close $file2_fh;



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to hide passwd from INPUT

2005-11-29 Thread John Doe
Jennifer Garner am Dienstag, 29. November 2005 15.40:
> HI,Lists,
>
> Sorry, this time I can't login into my primary mailbox of 30gigs.So I
> change another email for this question.
>
> When I get something from input such as:
>
> my $passwd=;
>
> the password typed on screen is clear plain text.How can I get it input
> as hide type such as ***?Thanks.

perldoc -q password 

=> 

"How do I ask the user for a password?"
"...
   use Term::ReadKey;

   ReadMode('noecho');
   $password = ReadLine(0);
..."

I would add a 

ReadMode('normal');

otherwise your terminal could stay in noecho mode.

hth, joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to hide passwd from INPUT

2005-11-29 Thread Xavier Noria

On Nov 29, 2005, at 15:40, Jennifer Garner wrote:


HI,Lists,

Sorry, this time I can't login into my primary mailbox of 30gigs.So  
I change another email for this question.


When I get something from input such as:

my $passwd=;

the password typed on screen is clear plain text.How can I get it  
input as hide type such as ***?Thanks.


Some modules provide that, for instance IO::Prompt.

-- fxn


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




how to hide passwd from INPUT

2005-11-29 Thread Jennifer Garner

HI,Lists,

Sorry, this time I can't login into my primary mailbox of 30gigs.So I 
change another email for this question.


When I get something from input such as:

my $passwd=;

the password typed on screen is clear plain text.How can I get it input 
as hide type such as ***?Thanks.



---
 Jennifer

--
Sent using Laszlo Mail. Try it yourself.
http://www.laszlomail.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread Dr.Ruud
Muthukumar:


Always put these lines on top:

  use strict;
  use warnings;


>$var=~chomp($var);

  perldoc -f chomp

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12
(-0500 (EST)) thoughtfully wrote the following:

>> I'd like to know if there is module for following:
JP> Yes, Perl6::Form.  It's a Perl 5 implementation of Perl 6's formats.

sometime is better ask, than DIY. Thanks a lot Japhy, this is exactly
what I'm looking for!

Thanks, thanks and again: thanks.

-- 

How do you protect mail on web? I use http://www.2pu.net

[Windows: At least the disks make nice drink coasters]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: formatting text

2005-11-29 Thread Jeff 'japhy' Pinyan

On Nov 29, Ing. Branislav Gerzo said:


I'd like to know if there is module for following:


Yes, Perl6::Form.  It's a Perl 5 implementation of Perl 6's formats.


112
12345678901234567890
=== OUT ===
| This is just |
| small sentence   |
| about nothing.   |
=== OUT ===

So, I'd like to define "|" as start and as end, word-wrapped text,
and length of line is lets say "20" chars.


You could use Perl 5's formats, but they're ugly to work with. 
Perl6::Form presents them in a simpler and better fashion.


  use Perl6::Form;

  print form
"| {} |",
   $string
  ;

does what you want.  See the module's documentation for details.

You'll have to download the module from CPAN, since I highly doubt you 
already have it.


--
Jeff "japhy" Pinyan%  How can we ever be the sold short or
RPI Acacia Brother #734%  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %-- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net



Muthukumar wrote:

On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote:


Sorry i am passing the OPEN as
Open (FILE1,"




Use like this:


No, like this:

use strict;
use warnings;
Always do that, especially when posting code to this list.


open FD, "< file1";
open FD1, "< file2";


Is it even open?

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";


while ()
{
  $line1=chomp($_); # chomp() Needed


No no no, $Line1 is now a number:

perldoc -f chomp

 "It returns the total number of characters removed from all its 
arguments."



  while ()
  {
$line = chomp($_); # chomp() Needed


again, nope...


if ($line =~ /.*$line1.*/) # (.*)Not needed
{
  print "Got the String\n";
}

  }
}
Revert on having more queries.


This will open both files and check each line of file2 against each line 
of file1 (and it alerts you to any problems, is easier to read, best 
pratice safe (hopefully ;p), ect etc):


#!/usr/bin/perl

use strict;
use warnings;

open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";

while(<$file1_fh) {
my $line = $_;
chomp $line;

while(<$file2_fh>) {
my $match_against = $_;
chomp $match_against;

print "Got the string\n" if $line =~ m{$match_against}xms;
}
}

close $file1_fh;
close $file2_fh;

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Hello all,

I'd like to know if there is module for following:

We have text:
=== IN ===
This is just small sentence about nothing.
=== IN ===

And I like to format it as follows:
 112
12345678901234567890
=== OUT ===
| This is just |
| small sentence   |
| about nothing.   |
=== OUT ===

So, I'd like to define "|" as start and as end, word-wrapped text,
and length of line is lets say "20" chars.

I looked into Text::Format module, but it has different functions...
If there is a such a module, it is ok, if not, I will write something
myself, but don't like to reinventing wheel.

Thanks a lot.

/brano


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Re: how to get file's creation time

2005-11-29 Thread Jennifer Garner

Thanks for Schwartz and Jay.I have known something from your words.

On 28 Nov 2005 08:48:28 -0800, merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>> "Jay" == Jay Savage <[EMAIL PROTECTED]> writes:
> 
> Jay> It depends on what you mean by "creation". stat() on POSIXish systems
> Jay> returns ctime, which is the inode creation time,
> 
> Nope.  Inode *change* time.  Will update any time you write to the
> file, or change any metadata (owner, permissions, number of links
> [including renaming], other timestamps).
> 
> Jay>  which is the time the
> Jay> physical location on disk was first written to (actually, these days
> Jay> it's the time the vnode was fist written to, but you don't really
> care
> Jay> that much about disk geometry, do you?). The time will not be
> Jay> preserved across relocations (i.e. mv and cp will destroy it),
> Jay> although many archivers reinstate the file's original ctime when
> files
> Jay> are restored from backup.
> 
> This is not possible at a user-level.  You can set atime and mtime from
> a system call, but not ctime.  ctime is always set to "now".
> 
> Jay>  For most applications, though, "when this
> Jay> particular disk space was reserved for data" is an effective synonym
> Jay> for "when this file was created. When you start moving files around,
> Jay> the questions merlyn raises become much more important.
> 
> Jay> For the record, Kirk McKusick--one of the original implemetors of
> Jay> UFS/FFS and the creator of UFS2--tells the story a little
> differently.
> Jay>  According to him, the FFS originally intended to use ctime as the
> Jay> creation time, but they discovered that dump needed a record of inode
> Jay> creation to make incrimental backups effectively. In fact, UFS2
> Jay> includes a btime (call it "birth time" if you want) field that is
> Jay> stable across inode relocations when the system uses btime aware file
> Jay> system operations. I don't know, though, if the Perl team has plans
> to
> Jay> update stat() to support it on systems where it is available.
> 
> Jay> Of course, that isn't completely at odds with merlyn's comments: the
> Jay> original unix developers started implementing file systems a decade
> Jay> before Berkely started work on FFS.
> 
> And, the whole notion of "creation time" doesn't make sense in the
> first place.  If I add a word, is it a new file, or an old file?  If I
> gut the entire contents, replace it with entirely new contents, is it
> new or old?  What if I rename it?  Is it new, or old?  There are no
> consistent answers to any of those questions, so why bother?
> 
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
>  http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Charles K. Clarkson  wrote:
: 
: chomp( my @pix = <$fh );

Darn!

chomp( my @pix = <$fh> );


Move along now. :)





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar  wrote:

: May be it will work:
:
:
: open FD, "< pixconfig.txt";
: open FD1, "< ip.log";
:
: @arr=;

We need to know more about file size and memory to make this
determination. Assuming you are correct about the file and memory
size, your algorithm looks fine. You just need to learn more perl
to make it work.

I think better to keep files open for the shortest time
possible, especially if this script might have several instances
running at once. It is a good practice to check I/O operations for
success.

my $file = 'pixconfig.txt';
open my $fh, '<', $file or die qq(Cannot open "$file": $!);

chomp( my @pix = <$fh );

close $fh or die qq(Cannot close "$file": $!);

You can read more about chomp in the perlfunc file or by using
perldoc from a command line (DOS box).

perldoc -f chomp


Since I introduced lexical variables above let me set you
straight about all these symbol table polluting variables you are
throwing around. *Don't use them*. Start even the smallest scripts
you write with these lines.

use strict;
use warnings;

For details:

perldoc strict
perldoc warnings

So far we have this.

#!/usr/bin/perl

use strict;
use warnings;

my $file = 'pixconfig.txt';
open my $fh, '<', $file or die qq(Cannot open "$file": $!);

chomp( my @pix = <$fh> );

close $fh or die qq(Cannot close "$file": $!);


: while ()
: {
:  foreach $var (@arr)
:  {
:$var=~chomp($var);
:# print "Check" . $var . "<==>".  $_;
:if ( $_ =~ /.*$var.*/ )
:{
:  print $_;
:}
:  }
: }


$file = 'ip.log';
open $fh, '<', $file or die qq(Cannot open "$file": $!);

while ( my $ip = <$fh> ) {

foreach my $pic ( @pix ) {
next unless $ip =~ /\Q$pic\E/;
print $ip;
}

}

close $fh or die qq(Cannot close "$file": $!);

__END__

While this is not the most optimal solution, it is easy to
read and to maintain. If ip.log is very long, another, more
advanced, solution is needed, but it would also require a more
intimate knowledge of the data.

HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Charles K. Clarkson <[EMAIL PROTECTED]> wrote:
>
> Muthukumar  wrote:
>
>
>No, I don't think so.
>
>Let's test it. We'll assume that  has 3 lines in it.
> On the first pass of the outer loop we load the first value
> from "file1." We then compare it to each value in "file2."
> Fine so far.
>
> On the second pass of the outer loop we load the second
> value from "file1." But FD1 is at the end of the file, so
> there is nothing to compare the second value to.
>
> On the third pass of the outer loop we load the third
> value from "file1." But FD1 is at the end of the file, so
> there is nothing to compare the third value to.
>
>This algorithm is fundamentally flawed.
>
>
>
> You are correct. Thanks for notifying the error(s).

May be it will work:


open FD, "< pixconfig.txt";
open FD1, "< ip.log";

@arr=;

while ()
{
 foreach $var (@arr)
 {
   $var=~chomp($var);
   # print "Check" . $var . "<==>".  $_;
   if ( $_ =~ /.*$var.*/ )
   {
 print $_;
   }
 }
}
# END

when,

pixconfig.txt is containing only one word for pattern matching.



--
--
Mail: [EMAIL PROTECTED] | www: http://geocities.com/kmuthu_gct/


Re: help about regex matching

2005-11-29 Thread Jeff Pang
oh,I see it finally.Thanks for everyone!

2005/11/29, John W. Krahn <[EMAIL PROTECTED]>:
> Jeff Pang wrote:
> > yes,John's code work well too.But I still don't know why this code
> > can't run correctly:
> >
> > next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s;
> >
> > When I run it,I get these results:
> >
> > 364 2.168.2.20
> > 286.4   2.168.2.21
> > 264.4   2.168.2.22
> > 138 2.168.2.23
> > 562.3   2.168.2.24
> > 80.72.168.2.25
> > 355 2.168.2.26
> > 266.5   2.168.2.27
> > 327 2.168.2.28
> >
> >
> > somethings as '19' have lost.
>
> That is because .* is greedy and will match everything to the end of the
> string and then backtrack until (\d+\.\d+\.\d+\.\d+) matches which specifies
> that the first \d+ only has to match at least one digit.
>
> Since the two fields start and end with digits you could do this instead:
>
> next unless /([\d.]+)\D+(\d+\.\d+\.\d+\.\d+)/;
>
>
> John
> --
> use Perl;
> program
> fulfillment
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Xavier Noria

On Nov 29, 2005, at 10:42, Bedanta Bordoloi, Gurgaon wrote:

No, $log_entry[0] holds a string, and we are getting the error as  
** is a

part of that string.


Interpolation in regexps is done before the regexp is interpreted as  
such. For instance, if $foo is "*" and we have


/.*$foo/

first interpolation is done giving

/.**/

and that is interpreted as a regexp, which in this case is invalid  
and would raise an error.


In consequence, metacharacters in interpolated strings need to be  
escaped to be treated literally, and this is easy to get:


$str =~ s/(^\Q$log_entry[0]\E\s)//i

There we start escaping with \Q, and end it with \E, so that "\s)" is  
interpreted as part of the regexp as is. If you wanted to escape the  
very string outside the regexp there's quotemeta().


-- fxn

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
Thanks, John for that, it works fine now...

Bedanta

-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 29, 2005 3:25 PM
To: Perl Beginners
Subject: Re: Error : Nested quantifiers before HERE mark in regex

Bedanta Bordoloi, Gurgaon wrote:
> Hi All,

Hello,

> I'm using the following regex in my code with processes a log file
>   
>   $str =~ s/(^$log_entry[0]\s)//i
> 
> But I'm getting the following error on running the script:
> 
> Nested quantifiers before HERE mark in regex m/(^img13.** << HERE **\s)/
> 
> Can the regex be written in some other way? Please help.

$str =~ s/(^\Q$log_entry[0]\E\s)//i



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread John W. Krahn
Bedanta Bordoloi, Gurgaon wrote:
> Hi All,

Hello,

> I'm using the following regex in my code with processes a log file
>   
>   $str =~ s/(^$log_entry[0]\s)//i
> 
> But I'm getting the following error on running the script:
> 
> Nested quantifiers before HERE mark in regex m/(^img13.** << HERE **\s)/
> 
> Can the regex be written in some other way? Please help.

$str =~ s/(^\Q$log_entry[0]\E\s)//i



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote:
> yes,John's code work well too.But I still don't know why this code
> can't run correctly:
> 
> next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s;
> 
> When I run it,I get these results:
> 
> 364 2.168.2.20
> 286.4   2.168.2.21
> 264.4   2.168.2.22
> 138 2.168.2.23
> 562.3   2.168.2.24
> 80.72.168.2.25
> 355 2.168.2.26
> 266.5   2.168.2.27
> 327 2.168.2.28
> 
> 
> somethings as '19' have lost.

That is because .* is greedy and will match everything to the end of the
string and then backtrack until (\d+\.\d+\.\d+\.\d+) matches which specifies
that the first \d+ only has to match at least one digit.

Since the two fields start and end with digits you could do this instead:

next unless /([\d.]+)\D+(\d+\.\d+\.\d+\.\d+)/;


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Pant, Hridyesh  wrote:

: Why are u using this.
: local $/ = "\n\n";

Because I'm cocky! :)


$/ is a special perl variable which is used to define the
input record separator. It is set to "\n" as a default. By
resetting it to "\n\n", I was able to get two lines at a time.
This is because Jeff's data looked like this:

356.5
192.168.2.20

283.3
192.168.2.21

261.9
192.168.2.22

Another way look at that is like this.

356.5\n192.168.2.20\n\n283.3\n192.168.2.21\n\n261.9\n192.168.2.22\n\n

If we tell perl that the input record separator is "\n\n", we
end up with these values as we loop through the file.

356.5\n192.168.2.20\n\n
283.3\n192.168.2.21\n\n
261.9\n192.168.2.22\n\n

"chomp" uses the input record separator also. So chomping
these values gives us this.

356.5\n192.168.2.20
283.3\n192.168.2.21
261.9\n192.168.2.22


I didn't have to use m// to split these, but Jeff was set on
it. "split" would also work. (It works on "$_" by default.)

use strict;
use warnings;

local $/ = "\n\n";
while (  ) {
chomp;
printf "%-5s% 15s\n", split "\n";
}

__END__

For clarity, that is logically the same as this.

local $/ = "\n\n";
while ( defined $_ =  ) {
chomp $_;
printf "%-5s% 15s\n", split "\n", $_;
}

__END__


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
No, $log_entry[0] holds a string, and we are getting the error as ** is a
part of that string.

Bedanta

-Original Message-
From: Xavier Noria [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 29, 2005 3:08 PM
To: beginners perl
Subject: Re: Error : Nested quantifiers before HERE mark in regex

On Nov 29, 2005, at 10:22, Bedanta Bordoloi, Gurgaon wrote:

> Hi All,
>
> I'm using the following regex in my code with processes a log file
>   
>   $str =~ s/(^$log_entry[0]\s)//i
>
> But I'm getting the following error on running the script:
>
> Nested quantifiers before HERE mark in regex m/(^img13.** << HERE ** 
> \s)/

Is $log_entry[0] supposed to be a regexp?

-- fxn


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Xavier Noria

On Nov 29, 2005, at 10:22, Bedanta Bordoloi, Gurgaon wrote:


Hi All,

I'm using the following regex in my code with processes a log file

$str =~ s/(^$log_entry[0]\s)//i

But I'm getting the following error on running the script:

Nested quantifiers before HERE mark in regex m/(^img13.** << HERE ** 
\s)/


Is $log_entry[0] supposed to be a regexp?

-- fxn


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar  wrote:


No, I don't think so.

Let's test it. We'll assume that  has 3 lines in it.
On the first pass of the outer loop we load the first value
from "file1." We then compare it to each value in "file2."
Fine so far.

 On the second pass of the outer loop we load the second
value from "file1." But FD1 is at the end of the file, so
there is nothing to compare the second value to.

 On the third pass of the outer loop we load the third
value from "file1." But FD1 is at the end of the file, so
there is nothing to compare the third value to.

This algorithm is fundamentally flawed.


 
: while ()
: {
:   $line1=chomp($_); # chomp() Needed
: 
:   while ()
:   {
: $line = chomp($_); # chomp() Needed
: if ($line =~ /.*$line1.*/) # (.*)Not needed
: {
:   print "Got the String\n";
: }
: 
:   }
: }
: Revert on having more queries.






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Ok Muthu,
 See there is a file called as pixconfig.txt which has the entries
such as
*PIX-4-106023*
 *PIX-4-101123*
*so on*

and there is one more file called ip.log which has the entries below,
Nov 29 10:03:24 10.20.1.2 Nov 29 2005 10:33:53: %*PIX-4-106023*: Deny tcp
src inside:Blackberry/3657 dst outside:102.112.149.73/445 by access-group
"inside"

i have to macth the bold characters written in the file so i use the below
code which is not working

Open (FILE1,">pixconfig.txt");
Open (FILE,">ip.log");

while ()
{
$line1 = $_; (Here i Get the *PIX-4-106023* entry from the file)
while ()
{
$line = $_;
if ($line =~ /(.*)$line1(.*)/)  (Here i have to check the
value which i get from a file but it is not searching)
{
 print "Got the String";
   }
 }
}

Please Help me out

regards
Mazhar



On 11/29/05, Muthukumar <[EMAIL PROTECTED]> wrote:
>
> Can you post your exact work around on this to help you! Post script and
> files and your requirement.
>
> Regards,
> -Muthu
>
>
> On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote:
> >
> > Muthu still the pattern does not match and it comes out of the loop
> >
> > Regards
> > Syed
> >
> >
>
>
>
> > --
> > Mail: [EMAIL PROTECTED] | www: http://geocities.com/kmuthu_gct/
> >
>


RE: help about regex matching

2005-11-29 Thread Pant, Hridyesh
Why are u using this.
local $/ = "\n\n";



-Original Message-
From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] 
Sent: 29 November 2005 13:43
To: 'Perl Beginners'
Subject: RE: help about regex matching


Jeff Pang  wrote:

: Thanks for Charles.That code can work well,but I still want
: to know how to do it with regex expression.

use strict;
use warnings;

local $/ = "\n\n";
while (  ) {
chomp;
printf "%-5s% 15s\n", /(.+)\n(.+)/;
}

__END__


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
Hi All,

I'm using the following regex in my code with processes a log file

$str =~ s/(^$log_entry[0]\s)//i

But I'm getting the following error on running the script:

Nested quantifiers before HERE mark in regex m/(^img13.** << HERE **\s)/

Can the regex be written in some other way? Please help.

Thanks,
Bedanta

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: help about regex matching

2005-11-29 Thread Jeff Pang
yes,John's code work well too.But I still don't know why this code
can't run correctly:

next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s;

When I run it,I get these results:

364 2.168.2.20
286.4   2.168.2.21
264.4   2.168.2.22
138 2.168.2.23
562.3   2.168.2.24
80.72.168.2.25
355 2.168.2.26
266.5   2.168.2.27
327 2.168.2.28


somethings as '19' have lost.

2005/11/29, John W. Krahn <[EMAIL PROTECTED]>:
> Jeff Pang wrote:
> > hi,list,
>
> Hello,
>
> > I have a file looking as below:
> >
> > 356.5
> > 192.168.2.20
> >
> > [snip]
> >
> > 612
> > 192.168.2.31
> >
> > ...
> >
> >
> > I want to get this result:
> >
> > 356.5 192.168.2.20
> > 283.3 192.168.2.21
> > 261.9 192.168.2.22
> > ...
> >
> >
> > and,I write this regex for matching:
> >
> > {
> > local $/="";
> > while ()
> > {
> > next unless /^(.+?)$(?=.*(\d+\.\d+\.\d+\.\d+))/sm;
> > print $1,"\t",$2,"\n";
> > }
> > }
> >
> > but it can't work correctly.
> > So,I want to know how to adjust this regex?Thanks.
>
> Probably something like this:
>
> {
>local $/ = '';
>while (  )
>{
>next unless /(\S+)\s+(\d+\.\d+\.\d+\.\d+)/;
>print "$1\t$2\n";
>}
> }
>
>
>
> John
> --
> use Perl;
> program
> fulfillment
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote:
> hi,list,

Hello,

> I have a file looking as below:
> 
> 356.5
> 192.168.2.20
> 
> [snip]
> 
> 612
> 192.168.2.31
> 
> ...
> 
> 
> I want to get this result:
> 
> 356.5 192.168.2.20
> 283.3 192.168.2.21
> 261.9 192.168.2.22
> ...
> 
> 
> and,I write this regex for matching:
> 
> {
> local $/="";
> while ()
> {
> next unless /^(.+?)$(?=.*(\d+\.\d+\.\d+\.\d+))/sm;
> print $1,"\t",$2,"\n";
> }
> }
> 
> but it can't work correctly.
> So,I want to know how to adjust this regex?Thanks.

Probably something like this:

{
local $/ = '';
while (  )
{
next unless /(\S+)\s+(\d+\.\d+\.\d+\.\d+)/;
print "$1\t$2\n";
}
}



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Thank You Every Body for the Help i am able to check the same.

regards
mazhar


On 11/29/05, Muthukumar <[EMAIL PROTECTED]> wrote:
>
>
>
> On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote:
> >
> > Sorry i am passing the OPEN as
> > Open (FILE1," > Open (FILE," >
> > Still the string is ot matching. Help me please
>
>
>
> Use like this:
>
>
> open FD, "< file1";
> open FD1, "< file2";
>
> while ()
> {
>   $line1=chomp($_); # chomp() Needed
>
>   while ()
>   {
> $line = chomp($_); # chomp() Needed
> if ($line =~ /.*$line1.*/) # (.*)Not needed
> {
>   print "Got the String\n";
> }
>
>   }
> }
> Revert on having more queries.
>
>


Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote:
>
> Sorry i am passing the OPEN as
> Open (FILE1," Open (FILE,"
> Still the string is ot matching. Help me please



Use like this:


open FD, "< file1";
open FD1, "< file2";

while ()
{
  $line1=chomp($_); # chomp() Needed

  while ()
  {
$line = chomp($_); # chomp() Needed
if ($line =~ /.*$line1.*/) # (.*)Not needed
{
  print "Got the String\n";
}

  }
}
Revert on having more queries.


Re: help about regex matching

2005-11-29 Thread Jeff Pang
It's ok now.Thanks very much.

2005/11/29, Charles K. Clarkson <[EMAIL PROTECTED]>:
> Jeff Pang  wrote:
>
> : Thanks for Charles.That code can work well,but I still want
> : to know how to do it with regex expression.
>
> use strict;
> use warnings;
>
> local $/ = "\n\n";
> while (  ) {
>chomp;
>printf "%-5s% 15s\n", /(.+)\n(.+)/;
> }
>
> __END__
>
>
> HTH,
>
> Charles K. Clarkson
> --
> Mobile Homes Specialist
> 254 968-8328
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Jeff Pang  wrote:

: Thanks for Charles.That code can work well,but I still want
: to know how to do it with regex expression.

use strict;
use warnings;

local $/ = "\n\n";
while (  ) {
chomp;
printf "%-5s% 15s\n", /(.+)\n(.+)/;
}

__END__


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]