On 10 Jul 2002 11:06:03 -0400, [EMAIL PROTECTED] (Chas Owens)
wrote:
>> movie listing and when one item is selected via remote, 'system'
>> invokes mplayer which leaves main gtk window blank after it finishes?
>> :)
>
>Perl 5.6.x is not threaded, so anything that blocks (like system) will
>keep the gui from updating. To launch another app you should fork and
>then exec the other app without waiting your the child to die.
I guess another way is to somehow force gui updating?
>> return(*DAT); # or should be return(DAT)?
>> }
>>
>> Is this kind of using file handles encouraging?
>
>You are probably better served by using the IO::File module. See
>perldoc IO::File for more information.
tnx.
>> ----------------------------------------------------------------------
>> Is there a way to use 'format' where I could write to scalars instead
>> to file handles?(usefull when cgi sends mail and shows same content in
>> the browser)
>
>I assume you are referring to the write function and formats. I believe
yes.
>there is a way to get at the Perl variables used to do the formating,
>but that is ugly (see perldoc perlvar for more info). Is there a reason
>you are not using sprintf (see perldoc -f sprintf)?
Actually there isn't a strong reason for format, I just thought the
code would look more cleanly.
>> ----------------------------------------------------------------------
>> How to match complex repeating patterns, i.e. I want to match
>> (\d{6}.*?\t) ten times and read values of the last three?
>
>Here is one way:
>
><code>
>#!/usr/bin/perl -w
>use strict;
>
>my $string = "ab cd ef gh ijkl mn op qr st uv wx yz";
>
>my @matches;
>
>for my $i (0..9) {
> last unless $string =~ /(\w+)/g;
> $matches[$i] = $1;
>}
>
>my @I_care_about_these = @matches[-3,-2,-1];
>
>#note, if there are less than three matches
>#we will get a warning here
>print "@I_care_about_these\n";
></code>
>
>This should print out "qr st uv\n"
Tnx, I was using split but thought that single regex would be more
optimized and shorter for this kind of task. :)
--
Matija
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]