#perl - Thu 8 Mar 2007 between 15:10 and 15:31



rindolfofer0: what's up?
Botjehello, rindolf
rindolfBotje: sup?
BotjeI was awake for 36 hours yesterday
then 14hours of sleep
and now I don't feel like coding, so i'll play nethack some more :)
ofer0Botje, here's the solution: perl -le'print"@{[1..1000]}"'
29 bytes
rindolf, I'm fine, you ?
Botjeofer0: of course, nice one
hobbsofer0: Botje's is the same length without the (accidental as far as I can see) -p
rindolfofer0: trying to do something with Plagger.
ofer0: which isn't very easy.
anno_perl -le 'print"@{[1 .. 100]}"'
dkrofer0: perl -le'print"@{[1..1e3]}"'
hobbsthen again it seems to fail to do anything...
ofer0hobbs, it is one byte longer.
hobbsofer0: it had an unnecessary space in it too, I didn't count that
ofer0hobbs, see proof @ PM
dkr, amazing :)
notjohnhobbs: how do you generate that "Platform" output?
hobbsnotjohn: perl -V
notjohnhobbs: did you compile perl yourself ?
hobbsnot my machine, not my perl, but I'm assuming it's stock
notjohnosname=darwin, osvers=8.8.4, archname=darwin-2level
hru701if I had a perl script that had a variable in the beginning to run the program, and I needed a quick way of running the program again without having to manually change that variable, is there a way of supplying the variable arguments from the command line?
notjohni'm using perl from mac ports... i dont' think the included os x perl is different
anno_hru: <c>my $var = shift;</c>
hru701anno_ say I wanted to add two of $var (i.e for the program to run twice, once with the first variable, and again with the next) what amendments would I need to make?
rindolfhru701: use foreach
anno_the script will only run once per call, never mind how many variables
rindolfhru701: or better - create a subroutine and call it with each one.
hru701rindolf quick example? my $var1 = ' '; my $var2 = ''; sub ($var1); sub ($var2); ?
rindolfhru701: you can't use sub.
hru701: myfunc($var1); myfunc($var2);
actionCPAN upload: CAS-0.88 by SEANQ
CPANupload: CAS-0.88 by SEANQ
actionCPAN upload: CAS-Apache-0.45 by SEANQ
CPANupload: CAS-Apache-0.45 by SEANQ
actionCPAN upload: Audio-MPD-0.13.5 by JQUELIN
CPANupload: Audio-MPD-0.13.5 by JQUELIN
dkrofer0: perl -l040e'print for 1..1e3' not as short, but TMTOWDI is fun, :)
anno_for my $var ( @ARGV ) { sub( $var) }

Page: 1 8 15 22 29 36 43 50 57 64 71 78 85 

IrcArchive