Thank you John Anderson and others.
I see your answers in the archives, but for some
reason I am not receiving the list postings
anymore.  I am working to correct that.

It appears the last time I received a post was 3/17/2018.


Mike


On 3/17/2018 10:02 AM, Mike Flannigan wrote:

This line works fine:
if ($link =~ m#/([^/]*)$#) {

But this one in its place does not work:
if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work

Gives error:
Unmatched [ in regex; marked by <-- HERE in m//([ <-- HERE ^/ at csvtopo24.pl line 74.


I think it has to do with the "[^/]*".
Anybody have an explanation for this?


Mike


Simplified code:

#!/usr/bin/perl

use strict;
use warnings;

my $link = '/tree';

#if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work
if ($link =~ m#/([^/]*)$#) {
    my $match = $1;
    print "\nIt worked - $match.\n\n";
}

__END__




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to