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
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:/
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
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;
}
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:
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
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
月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
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