X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a..ad8108920e6413d546a4245bbc986098ccaadc2b:/examples/platforms/syscoord/generate_peer_platform.pl diff --git a/examples/platforms/syscoord/generate_peer_platform.pl b/examples/platforms/syscoord/generate_peer_platform.pl index a01bcebd1e..91c062cfc9 100755 --- a/examples/platforms/syscoord/generate_peer_platform.pl +++ b/examples/platforms/syscoord/generate_peer_platform.pl @@ -1,41 +1,34 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -# Copyright (c) 2011, 2014. The SimGrid Team. +# Copyright (c) 2011-2019. The SimGrid Team. # All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. use strict; - -my $toversion=3; -my $nb_peer = $ARGV[0]; -my $i; +use warnings; print "\n"; -print "\n"; -print "\n"; +print "\n"; +print "\n\n"; -print "\n\n"; -print "\t\n"; -print "\n\n"; +print "\n\n"; -print "\t\n"; +print "\t\n"; my $line; -open SITES_LIGNE, $ARGV[0] or die "Unable to open $ARGV[1]\n"; -while(defined($line=)) +open INPUT, $ARGV[0] or die "Unable to open $ARGV[1]: $!\n"; +while(defined($line=)) { - #278 7.2 -9.4 h 2.3 - if($line =~ /^(.*) (.*) (.*) h (.*)$/) - { - print "\t\t\n\n"; - } -} - + next if ($line =~ /^#/); + # 278 7.2 -9.4 h 2.3 + if($line =~ /^([^ ]*) ([^ ]*) ([^ ]*) h ([^ ]*) *$/) { + print "\t\t\n"; + next; + } + die "Parse error: $line\n"; +} print "\t\n"; -print ""; - -print " \n"; +print "\n";