SPUG: backticks, system, and ImageMagick
Tim Maher
tim at consultix-inc.com
Sun Mar 17 18:17:08 CST 2002
(Forwarded after removal of SPAM-triggers)
-Tim
When in windoze I usually do something like this:
open CMD,"program |" or die;
while (<CMD>) {
print;
}
Note, at least in w2k, that both stdout and stderr are read on the pipe,
but you can use open CMD,"program 2>nul |" to suppress stderr (or stdout
1>nul).
You may wanna try it on win98.
--@@
~
DavidC
The Biggest Game In Town - http://www.wces.org/html_files/burien.html
Finally, America will begin to see the staggering wealth our own city,
county, state, and federal governments hold secret accounts. If these hidden
assets - that the AMERICAN PEOPLE own - can be liberated from government
agencies, we can see a virtual end to property and income tax. Sound
impossible? Then you haven't heard Walter Burien exposing the Comprehensive
Annual Financial Report (CAFR) scam.
> -----Original Message-----
> From: Richard Wood [mailto:wildwood_players at yahoo.com]
> Sent: Monday, February 25, 2002 12:15 PM
> To: Spug
> Subject: SPUG: backticks, system, and ImageMagick
>
>
> I am a unix kind of guy trying to function in a win98
> situation.
>
> I am having a problem with backticks and I am looking
> for new ideas on what it could be.
>
> I am running in a MSDOS window trying to execute some
> ImageMagick commands from perl. The path to the
> ImageMagick bin directory in included in my PATH
> environment variable. I can issue all of the
> ImageMagick commands from the command line (mogrify,
> identify, composite, and montage and they all return
> the usage for the command. When I write a very simple
> script such as:
>
> perl -e "print `mogrify`;"
>
> I get the usage only if I use mogrify, or convert. If
> I try identify, composite, or montage, I get nothing.
>
> On the other hand, if I write:
>
> perl -e "system(montage);"
>
> it works and returns the usage for all of the
> commands, but I guess I can't capture the output in an
> array in my perl when I use system, right?
>
> I have tried using the full path to the executable and
> it still doesn't work.
>
> Could some of the commands be writing to something
> other than STDOUT? like STDERR?
>
> I would appreciate any ideas.
>
>
> =====
> Richard O. Wood
> Wildwood IT Consultants, Inc.
> wildwood_players at yahoo.com
> 425.941.9437
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
> POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
> Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
> Replace ACTION by subscribe or unsubscribe, EMAIL by your
> Email-address
> For daily traffic, use spug-list for LIST ; for weekly,
> spug-list-digest
> Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list