Re: data comprised of regexs (while loop weirdness)

From: gnari (gnari_at_simnet.is)
Date: 08/13/04


Date: Fri, 13 Aug 2004 09:46:44 -0000


"Scott W Gifford" <gifford@umich.edu> wrote in message
news:qszy8kkw0tp.fsf@mspacman.gpcc.itd.umich.edu...

> #!/usr/bin/perl -w
>
> use strict;
>
> my $request = shift @ARGV;
>
> my @data = <DATA>;
> for(@data)
> {
> chomp;
> print "'$request' ?~ /$_/: ";
> if ($request =~ /$_/) {print 'yes';}
> print "\n";
> }
> __DATA__
> test1
> test2
> test3
> ...
> I assume that the contents of the file you're reading from is under
> your control, BTW; regular expressions can contain code, so if
> somebody can write to that file they'll have the ability to cause your
> script to execute code of their choice.

please provide an example.
there is no eval() or /e in the code showed.
(?{}) is not interpolated.

what are you talking about?

gnari



Relevant Pages

  • Re: Rugby twat banned for drink-driving
    ... I'm not condoning drink driving - but reading this it seems to me like ... The liberal-left hardliners have no sympathy and would ... resignation to the forces that control all our lives, ... And no, I don't condone drinking and driving, but that is mainly due ...
    (rec.sport.rugby.union)
  • Re: OT small disaster in our whoops this got sent before I was done.
    ... It is even more frustrating to see a high reading like 130 and have no idea where it came from and what I did wrong to do that. ... Once I even got so angry about this failure to control my BG that did not eat anything for two days. ... My wife convinced me that what I was doing amounted to nothing more than a temper tantrum and was dangerous. ... I started her soup with a reading of 112 and an hour later after starting the soup, ...
    (alt.support.diabetes)
  • Re: OT small disaster in our whoops this got sent before I was done.
    ... I have not been able yet to really stabilize my readings. ... It is even more frustrating to see a high reading like 130 and have no idea where it came from and what I did wrong to do that. ... Once I even got so angry about this failure to control my BG that did not eat anything for two days. ... My wife convinced me that what I was doing amounted to nothing more than a temper tantrum and was dangerous. ...
    (alt.support.diabetes)
  • Re: Inexpensive Electronic Temperature Switch by Dwyer (Love) Controls
    ... double boiler espresso machines. ... the PF reading was always a fixed offset away ... average shot temperature within 1F at worst. ... of an on/off control is minimized. ...
    (alt.coffee)
  • Re: Inexpensive Electronic Temperature Switch by Dwyer (Love) Controls
    ... crumpled aluminum foil) would get you a truer reading? ... > double boiler espresso machines. ... > average shot temperature within 1F at worst. ... > of an on/off control is minimized. ...
    (alt.coffee)