I wrote a subroutine that calls on Image::Magick to get the height and width of an image.
This means all I have to do is put i myimage.gif (i for image) into the form box, and use a regex to process that line like this:
$body =~ s/\ni ([^\n]*?)\n/makeImageTag(\1)/eg;
and have the sub make the image tag for me, with the height and width inserted automatically. This is a Good Thing.
But the damn thing didn't work! So I thought "what would a true monk do?" and turned on warnings.
Cue angelic choir -- warnings tell me that I shouldn't use \1, I should use $1.
So I'm not here to ask the monks that dumb question, but can someone explain what the difference is between \1 and $1? Obviously I can't use the former when there's an expression to be evaluated...
--
($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
In reply to Warnings Are Good! Plus A Question about $1 by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |