Can any of the PERL developers on this help me write the following line
of code without the use of "psuedohashes"?  It will be greatly
appreciated.

my $file = @_ == 2 ? $_[1] : $_[0]->{FILENAME};

Khurram Khan


what is a pseudo hash dude??


@_ as a scalar .... the number of arguments passed in to your routine ? (or maybe the ordinal number thereof)

so you're saying above: if the number of arguments pased in is two, then the $file filename is the second argument, other wise it's the 'FILENAME' item of the first argument??

I'd just do the whole thing in some more wildly simple manner. In the routine above, just get the file name in an ordinary plain variable, like $filename. and pass it in to the routine &routine( $filename, $otherstuff );

In the routine just get the argument
sub routine
 {
 my $use_this_filename = shift;

insider perl idiom sucks ... go K.I.S.S.



---
You are currently subscribed to e-gold-list as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Use e-gold's Secure Randomized Keyboard (SRK) when accessing your e-gold account(s) via the web and shopping cart interfaces to help thwart keystroke loggers and common viruses.

Reply via email to