Loading ...
Sorry, an error occurred while loading the content.

25948Re: [PBML] Eval and memory problems

Expand Messages
  • computerdribble
    Jan 9, 2008
    • 0 Attachment
      Thank you for responding.


      --- In perl-beginner@yahoogroups.com, "Jenda Krynicky" <Jenda@...> wrote:
      >
      > From: "computerdribble" <computerdribble@...>
      > > I humbly thank ALL who have read or responded.
      > >
      > > Can you, with all of the examples to date...
      > > do away with the EVAL of the variable that contains the testing
      > > information and just do a straight macro expansion ?
      > >
      > > $this = "that"
      > > $that ="this"
      > >
      > > $test = ' ( ( "that" =~ /at/) and ( "this" =~ /at/ ) ) '
      > >
      > > something like @{[ $$test ] }
      >
      > No. You can't. It's as simple as that.
      >


      dang it all!
      oh well.


      > If you did not store the expression like this in the database, but
      > instead stored the name of the variable and the regexp (and nothing
      > else) in separate columns you could do something like
      >
      > if ($data{$varname} =~ /$regexp/) {
      >
      > where the $varname and $regexp comes from the database. Whether that
      > would be enough for you, I don't know.
      >
      > Even in this case though it would be better to preprocess the
      > regexps:
      >
      > foreach my $test (@tests) {
      > # $test = [$varname, $regexp]
      > eval {
      > $test[1] = qr/$test[1]/
      > } or die qq{Invalid regexp /$test[1]/ : $@\n};
      > }
      >


      I would love to.. except there are certain instances that what needs
      to be checked is.. well let me put it this way:


      (( $field =~ /this/) and ( ($field =~ /that/) or ($field1 =~/a/) or
      $field2 =~/xx/) or... or.... or.....) )

      actually some of the rules/checks are quite extensive. I **wish**
      they were easier.. but they are not and will probably be redefined to
      something more tighter.. looking for VERY specific things.



      I appreciate all of the help and guidance.


      joe






      > This way the regexps are parsed and compiled just once instead of
      > each time they are used.
      >
      > > I'm sorry to have ruffled so many feathers, but just because one has
      > > 20 years of experience in a language does not mean they should look
      > > down on someone TRYING to learn it. Much less understand it andits
      > > quirkiness.
      > >
      > > ...
      >
      > I think all this was unnecessary. Noone's picking on you.
      >
      > > As for "top loading or top responding" Not my fault, blame Yahoo for
      > > doing that way.. hell blame the whole freaking internet for it,
      > > because that's just how it is done. Talk to the hand.
      >
      > The fact that Yahoo (by default?) formats replies one way doesn't
      > mean you have to keep it that way. Top-posting is quite OK for
      > personal emails to a single recipient. For mailing lists its ... not
      > working too well. Always try to make it easy to the people you are
      > asking for help, even if it means you spend two more minutes
      > formatting the email.
      >
      > Jenda
      > ===== Jenda@... === http://Jenda.Krynicky.cz =====
      > When it comes to wine, women and song, wizards are allowed
      > to get drunk and croon as much as they like.
      > -- Terry Pratchett in Sourcery
      >
    • Show all 15 messages in this topic