Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: How to include a doublequoted string into a backticked expression?

by pat_mc (Pilgrim)
on Jan 23, 2009 at 14:03 UTC ( [id://738485]=note: print w/replies, xml ) Need Help??


in reply to Re: How to include a doublequoted string into a backticked expression?
in thread How to include a doublequoted string into a backticked expression?

The problem is linux shell does its own interpolation
Yes, Anonymous Monk - you were spot-on in your analysis.

Here is why:
$ a="Hello" $ echo $a Hello $ echo "$a" Hello $ echo '"$a"' "$a" $ echo "'"$a"'" 'Hello' $ echo ""'"$a"'"" "$a"
For the actual solution to my problem, this means:
my $command = qq/egrep "'"^$lemma:"'" \/home\/lexicon/; my $lexical_entry = `$command`;

Thanks to all those who were willing to help. Your effort to respond is much appreciated.

Thanks for leading me towards the actual solution!

Cheers - Pat

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://738485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found