← Back to Users
mccollum's activity in the archive.
doh.. lost my angular braces $prog = "";while(<>) { chop(); $prog = sprintf("%s%c", $prog, length($_));} eval $prog;
I suck at perl, but after reading this, I wrote this quick hack.It counts characters in a line, and uses that as the character in the program.Just tested my 'hello world' program (which I won't bother posting, since it is a bunch of white space) $prog = "";while() { chop(); $prog = sprintf("%s%c", $prog, length($_));} eval $prog;
doh.. lost my angular braces
$prog = "";
while(<>) {
chop();
$prog = sprintf("%s%c", $prog, length($_));
}
eval $prog;
I suck at perl, but after reading this, I wrote this quick hack.
It counts characters in a line, and uses that as the character in the program.
Just tested my 'hello world' program (which I won't bother posting, since it is a bunch of white space)
$prog = "";
while() {
chop();
$prog = sprintf("%s%c", $prog, length($_));
}
eval $prog;