Garayed.com  

Go Back   Garayed.com > Perl
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-26-2005, 12:14 PM
Brian Wakem
 
Posts: n/a
Default Re: Interpolations within system()

beartiger@gmail.com wrote:
> Interpolations within system()...are not allowed.



They are.


> my $line="system('\"c:/Program Files/HyperSnap-DX 5/HprSnap5.exe\"
> -open:$file.gif -saveng $file.png')";
>
>
> open(INFO, ">temp.pl");
> print INFO $line;
> close(INFO);
>
>
> system('perl temp.pl');



What on Earth is going on here?

1) You are single quoting the command, which is why your variables are
not being interpolated. Use double quotes.

2) $line will now contain (according to perldoc -f system, which I'm
sure you have read) the exit status of the program as returned by the
"wait" call.

3) You then write this exit status value to a perl file and attempt to
execute it? Has the world gone mad? What are you *actually* trying to do?


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:00 PM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.