#!/usr/bin/perl -w use strict; use Getopt::Long; # point plotting by default my %options = ( "lines" => 0); GetOptions(\%options, "lines!"); # set up plotting style my $style = "points"; $style = "linespoints" if($options{"lines"}); sub usage { print "Usage: $0 \n"; print <) { chomp; my $line = $_; plotHeader($xcounter, $samples, $numberOfStreams, *PIPE) if($streamIdx == 0); foreach my $point ($line =~ /([-]?[0-9\.]+)/g) { my $buf = $buffers[$streamIdx]; # data buffering (up to stream sample size) push @{$buf}, $point; my $cnt = 0; for my $elem (reverse @{$buf}) { #print " ".$elem; print PIPE ($xcounter-$cnt)." ".$elem."\n"; $cnt++; } #print "\n"; print PIPE "e\n"; if ($cnt>=$samples) { shift @{$buf}; } $streamIdx++; if ($streamIdx == $numberOfStreams) { $streamIdx = 0; $xcounter++; } } } print PIPE "exit;\n"; close PIPE; } main;