[sf-perl] simultaneous processes?

mehryar mehryar at mehryar.com
Fri Mar 5 11:20:34 PST 2010


I think you want qq{ } so the $file variable gets interpolated - q{ } will 
not do variable interpolation.

cheers,
-Mehryar


On Fri, 5 Mar 2010, Richard Reina wrote:

> Hi Garth,
>
> Thank you for he reply.  What I am trying to do is run two programs
> simultaneously and pass an argument in the form of a scalar to one of the
> programs.
>
> Here's the code from the program ( I am retyping it as the machine it's on
> does not get connected to the internet)
>
> system(q{ ( evince /usr/local/docs/$file & ) ; gnome-terminal"});
>
> evince opens with the error message:
>
> Unhandled MIME type: "x-directory/normal"
>
> However,
>
> system(q{ ( evince /usr/local/docs/file_name.tif & ) ; gnome-terminal"});
>
> works ( the file opens fine and so does the terminal next to it.)  I need to
> find a way to be able to pass the file name to evince.
>
> Thanks, again for the reply.  Hopefully, this can be solved.
>
>
>
> 2010/3/5 Garth Webb <garth.webb at gmail.com>
>
>> I think I'm lost on what you're trying to do; if its not too lengthy, can
>> you post exactly the script you're trying to run with the environment
>> variables (e.g. $file) explicitly defined?
>>
>> If you're really doing a "perl -e" just to run system, you might consider
>> making this a shell script instead of a perl script.
>>
>> Garth
>>
>> 2010/3/5 Richard Reina <gatorreina at gmail.com>
>>
>> The solution below works. But when I have to pass a scalar to the program
>>> it does not.  For example if I do something like:
>>>  perl -e'system(q{ ( evince $file & ) ; xlogo });'
>>>
>>> evince opens with this error Unhandled MIME type: "x-directory/normal"
>>>
>>> Does any one know how I can remedy this?
>>>
>>> Thanks.
>>>
>>> Richard
>>>
>>>
>>>
>>> 2010/3/4 Mark Grimes <mgrimes at cpan.org>
>>>
>>>> There are better ways of dealing with this (forking, one of the IPC
>>>>
>>>> modules, etc), but these are a quick and dirty way to do what you
>>>> want:
>>>>
>>>>  perl -e'system(q{sh -c "( xlogo & ) ; xlogo "});'
>>>>  perl -e'system(q{ ( xlogo & ) ; xlogo });'
>>>>
>>>> (Replacing the xlogo commands with evice and terminal, of course.)
>>>>
>>>>
>>>> 2010/3/4 Richard Reina <gatorreina at gmail.com>:
>>>>> I use evince to view a good number of tiff files.  I have written a
>>>> quick
>>>>> little script to help me associate the tiff files with various database
>>>>> records.  This script runs as part of larger API that runs in a very
>>>> minimal
>>>>> xwindows system ( no desktop just twm as a window manager.) As it
>>>> stands now
>>>>> I view the file with system("evince file.tiff"); close evince and
>>>> execute
>>>>> the script which helps me associate and save the file.  I was wondering
>>>> if
>>>>> there is a way to for my script to open a terminal while evince is
>>>> still
>>>>> open so I can still look at the file while I'm saving it.
>>>>>
>>>>> I've tried system("evince file.tiff & gnome-teminal
>>>> --geometry=50x35-0+0");
>>>>> but then I don't see evince.
>>>>>
>>>>> Any help would be greatly appreciated.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Richard
>>>>>
>>>>> _______________________________________________
>>>>> SanFrancisco-pm mailing list
>>>>> SanFrancisco-pm at pm.org
>>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>>>
>>>>>
>>>> _______________________________________________
>>>> SanFrancisco-pm mailing list
>>>> SanFrancisco-pm at pm.org
>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>>
>>>
>>>
>>> _______________________________________________
>>> SanFrancisco-pm mailing list
>>> SanFrancisco-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>
>>>
>>
>> _______________________________________________
>> SanFrancisco-pm mailing list
>> SanFrancisco-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>
>>
>


More information about the SanFrancisco-pm mailing list