Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Help with Back Ticks and calling a program with variables...

by basicdez (Pilgrim)
on Mar 12, 2002 at 20:06 UTC ( #151210=perlquestion: print w/replies, xml ) Need Help??

basicdez has asked for the wisdom of the Perl Monks concerning the following question:

Is there anyreason that back ticks would not accept perl variables? This is all I can guess, but how do I call this rdes program from an exact directory plus the variables as well. I am in great need of help here.
#!/usr/local/bin/perl-Tw my $datpath = "/develop/release/cmsidev/dev/cr/cds/comms/x2p/ +LOGS"; my $INI_Ref_Number = 2; my $INI_Company_Code = 840; my $INI_CR2K_Number = 4308.01; print "$datpath \n"; system ('$datpath/rdes $datpath/xxx$INI_CR2K_Number.xml $INI_Ref_Numb +er $INI_Company_Code > error.dat ');

Replies are listed 'Best First'.
Re: Help with Back Ticks and calling a program with variables...
by VSarkiss (Monsignor) on Mar 12, 2002 at 20:16 UTC

    Um, I don't see any backticks there, but the reason the variables aren't getting interpolated is that you're using single quotes instead of double quotes. Just do this: system ("$datpath/rdes  $datpath/xxx$INI_CR2K_Number.xml $INI_Ref_Number $INI_Company_Code  > error.dat ");

    HTH

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-01-20 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?