Mar 6, 2012 3:31 pm
Lina$ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}'
Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
I don't understand the above error message well,
Thanks ahead for any explainations,
Best Regards,
Mar 6, 2012 3:45 pm
Shawn H CoreyOn 12-03-06 10:31 AM, lina wrote:
> $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}'
>
> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
> Execution of -e aborted due to compilation errors.
>
> I don't understand the above error message well,
>
> Thanks ahead for any explainations,
>
> Best Regards,
>
>
> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
> Execution of -e aborted due to compilation errors.
>
> I don't understand the above error message well,
>
> Thanks ahead for any explainations,
>
> Best Regards,
>
First time I tried it, I got the same error. But after goofing around a
bit, it started to work.
$ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}'
Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
$ perl -Mstrict -wle '{my $char = chr(Ox94) ; print $char;}'
Bareword "Ox94" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
$ perl -Mstrict -wle '{my $char = chr(Ox4) ; print $char;}'
Bareword "Ox4" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
$ perl -Mstrict -wle '{my $char = chr(394) ; print $char;}'
Wide character in print at -e line 1.
?
$ perl -Mstrict -wle '{my $char = chr(0394) ; print $char;}'
Illegal octal digit '9' at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
$ perl -Mstrict -wle '{my $char = chr(034) ; print $char;}'
$ perl -Mstrict -wle '{my $char = chr(044) ; print $char;}'
$
$ perl -e'print 0x34'
52$ perl -e'print chr(0x34)'
4$ perl -e'$char=chr(0x34)'
$ perl -e'$char=chr(0x34);print $char'
4$ perl -e'my$char=chr(0x34);print $char'
4$ perl Mstrict -wle '{my $char = chr(0x30) ; print $char;}'
0
$ perl -Mstrict -wle '{my $char = chr(0x394) ; print $char;}'
Wide character in print at -e line 1.
?
$
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
It's Mutual Aid, not fierce competition, that's the dominate
force of evolution. Of course, anyone who has worked in
open source already knows this.
Shawn
Programming is as much about organization and communication
as it is about coding.
It's Mutual Aid, not fierce competition, that's the dominate
force of evolution. Of course, anyone who has worked in
open source already knows this.
Mar 6, 2012 3:47 pm
Chris StinemetzOn Tue, Mar 6, 2012 at 9:31 AM, lina <lina.lastname@gmail.com> wrote:
> $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}'
>
> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
> Execution of -e aborted due to compilation errors.
>
> I don't understand the above error message well,
>
> Thanks ahead for any explainations,
>
> Best Regards,
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
> Execution of -e aborted due to compilation errors.
>
> I don't understand the above error message well,
>
> Thanks ahead for any explainations,
>
> Best Regards,
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
If you are simply trying to assign "chr(0x394)" to varible $char and
then print $char then the below will work.
perl -Mstrict -wle '{my $char = "chr(0x394)" ; print $char;}'
HTH,
Chris
Mar 6, 2012 3:54 pm
LinaOn Tue, Mar 6, 2012 at 11:42 PM, Paul Johnson <paul@pjcj.net> wrote:
> On Tue, Mar 06, 2012 at 11:31:59PM +0800, lina wrote:
> The immediate problem you are seeing is that you should be using the
> number zero (0) rather than the uppercase letter O (O).
>> $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}'
>>
>> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
>> Execution of -e aborted due to compilation errors.
>>
>> I don't understand the above error message well,
>>>
>> Bareword "Ox394" not allowed while "strict subs" in use at -e line 1.
>> Execution of -e aborted due to compilation errors.
>>
>> I don't understand the above error message well,
> The immediate problem you are seeing is that you should be using the
> number zero (0) rather than the uppercase letter O (O).
Thanks, I have never tried the hexadecimal output before. I thought ...
why is 0, not O?
>
> If you are not using a font which allows you to easily distinguish
> between then two, may I suggest inconsolata as a good choice for
> If you are not using a font which allows you to easily distinguish
> between then two, may I suggest inconsolata as a good choice for
I can easily tell the two, I just read from pdf and took it as O,
just googled the inconsolata, I will stick to the gvim
Thanks again,
Previous Thread: Read and write
Next Thread: Problem with nested regex matchs
Related Forum Topics
- Bareword and strict subs
- Bareword "Google::Adwords::Campaign" not allowed while "strict subs" in use
- How to resolve this Unparsable version '' for prerequisiteTest::Strict at Makefile.PL line 563
- Can't use string ("1") as a HASH ref while "strict refs" in use at./policy.sanitizer line 255.
- Undefined subroutine &main::subs
- Concerning passing refs of anonyme Hash to subs...
- Something about "strict"
- Use Strict and using module
- Use strict / nostrict
- No more strict deadlines