For the sake of completeness the code I used to verify that it worked with the "eq" operator. And for the record: I'd prefer a RegExp myself in this situation;-)
use strict; use warnings; my $location = "some location\\"; my $var = substr($location,length($location)-1,1); if ($var eq "\\"){ print "HIER IS ES\n\n"; } else{ $location = $location."\\"; print "NEU:: $location\n\n" ; }
In reply to Re^3: Check last character of a string
by dHarry
in thread Check last character of a string
by theroninwins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |