to execute it you have to call the url http://127.0.0.1/cgi-bin/testRegex.cgi?article=test thx in advance#!"C:\xampp\perl\bin\perl.exe" use strict; use warnings; use CGI; my $query = CGI->new ; my $dir = "C:/Users/41786/Documents/recordz1/"; showImage(); sub showImage { my $call = shift || ''; my $image = $query->param('article'); my $URL = "../upload/$image.jpg"; my $content; if (defined $image) { open (FILE, "<$dir/show_image.html") or die "cannot open file +$dir/show_image.html"; while (<FILE>) { s/\$ARTICLE{'url_image'}/$URL/g; $content .= $_; } } print "Content-Type: text/html\n\n"; print $content; close (FILE); return 1; }
In reply to Unescaped left brace in regex by *alexandre*
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |