Navigation |
syndicatorwhat is the expression mean?hi, I am reading the perl code of Blosxom, I can not quite catch the meaning of this expressiong: %month2num = (nil=>'00', Jan=>'01', Feb=>'02', Mar=>'03', Apr=>'04', May=>'05', Jun=>'06', Jul=>'07', Aug=>'08', Sep=>'09', Oct=>'10', Nov=>'11', Dec=>'12'); @num2month = sort { $month2num{$a} <=> $month2num{$b} } keys %month2num; dynamic scoped variables in the debuggerHi, I'm running Perl v5.8.8 compiled for linux. I was reading about the perl debugger and ran the following script with the command "perl -d": 1 #!/ usr/bin/perl 2 $_ = "foo"; 3 /foo/; 4 5 print "$&"; 6 print "\n"; As expected it prints "foo" before the newline, and if I check the value of $& in the debugger it does show "foo". However, if I omit line 5 of FAQ 3.1 How do I do (anything)?This is an excerpt from the latest version perlfaq3.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at [link] . FAQ 3.10 Is there an IDE or Windows Perl Editor?This is an excerpt from the latest version perlfaq3.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at [link] . How come? RE matches, but does not set $^RHi all, Assume the following REs: /(B(?:=c*))(?{'got B'})/ /(B(?:=c*)?)(?{'got B'})/ Both expressions match as expected (and set $1), BUT: the second one does n o t set $^R as it should do. However, if I say /(?>(B(?:=c+)?)(?{...})/ i.e. force Perl to eat up anything it matches, $^R is correctly set. FAQ 3.30 What's MakeMaker?This is an excerpt from the latest version perlfaq3.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at [link] . Why stdin lose after new ThreadHi When I create a new thread, the main thread cannot get input from <>. The code is like ------------------------------ ----------------- while ( $line = <STDIN> ) { chomp $line; execCmdLine($line); print "pp> "; ------------------------------ ------------------ In the execCmdLine function, if $line eq 'conn', a new thread is FAQ 4.37 What's wrong with always quoting "$vars"?This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at [link] . FAQ 4.20 How do I unescape a string?This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at [link] . How to match () pairsHi, I would like to match a pattern such as something( something_1( something_2( ... (something_n)...)something_els e_2)something_else_1) , where all the brackets pair up and there could be any number of pairs. something_1, something_2, ..., and something_n could contain '()' pair as well. I'm wondering if there is any way to do this with regex? |
SearchFree Online File ConvertersBrowse archivesRecent posts
|