Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Check last character of a string

by Perlbotics (Archbishop)
on Aug 06, 2008 at 09:51 UTC ( [id://702587]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Check last character of a string
in thread Check last character of a string

Hi, for me this works:
#!/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\'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://702587]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found