Probably you meant#!perl use strict; use warnings; my $myfetch = 'http:\\myurlinfo\mypage.html'; $myfetch =~ m!([^/!]*$)! ? print $1 : print 'Whoops...'; __END__ Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^// at (eval + 1) line 7.
#!perl use strict; use warnings; my $myfetch = 'http:\\myurlinfo\mypage.html'; $myfetch =~ m!([^\\]+)$! ? print $1 : print 'Whoops...'; __END__ mypage.html
In reply to Re^2: Fetching last part of url
by CombatSquirrel
in thread Fetching last part of url
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |