I figured out this trick (or actually a variant) just by lots
of trial and error with regexs in my early perl days. I
prefer using parentheses rather than array subscripts, eg:
($relative_url) = ($string =~ /content(.*)/);
A _very_ useful version of this trick is with DBI, ie:
$getStuff = $dbh->prepare("select id, price, info from mytable");
$getStuff->execute();
($id, $price, $info) = $getStuff->fetchrow_array();
I use this a ton.
-- Kirby Tuxtops: Laptops with Linux! |