question regarding reference of a local variable

2006-02-02 Thread Pine Yan
Hi, what happens to the memory space with the following code: my @full_list = (); if (...) { my @tmp_list; @tmp_list = split(...); @full_list = (@full_list, [EMAIL PROTECTED]); } Here @tmp_list is a local variable and its definition terminates at the end of this code segment. Does this m

RE: LWP package problem

2005-11-17 Thread Pine Yan
D] Sent: Thursday, November 17, 2005 6:11 PM To: Pine Yan Cc: beginners@perl.org Subject: Re: LWP package problem On Nov 17, Pine Yan said: > #!/home/gnu/bin/perl > > use LWP; > > my $browser = LWP::UserAgent->new; > > my $url = 'http://www.google.com'; > > my

LWP package problem

2005-11-17 Thread Pine Yan
I have the following code: #!/home/gnu/bin/perl use LWP; my $browser = LWP::UserAgent->new; my $url = 'http://www.google.com'; my $response = $browser->get($url); die "Can't get $url -- ", $response->status_line unless $response->is_success; print "Content: $response->content_type"; print "-

regular expression match problem

2005-10-25 Thread Pine Yan
This is a segment of code to do string search: my $email = "\pineyan"; my $name = "\\pine"; if($email =~ /($name)/) { print "Found my name: $name!\n"; } and I got the following error when running: Can't find unicode character property definition via main->i or i.pl at unicode/I

list operators (rightward)

2005-08-19 Thread Pine Yan
I saw there two sections in perl reference mention about list operators. http://perldoc.perl.org/perlop.html First one is Terms and List Operators (Leftward) and second one is List Operators (Rightward) I don't quite get what it want to tell very well. Looks like the first one discusses case

RE: regular expression match question

2005-07-29 Thread Pine Yan
No more questions. :D Sincerely Pine -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: regular expression match question

2005-07-29 Thread Pine Yan
-Original Message- From: Tom Allison [mailto:[EMAIL PROTECTED] Sent: Friday, July 29, 2005 3:23 PM To: beginners@perl.org Subject: Re: regular expression match question Pine Yan wrote: > A script like this: > > line1: $string3 = "bacdeabcdefghijklabcdeabcdefghij

RE: regular expression match question

2005-07-29 Thread Pine Yan
> >The regex /[ab]*/ on the string "bad" matches 'ba' because regexes are >greedy by default. They want to match as MUCH as they can. > >BUT regexes also try to find the earliest match in the string. This is >why /[ab]*/ on the string "cab" matches ''. Because the engine found a >successful m

RE: regular expression match question

2005-07-29 Thread Pine Yan
>> line1: $string3 = "bacdeabcdefghijklabcdeabcdefghijkl"; >> line2: $string4 = "xxyyzzbatttvv"; >> >> line3: print "\$1 = $1 [EMAIL PROTECTED],$+[0]}, \$& = $&\n" >> if($string3 >> =~ /(a|b)*/); >> line4: print "\$1 = $1 [EMAIL PROTECTED],$+[0]}, \$& = $&\n" >> if($stri

regular expression match question

2005-07-29 Thread Pine Yan
A script like this: line1: $string3 = "bacdeabcdefghijklabcdeabcdefghijkl"; line2: $string4 = "xxyyzzbatttvv"; line3: print "\$1 = $1 [EMAIL PROTECTED],$+[0]}, \$& = $&\n" if($string3 =~ /(a|b)*/); line4: print "\$1 = $1 [EMAIL PROTECTED],$+[0]}, \$& = $&\n"