Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Tied Variables - why?

by Aristotle (Chancellor)
on Sep 07, 2002 at 11:15 UTC ( [id://195861]=note: print w/replies, xml ) Need Help??


in reply to Re: Tied Variables - why?
in thread Tied Variables - why?

Good example, but you could cut down further. :-)
use Tie::IxHash; tie %thash, Tie::IxHash; print $q->popup_menu(-name => $p, labels => \%thash, -values => [ keys + %thash ]);

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: Tied Variables - why?
by shotgunefx (Parson) on Sep 07, 2002 at 22:36 UTC
    Good point. In CGI scripts, I like to keep the number of modules that need to be loaded down when it makes sense. Especially small things like this but YMMV.

    -Lee

    "To be civilized is to deny one's nature."

      I used to be in that camp too. Nowadays I don't confine myself though unless there is no pure-Perl module for the purpose. The reason is simple: any Perl code can be placed where a CGI script can, so any pure-Perl modules can be passed along with the script - even if I have to download the modules and copypaste the code into the file myself.

      Care needs to be taken that all the imports work correctly of course, but it's far from impossible. I'm thinking some sort of packaging mechanism based on Coderefs in @INC (was: Building a Simple Perl Module Database) could actually make the whole thing totally transparent.

      Makeshifts last the longest.

        Not an issue of installing modules, I have no fear of that and have half of CPAN installed. It's just when using vanilla CGI I like to keep the file IO down. So for simple ties I rarely use modules.

        -Lee

        "To be civilized is to deny one's nature."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-24 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found