in reply to Re^2: Script Issues
in thread Script Issues
Hauke, thanks for the additional help. The fatalstobrowser definitely helps in not having to refresh the error log continuously.
I did attempt to look around for another Perl install, but didn't have any luck. It looks as if I'm stuck with 5.8.8 for the moment.
Basically what I'm attempting to do, is copy information for an user (listed at the top of the code) from the main gr.txt file as listed in the code, and place it along with some other text in a pre-formatted output file. I've attached a copy of the output below, along with my updated script based on the suggestions made here.
Updated Code:
Sample output:#!/usr/bin/perl -w use LWP::Simple; use CGI::Carp qw(fatalsToBrowser); use strict; use warnings; @show = ( 'Mike Cox*', ); print <<EOF; Refresh: 1 Threshold: 999 Title: Into The Meso SN Locations Font: 1, 14, 0, "Arial" IconFile: 1, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spott +ernet.png" IconFile: 2, 15, 25, 8, 25, "http://www.spotternetwork.org/icon/arrows +.png" IconFile: 6, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spott +ernet_new.png" EOF my $sn = get 'http://www.spotternetwork.org/feeds/gr.txt'; $x = length $sn; $sn = substr($sn, 343, $x-343); my @values = split('End:', $sn); foreach my $val (@values){ if($val =~ m/Text:\s15\,\s10\,\s1\,\s\"(.+)\"/g){ my $name = $1; if (grep {$name eq $_} @show){ ...; }{ print $val; print "End:\n" } } }
Refresh: 1 Threshold: 999 Title: Into The Meso SN Locations Font: 1, 14, 0, "Arial" IconFile: 1, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spott +ernet.png" IconFile: 2, 15, 25, 8, 25, "http://www.spotternetwork.org/icon/arrows +.png" IconFile: 6, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spott +ernet_new.png" Object: 41.3149986,-93.1019974 Icon: 0,0,000,6,2,"Mike Cox*\n2016-04-09 01:22:27 UTC\nSTATIONARY\nEma +il: mike@iowachaser.com\nHam: 146.550 - K0SVR\nTwitter: https://twitt +er.com/IntoTheMeso\nWeb: www.intothemeso.com\nNote: Into The Meso Cha +se Team" Text: 15, 10, 1, "Mike Cox*" End:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Script Issues
by haukex (Archbishop) on Apr 09, 2016 at 09:41 UTC | |
|
Re^4: Script Issues
by Iowachaser (Novice) on Apr 09, 2016 at 17:41 UTC | |
by AnomalousMonk (Archbishop) on Apr 09, 2016 at 23:30 UTC |