Gave it a shot, received this error:
Useless use of a constant ("sudo dpkg -i steam.deb") in void context at ./steam.pl at line 13.
Line 13 being where that particular code is of course.
| [reply] |
| [reply] |
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);
| [reply] [d/l] [select] |