in reply to Re^3: Grabbing url from iframe
in thread Grabbing url from iframe

Thanks for this. Here's what I have:
$video =~ s/ (<iframe [ ]title="YouTube[ ]video[ ]player" [ ]width=")([0-9]+)(" [ ]height=")([0-9]+)(" ) / $1 . "320" . $3 . ( (320/$2)*$4 ) . $5 /xeg;
But it's returning this error:
Scalar found where operator expected at mobile.pl line 296, near "$1 . + "320" . $3 . ( (320/$2" (Might be a runaway multi-line // string starting on line 289) (Missing operator before $2?) syntax error at mobile.pl line 296, near "$1 . "320" . $3 . ( (320/$2"
Am I missing something?

Replies are listed 'Best First'.
Re^5: Grabbing url from iframe
by Corion (Patriarch) on Feb 12, 2011 at 19:57 UTC

    You delimit your regular expression using /, but the replacement part also contains a /. That's unfortunate. Use a different separator for the regular expression, for example !:

    $video =~ s!... !... !xeg;
      You're exactly right. That did it. Thanks so much. This was over my head but that worked! Can someone explain what this last line does. I sort of get it, but not really.
      $1 . "300" . $3 . ((300/$2)*$4) . $5

        Maybe it's now time to learn Perl operators. See perlop for what the operators do.