Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
diff -uP null/com xxx/com --- null/com Thu Jan 1 01:00:00 1970 +++ xxx/com Sun Mar 2 18:51:51 2003 @@ -0,0 +1,12 @@ + 507 debugperl -DptT -we 'require "t.pl"' -Mwr=t.pl 2>&1|cat >ptT + 508 debugperl -DpT -we 'require "t.pl"' -Mwr=t.pl 2>&1|cat >pT + 509 grep -v '^\(' ptT|less + 510 grep -v '^(' ptT|less + 511 less pT + 512 grep -v '^(' ptT|diff - pT|less + 513 grep -v '^(' ptT|diff pT - |less + 514 man diff + 515 grep -v '^(' ptT|diff -yu pT - |less + 516 grep -v '^(' ptT|diff -y pT - |less + 517 grep -v '^(' ptT|diff -y pT - |less>err + 518 history>com diff -uP null/t.pl xxx/t.pl --- null/t.pl Thu Jan 1 01:00:00 1970 +++ xxx/t.pl Fri Feb 28 10:10:03 2003 @@ -0,0 +1,11 @@ +'dudu' +<HTML> +<HEAD> + <TITLE>Testseite</TITLE> +</HEAD> +<BODY> + TesT!!Test!TEST!!${u} +</BODY> +$@; +</HTML> +</HTML> diff -uP null/wr.pm xxx/wr.pm --- null/wr.pm Thu Jan 1 01:00:00 1970 +++ xxx/wr.pm Fri Feb 28 13:36:06 2003 @@ -0,0 +1,66 @@ +package wr; +sub import{ + shift; + my $sub=shift; + if(ref$sub){ + $@='@'; + print $sub->()."</HTML>\n"; + }else{ + unshift @::INC,($sub=[sub{ + #print @_; + my $me=shift;#print @$me; + my $file=shift; + return if $file ne $me->[1]; + my $ret=""; + for my $p (@::INC){ + $ret=1,next if$p eq$me; + next unless $ret; + my$et; + open $et,"<","$p/$file" and $ret=$et,last;#print "$p/$file$! +\n"; + }#print"---$!",$ret; + return unless ref$ret;#print "+++$file"; + return(sub{ + my $m=$_[1]; + return 0 unless defined $m->[1]; + my$c=3; + while(length($_=$m->[1])||$c--){ + my $n=$_[0]; + my $r=$m->[3]->($m->[4]); + if($n){ + if($n<=length){ + $n=substr$_,0,$n; + $_=substr$_,length$n; + ($_,$n)=($n,$_); + $m->[1]=$n;print"§"; + return length; + } + }else{ + if($n=1+index($_,"\n")){ + $n=substr$_,0,$n; + $_=substr$_,length$n; + ($_,$n)=($n,$_); + $m->[1]=$n;print; + return length; + } + } + undef$m->[0]unless ref$r; + $m->[2]=~s/($r)//; + $m->[1].=$1; + next if length $1; + return 0 unless$n=$m->[0]; + $m->[2].=<$n>; + } + return 0; + },[$ret,'use '.__PACKAGE__. + ' sub{package al;<<"</HTML>"},','',$me->[2]]) + },$sub,sub{local$;='$;';s{^(</HTML>)$}{$1\n;return$;;\n}#and retu +rn'${' + ;return qr/([^\\\$@]|[a]|\$([@"]|\{[a-zA-Z0-9]+\}))*/m +s;}]); + return $sub; + } +} +1; + + + + +
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ref in @INC and debugging
by IlyaM (Parson) on Mar 07, 2003 at 17:04 UTC | |
by Anonymous Monk on Mar 07, 2003 at 17:49 UTC | |
by dragonchild (Archbishop) on Mar 07, 2003 at 18:57 UTC | |
by Anonymous Monk on Mar 07, 2003 at 19:05 UTC | |
|
Re: ref in @INC and debugging
by robartes (Priest) on Mar 07, 2003 at 14:33 UTC | |
|
Re: ref in @INC and debugging
by Tomte (Priest) on Mar 07, 2003 at 14:35 UTC | |
|
Re: ref in @INC and debugging
by Anonymous Monk on Mar 07, 2003 at 16:09 UTC | |
by IlyaM (Parson) on Mar 07, 2003 at 16:22 UTC | |
by Anonymous Monk on Mar 07, 2003 at 16:44 UTC |