develooper Front page | perl.beginners | Postings from March 2002

executing filename with ~ in perl

Thread Next
Roy Peters
March 27, 2002 11:01
executing filename with ~ in perl
Message ID:
I have the following

$x = ~rambo/bin/script1; (where script1 is an executable shell script)

$ret = `x`;

The above will not work.

However if I define

$x = /home/apple/rambo/bin/script1; (ie I give a full pathname)

$ret = `x`;

This will work.

How do I make the first example work? By the way, I am on an unix machine

The information contained in this message may be privileged 
and confidential and protected from disclosure.  If the 
reader of this message is not the intended recipient, or an 
employee or agent responsible for delivering this message to 
the intended recipient, you are hereby notified that any 
reproduction, dissemination or distribution of this 
communication is strictly prohibited. If you have received 
this communication in error, please notify us immediately by 
replying to the message and deleting it from your computer.

Thank you.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About