[sf-perl] simultaneous processes?

Mark Grimes mgrimes at cpan.org
Fri Mar 5 10:58:59 PST 2010


q{ } is equivalent to using single quotes (''), so there is no
variable substitution. Very handy when you are using perl -e'' on the
command line to avoid the shell interpreting your quotes.

In your script do something like:

  system( "( evice $file & ) ; xlogo " );

or if there is anychange $file will have spaces you might want to do

  system( qq{ (evince "$file" & ) ; xlogo } );

In this one, qq{ }  is equivalent to double quotes (""), so variables
are substituted.


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
>
>


More information about the SanFrancisco-pm mailing list