Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: obj dump

by Anonymous Monk
on Sep 24, 2001 at 14:46 UTC ( #114277=note: print w/ replies, xml ) Need Help??


in reply to Re: obj dump
in thread obj dump

can anyone elaborate?


Comment on Re: obj dump
Re: Re: obj dump
by blakem (Monsignor) on Sep 24, 2001 at 14:55 UTC
    Its tough write an elaborate answer to such a minimal question. We don't even know what that code is supposed to do. Try framing the code with how you are using it, what the interesting parts are, what problems you're having with it, etc.

    Time spent asking a good question will be rewarded with meaningful answers. Read dominus's comments on how to ask a good question. After all, if you aren't willing to invest more than five words, why should we?

    -Blake

      I was hoping someone here could explain what this does.. I only know it's a obj dumper, but I don't know much else and I was trying to figure out how it works..

        Perl comes standard with Data::Dumper, which is useful for printing out complex data structures (and even for loading them up again if you need to -- it's nice for simple configuration files). I'm afraid that the only person who could give you a definitive answer about what the code you posted does and how it works is the original author (and maybe not even that person, memory being what it is).

        Sample usage (very silly) :

        #/usr/bin/perl -w use strict; use Data::Dumper; my $obj = { foo=> [0..4], bar=>"wouldn't it be nice?", baz=>[ qw(if we were older) ], bletch=>"Then we wouldn't have to ... ummm, something +something"}; print Data::Dumper->Dump( [ $obj ]);

        Try that and take a peek at the output.

        HTH!

        perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
Re: Re: obj dump
by virtualsue (Vicar) on Sep 24, 2001 at 16:40 UTC


    OK. Did you really mean to use -s¹ in the shebang line, or did you mean -w? There are a lot of regular expressions in your program, but no comments and every single variable name is composed of a single character. It looks like it fell out of a 1970s Fortran/Basic timewarp. The indenting is reasonable. Marks out of 10: 3 (provisional, based on the assumption that you meant to run with warnings enabled).




    ¹From the Perl 5 Pocket Reference:

    -s   Interprets -xxx on the command line as a switch and sets the corresponding variable $xxx in the script to 1. If the switch is of the form -xxx=yyy the $xxx variable is set to yyy.
      -s is the right switch: you'll note that there are references (but no assignments to) $d,$g, $p and $matchstr? These are supposed to be set via the command line, and the -s switch. As in: objdump -matchstr=freddy li < input That's just an example, btw. I haven't figured out what the blasted thing does (except machstr is not optional, and should be a regexp capturing three components).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://114277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-12-19 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls