interesting perl question

Discussion in 'Perl Misc' started by Robin, May 9, 2010.

  1. Robin

    Robin Guest

    how can I make a structure where you have a variable call sometjhing
    in a package for exmaple print $a -> $v prints the variable $v in a
    package called c.....the closest I could do was the
    following....thanks everyone,
    robin


    package a;
    $v = 1;

    package main;
    $a = bless \$z, "a";
    print $a::v;
     
    Robin, May 9, 2010
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.