RE: regex puzzle

2005-07-29 Thread bingfeng zhao
Oh, bug,it should be use warnings; use strict; my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" ); for (@address) { print "\"$_\" is valid. \n" if /^((http|ftp):\/\/)?.+$/; } |-Original Mess

regex puzzle

2005-07-28 Thread bingfeng zhao
See following sample code: use warnings; use strict; my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" ); for (@address) { print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/; } the running result is: "http://test"; is valid. "http://"; is valid. "www" is valid. "ftp:/

is there a simple way get the current line number of processed file?

2005-05-26 Thread bingfeng zhao
To parse a regular text file, I should report the line number of parsed file when error occured. I want to know whether perl provide a shortcut way or magic '$?' indicate this. I must counting myself if not.   Thanks in advance     smime.p7s Description: S/MIME cryptographic signature

open file failed

2005-05-25 Thread bingfeng zhao
Good morning, afternoon, evening for perl enthusiasts of all over the world:)   On RedHat Linux, the perl complain "Inappropriate ioctl for device" when I use the following code to open a file: my $file = "./abc"; if ( open FN, $file ) {     print "Cannot open the file: $!\n"; next; }

答复: 答复: Can erpl support recursice call?

2005-05-23 Thread bingfeng zhao
e. In each call, the opened file is nor the same one. |-邮件原件- |发件人: John Doe [mailto:[EMAIL PROTECTED] |发送时间: 2005年5月23日 15:53 |收件人: beginners@perl.org |主题: Re: ´ð¸´: Can erpl support recursice call? | |Am Montag, 23. Mai 2005 08.57 schrieb Xavier Noria: |> On May 23, 2005, at 7:

答复: 答复: Can erpl support recursice call?

2005-05-23 Thread bingfeng zhao
ort recursice call? | |On May 23, 2005, at 7:24, bingfeng zhao wrote: | |> I'm sorry I may misled by the question. the real qurstion I |met is not |> recursicve but another one involve recursive. |> |> In the sub, I open a file and then call the same sub recursively. |> Of co

答复: Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
I'm sorry I may misled by the question. the real qurstion I met is not recursicve but another one involve recursive. In the sub, I open a file and then call the same sub recursively. Of cource, the recursive call will open another file also. when the flow return from recursive call, the file handl

答复: Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
月23日 12:43 |收件人: beginners@perl.org |主题: Re: Can erpl support recursice call? | |Am Montag, 23. Mai 2005 05.54 schrieb bingfeng zhao: |> Hi, everyone, |> I want know whether perl support recursive sub routine call? |[..] | |Hi, | |It does: | |perl -le' |use warnings; use strict; |sub recur

Can erpl support recursice call?

2005-05-22 Thread bingfeng zhao
Hi, everyone, I want know whether perl support recursive sub routine call? if not, how I can meet this requirement?   thanks in advance.   Best regards, - TOPSEC, THE FIRS