Help for this page

Select Code to Download


  1. or download this
    my $str = '[id=4590]blahblah[/id]';
    
    $str =~ m/^\[id=(\d+)\](.+)\[/;
    
    print '<a href="/cgi-bin/coolcode.pl?id=' . "$1>$2</a>\n";
    
  2. or download this
    $str =~ s{^\[id=(\d+)\](.+)\[/id]}{<a href="/cgi-bin/coolcode.pl?id=$1
    +>$2</a>};
    print "$str\n";