in reply to Re: print real newlines in place of literal ones
in thread print real newlines in place of literal ones
my $line = 'TEXT=};print `ps`;print "Your machine is h4x0r3d!!$/";qq{H +ello\nWorld!\n'; .. OUTPUT: PID TT STAT TIME COMMAND 5808 p0 S 0:00.02 _su (csh) 5816 p0 S+ 0:00.01 perl mylittleprogram.pl 5817 p0 R+ 0:00.00 ps 149 v0 IWs+ 0:00.00 /usr/libexec/getty Pc ttyv0 Your machine is h4x0red!! Hello World #
I'm just showing that this can be a little dangerous but if you're the only one who is writing to the config file, you'll need to make certain you never use } or you'll most likely get $interpolated = undef. Of course, a prankster could put some code in the config file as I just showed and have it do a lot of nifty things and you still get the output you expected. So it could be some time before you'd realize anything is wrong at all. Of course, what are the chances of that? ;-)
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: print real newlines in place of literal ones
by Aragorn (Curate) on Jun 06, 2003 at 07:33 UTC |