home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!rutgers!orstcs!prism!
- From: @prism.cs.orst.edu
- Newsgroups: comp.lang.perl
- Subject: Why doesn't this work?
- Message-ID: <1992Sep02.191014.28892@CS.ORST.EDU>
- Date: 2 Sep 92 19:10:14 GMT
- Sender: usenet@CS.ORST.EDU
- Distribution: usa
- Organization: Oregon State University, Computer Science Dept
- Lines: 55
- Nntp-Posting-Host: prism.cs.orst.edu
-
- Why doesn't this work?
-
- while ( ($eval) = ($path =~ /(\`.*\`)/) ) {
- $val = "";
- if ( $eval ) {
- $val = eval( $eval );
- chop $val;
- }
- $path =~ s/$eval/$val/;
- }
-
-
- Here's what's happening via the debugger:
-
- main'(explode:168): while ( ($eval) = ($path =~ /(\`.*\`)/) ) {
- DB<2> print $path
- Researchers/`echo David D. Perkins--071160 | cut -f1 -d-`/Fungi/collection_rec
- DB<3> s
- main'(explode:169): $val = "";
- DB<3> s
- main'(explode:170): if ( $eval ) {
- DB<3> p $eval
- `echo David D. Perkins--071160 | cut -f1 -d-`
- DB<4> s
- main'(explode:171): $val = eval( $eval );
- DB<4> s
- main'((eval):1): `echo David D. Perkins--071160 | cut -f1 -d-`;
- ((eval):2): ;
- DB<4> s
- main'(explode:172): chop $val;
- DB<4> s
- main'(explode:174): $path =~ s/$eval/$val/;
- DB<4> p $val
- David D. Perkins
- DB<5> p $eval
- `echo David D. Perkins--071160 | cut -f1 -d-`
- DB<6> p $path
- Researchers/`echo David D. Perkins--071160 | cut -f1 -d-`/Fungi/collection_rec
- DB<7> s
- main'(explode:168): while ( ($eval) = ($path =~ /(\`.*\`)/) ) {
- DB<7> p $path
- Researchers/David D. Perkins| cut -f1 -d-`/Fungi/collection_rec
-
-
-
- Can someone help me out here? It seems that nothing after the "|"
- is being replaced. What I had hoped would be in $path is
- Researchers/David D. Perkins/Fungi/collection_rec
- But that's not happening. Any help would be appreciated...
-
-
- --
- Rebecca Jacobsen
- rydenb@cs.orst.edu
- Microbial Germplasm Database Project
-