Advertisement
GregLeblanc

Untitled

Mar 15th, 2024
1,106
0
114 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.46 KB | Help | 0 0
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use warnings;
  4. use HTML::TokeParser;
  5.  
  6. my $script = "/var/www/cgi-bin/findenergy";
  7.  
  8. my $scriptoutput = `$script -debug particle=ALPHAS frequency=17.88 charge="+2"`;
  9.  
  10. my $p = HTML::TokeParser->new(\$scriptoutput);
  11. my @energy = ();
  12.  
  13. while (my $token = $p->get_tag("th")) {
  14.     if($token->[1]{id} =~ /energy/){
  15.         my $text = $p->get_trimmed_text("/a");
  16.         @energy = split ' ', $text;
  17.         print "@energy[2]\n";
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement