All pastes #104453 Raw Edit

bjorn - perl problem

public text v1 · immutable
#104453 ·published 2006-07-28 22:08 UTC
rendered paste body

....

# $sock returns lots of lines like these: "garbage garbage 'important_info' garbage 'important_info' garbage".
# what I need is a way to save both the values inside  the ''s on each line into their own variables. But how?
# So far I've only found a way to save the first one:

while(my $out = <$sock>)
{
 if($out =~ /SELECT/) # only care about lines that mention SELECT
 {
   chop $out;
   $out =~ m/'(.*?)'/g;
   print "argument one: $1\n";

 }
}

....