Sponsored Content
Top Forums Shell Programming and Scripting Piped open not real-time - How would one handle live data? Post 302133274 by jjinno on Wednesday 22nd of August 2007 03:57:19 PM
Old 08-22-2007
Piped open not real-time - How would one handle live data?

When I run "/etc/myApp" I am presented with continuous output, just about once per second.

However when I try to get the information in Perl via a piped open, it waits till the end to give me anything... my code:
Code:
open (OUTPUT,"/etc/myApp |");
    while (<OUTPUT>){
        print $_;
    }
close (OUTPUT);

Why is that, and how can I fix it so that I do get the progressive output?

I know that I can solve my particular problem by just pushing STDOUT to a temp file, and then parsing it... but I would prefer to learn how to handle "live" data
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Live/real-time text-file updates in terminal

I want to have a terminal open and have something like a "repeating cat" command running in it for a certain text file (in particular /var/log/system.log). So my terminal will scan or cat the text file every so often or whenever the text file system.log gets written to by the system, it will... (1 Reply)
Discussion started by: guitarscn
1 Replies

2. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

3. Shell Programming and Scripting

Converting real time to epoch time

# date +%s -d "Mon Feb 11 02:26:04" 1360567564 # perl -e 'print scalar localtime(1360567564), "\n";' Mon Feb 11 02:26:04 2013 the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input 1359453135154 rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies

4. Shell Programming and Scripting

Archiving or removing few data from log file in real time

Hi, I have a log file that gets updated every second. Currently the size has grown to 20+ GB. I need to have a command/script, that will try to get the actual size of the file and will remove 50% of the data that are in the log file. I don't mind removing the data as the size has grown to huge... (8 Replies)
Discussion started by: Souvik Patra
8 Replies
SplashFast(3pm) 					User Contributed Perl Documentation					   SplashFast(3pm)

NAME
Wx::Perl::SplashFast - Fast splash screen for the Wx module. SYNOPSIS
use Wx::Perl::SplashFast ('/path/to/logo.jpg',3000); # timeout in milliseconds package myApp ; # subclass Wx::App ... package myFrame; # subclass Wx::Frame ... package main; my $myApp = myApp->new(); my $frame = myFrame->new(); $myApp->MainLoop(); DESCRIPTION
Using Wx::SplashScreen from Wx::App::OnInit may cause a high delay before the splash screen is shown on low end machines. This module works around this limitation; you just need to follow the example. USAGE
Just put the code inside the 'BEGIN {}' of your main app, like: sub BEGIN { use Wx::Perl::SplashFast ; Wx::Perl::SplashFast->new("./logo.jpg",5000); } or load the module before any other: use Wx::Perl::SplashFast ("./logo.jpg",5000) ; use Wx ; ... import ( IMG_FILE, SPLASH_TIMEOUT ) IMG_FILE Path of the image file to show. SPLASH_TIMEOUT Timeout of the splash screen in milliseconds. If you "use Wx::Perl::SplashFast './logo.jpg', 1000;" this has the same affetc as. BEGIN { require Wx::Perl::SplashFast; Wx::Perl::SplashFast->new( './logo.jpg', 1000 ); } new ( IMG_FILE , SPLASH_TIMEOUT ) Show the splash screen. IMG_FILE Path of the image file to show. SPLASH_TIMEOUT Timeout of the splash screen in milliseconds. EXAMPLE
use Wx::Perl::SplashFast ("./logo.jpg",5000) ; # Don't forget to put your own image in the same path. Duh package myApp ; use base 'Wx::App'; sub OnInit { return(@_[0]) ;} package myFrame ; use base 'Wx::Frame'; use Wx qw( wxDEFAULT_FRAME_STYLE ); sub new { my $app = shift ; my( $frame ) = $app->SUPER::new( @_[0] , -1, 'wxPerl Test' , [0,0] , [400,300] ) ; return( $frame ) ; } package main ; use Wx ; my $myApp = myApp->new() ; print "window " ; my $win = myFrame->new() ; $win->Show(1) ; $myApp->SetTopWindow( $win ) ; $myApp->MainLoop(); SEE ALSO
Wx, <Wx:SplashScreen> AUTHOR
Graciliano M. P. <gm@virtuasites.com.br> Thanks to wxWidgets people and Mattia Barbon for wxPerl! :P COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2009-12-25 SplashFast(3pm)
All times are GMT -4. The time now is 10:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy