It was Monday, July 28, 2003 when Dan Muey took the soap box, saying:
: > You've got it, only, don't return anything.
: >
: > Here is a command-line example:
: >
: > perl -le'sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"'
: >
: > This is basically exactly what you have there. It's not
: > supposed to "return" variables, but rather "create" variables.
: >
: > Just a note, this is generally unelegant and therefore
: > usually the wrong approach to solve a problem.
:
: That what I'd say also except here I'm using a series of numbers for(100..1000) { }
: Each one has the same string except the number is different
: And then want to just declare them all with one call and use them as I want.
:
: I'm glad to know that principle works, thanks.
:
: Any idea how to get it to be friends with use strict; ??
You have to turn off strict 'refs'.
use strict;
# ...
for ( @list ) {
no strict 'refs';
# ...
}
:
: IE
: perl -le'use strict;sub v{${$_} = ++$c for qw[x y z]} v; print "$x $y $z"'
:
: >
: > Casey West
:
: Thanks Casey!
:
: --
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
:
Casey West
--
If you have any trouble sounding condescending, find a Unix user to
show you how it's done.
-- Scott Adams
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]