Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: installing application from a deb file in perl script

by hotlunch (Initiate)
on May 30, 2014 at 20:42 UTC ( [id://1088072]=note: print w/replies, xml ) Need Help??


in reply to Re^2: installing application from a deb file in perl script
in thread installing application from a deb file in perl script

I get the same error when I try to use gdebi with the same style of code:

'sudo gdebi steam.deb';

  • Comment on Re^3: installing application from a deb file in perl script

Replies are listed 'Best First'.
Re^4: installing application from a deb file in perl script
by aitap (Curate) on May 31, 2014 at 18:35 UTC

    You mixed up the `backtick` operator (qx//, which executes command via shell, interpolating variables, and returns its stdout) and the 'single-quote' operator (q//, which constructs a string without interpolating anything). Read Quote and Quote like Operators for more information about that.

    If you get the file name from a user-supplied variable, it probably would be better to use system and split the command line into different function arguments. This way you won't be surprised when the file name happens to contain some special characters which could otherwise be interpreted by shell (like $, &, (, )). Example code:

    system('sudo', 'dpkg', '-i', $myfile);

      Thank you very much aitap. Your response was extremely insightful and I learned much from you!

      Also thanks for pointing me towards the wealth of information in that link. Much appreciated all around sir.

      Cheers.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found