#!/usr/bin/perl use strict; my @tests = qw( path1 paht2\ ); for my $location (@tests) { print "before: '$location'\n"; $location .= '\\' unless $location =~ m(\\$); print "after: '$location'\n"; } __END__ before: 'path1' after: 'path1\' before: 'paht2\' after: 'paht2\'
In reply to Re^3: Check last character of a string
by Perlbotics
in thread Check last character of a string
by theroninwins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |