rimvydazas has asked for the wisdom of the Perl Monks concerning the following question:
When I execute it, I get the following:#!/usr/bin/perl -w use strict; my $msg = '1324^@^@^@'; my $lng = length($msg); print "The length of the message is: $lng\n"; print "This is the message itself: [$msg]\n";
The problem is with those characters ^@^@^@. When I print those characters, I can't see nothing! However, the length, as you see, includes them. What I really want to do is to get rid of them from my string, but I am not sure what to use in substitution command. By the way, those characters in Windows are printed as spaces.cdruser1@cdr1:~/cdr/scripts> ./test1.pl The length of the message is: 7 This is the message itself: [1324]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Weird characters' issue
by ikegami (Patriarch) on Dec 06, 2007 at 19:16 UTC | |
|
Re: Weird characters' issue
by FunkyMonk (Bishop) on Dec 06, 2007 at 19:21 UTC | |
by ikegami (Patriarch) on Dec 06, 2007 at 19:31 UTC | |
by rimvydazas (Novice) on Dec 07, 2007 at 14:21 UTC | |
by ikegami (Patriarch) on Dec 07, 2007 at 16:01 UTC |