in reply to Maintaining strict refs while Binding a set of variables to @_ or dying if they are not defined
use strict; sub file_name { no strict 'vars'; no strict 'refs'; my @arg = qw(client_number MM DD S); for (@arg) { $$_ = defined($_[0]) ? shift : die "$_ not defined" } "I$client_number$MM$DD$S" } my $out = file_name 1,2,3,4; warn $out;
But of course it can be improved with davorg's wonderful embellishment:
{ local $" "I@_" }
This code reminds me of learning shorthand.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Maintaining strict refs while Binding a set of variables to @_ or dying if they are not defined
by japhy (Canon) on Nov 29, 2000 at 21:40 UTC | |
|
Re: Re: Maintaining strict refs while Binding a set of variables to @_ or dying if they are not defined
by japhy (Canon) on Nov 29, 2000 at 21:37 UTC |