D
djslls
I'm a beginner in perl. I met a problem today. I don't know why. Here
is the scenario:
Test on Windows XP, Perl v5.8.6, Locale: English
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Text:arseWords qw(parse_line);
my $teststr="123#abc#xyz";
$teststr=decode("ascii",$teststr); ###(1) pay attention here
my @testarray=parse_line("#",0,$teststr);
my $test=$testarray[0];
print $test;
in Normal executing mode, I get "123" in output;
however, when debugging, I type "p $test" just before the last line, I
get nothing. It should be "123".
What happens here? Is there anybody know something about it?
Thanks in advance!
ps. if we comment the decode line, the script will work well in both
mode.
is the scenario:
Test on Windows XP, Perl v5.8.6, Locale: English
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Text:arseWords qw(parse_line);
my $teststr="123#abc#xyz";
$teststr=decode("ascii",$teststr); ###(1) pay attention here
my @testarray=parse_line("#",0,$teststr);
my $test=$testarray[0];
print $test;
in Normal executing mode, I get "123" in output;
however, when debugging, I type "p $test" just before the last line, I
get nothing. It should be "123".
What happens here? Is there anybody know something about it?
Thanks in advance!
ps. if we comment the decode line, the script will work well in both
mode.