#!/usr/bin/perl -w use strict; use warnings; sub main { my $path = "\\\\127.0.0.1\\c$\\bak\\"; $path =~ s/\\$//; print __FILE__.__LINE__." path $path\n"; return; } main(); #### $ ./hackslash.pl Use of uninitialized value $\ in concatenation (.) or string at ./hackslash.pl line 6. ./hackslash.pl8 path \\127.0.0.1\ak #### # note the backslash in front of the dollar sign my $path = "\\\\127.0.0.1\\c\$\\bak\\"; #### $ ./hackslash.pl ./hackslash.pl8 path \\127.0.0.1\c$\bak