In our last episode, the evil Dr. Lacto had captured our hero,
, who said:
>In /bin/sh it merely takes a
>$ set a b c
>to set $1 $2 $3.
>
>So what is the easiest way to do the same in perl?
Um... you *do* understand that "the shell" and "a perl program" are
two completely different things, right? I mean, $1 $2 $3 in the context
of the shell, and $1 $2 $3 in the context of a running perl program
have no relation to each other beyond the fact that they are composed of
two characters, a dollar sign and a number.
>Yes in perl they are related to regexps. No don't ask me why I want to
>set them, Just pretend I need to use them on the next line and want to
>try some different values.
You could (and probably should) use $q $w $e . Set them like they were
normal variables (which they are). They take no more keystrokes than
$1 $2 $3 do.
>If it takes more than just a one-liner, then perl has problems.
I would like perl to mow my lawn. The fact that it can't doesn't mean
that "perl has problems".
This is funny -- my sig generater is random, and this is the one it picked.
--hymie!
http://lactose.homelinux.net/~hymie
-------------------------------------------------------------------------------
It's not Perl's fault if you don't know how to program. --Ronald J Kimball
-------------------------------------------------------------------------------