[svn:parrot] r47591 - trunk/tools/dev

coke at svn.parrot.org coke at svn.parrot.org
Sun Jun 13 03:39:46 UTC 2010


Author: coke
Date: Sun Jun 13 03:39:46 2010
New Revision: 47591
URL: https://trac.parrot.org/parrot/changeset/47591

Log:
Make script give usage when invoked incorrectly instead of exploding.

Modified:
   trunk/tools/dev/pprof2cg.pl

Modified: trunk/tools/dev/pprof2cg.pl
==============================================================================
--- trunk/tools/dev/pprof2cg.pl	Sun Jun 13 03:00:17 2010	(r47590)
+++ trunk/tools/dev/pprof2cg.pl	Sun Jun 13 03:39:46 2010	(r47591)
@@ -43,7 +43,7 @@
 
 =cut
 
-main(\@ARGV);
+main(@ARGV);
 
 =head1 INTERNAL DATA STRUCTURES
 
@@ -117,9 +117,11 @@
 =cut
 
 sub main {
-    my $argv      = shift;
+    my $filename  = shift;
     my $stats     = {};
-    my $filename  = $argv->[0];
+
+    die "Usage: $0 filename\n"
+        unless defined $filename;
 
     $stats->{global_stats}{total_time} = 0;
 
@@ -129,8 +131,6 @@
 
     close($in_fh) or die "couldn't close $filename: $!";
 
-    #print_stats($stats);
-
     unless ($filename =~ s/pprof/out/) {
         $filename = "$filename.out";
     }


More information about the parrot-commits mailing list