Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^11: Weird error log message

by ikegami (Patriarch)
on Jun 16, 2009 at 13:35 UTC ( [id://772014]=note: print w/replies, xml ) Need Help??


in reply to Re^10: Weird error log message
in thread Weird error log message

Isnt it enough that it has it in the shebang line as well '#!/usr/bin/perl' ?

What's "it"?, the "#!"? No. When I said it has to be the very first thing in the file, I meant it has to be the very first thing in the file.

$ od -c a.pl 0000000 357 273 277 # ! / u s r / b i n / p +e 0000020 r l \n p r i n t ( " H e l l o 0000040 W o r l d \ n " ) ; \n \n 0000054 $ a.pl -bash: ./a.pl: cannot execute binary file $ perl -i.bak -ple"s/^\xEF\xBB\xBF// if $.==1" a.pl $ od -c a.pl 0000000 # ! / u s r / b i n / p e r l \ +n 0000020 p r i n t ( " H e l l o W o +r 0000040 l d \ n " ) ; \n \n 0000051 $ perl a.pl Hello World

i tried clciking the link with BOM but it wont load

It's the Wikipedia page on "byte-order mark". I don't see why you couldn't load it.

When a script source is considered to be utf-8?

Either it is or it isn't. There's no "considered" about it. If you saved it using UTF-8 as the encoding, it's UTF-8. If you used another encoding, it isnt.

But yes, I meant when the source is UTF-8.

Perl will assume the source is encoded using iso-8859-1 unless use utf8; is used.

Replies are listed 'Best First'.
Re^12: Weird error log message
by Nik (Initiate) on Jun 16, 2009 at 18:44 UTC
    Thanks i can see the 1st 3 bytes if BOM is used. Still the link is disfunctional and i dont know why BOM is used.

    i try using
    #! #!/usr/bin/perl -w
    and
    #!/usr/bin/perl -w use utf8;
    and save my script with the use of Notepad++ with utf8 encoding, but when i upload it wont run. why?

    Also in my scripts aprt from the perl syntax i use greek characatets. does that mean that i have to save my scripts in utf8 encoding or ansi? What iam trying to say here is based on what criteria should i choose as to what encoding i must pick for saving my perl scripts? Why ut8? why utf8 without Bom? why ansi? is there a reason? Why locally all encodings work and remotely only ansi does?

      save my script with the use of Notepad++ with utf8 encoding, but when i upload it wont run. why?

      Already answered

      A reply falls below the community's threshold of quality. You may see it by logging in.
      [ Oops, posted too soon by accident, so I'll post the rest here ]

      Still the link is disfunctional

      No. Like i already said, your end is what's dysfunctional. There's a whole web out there to google, so no excuse.

      Also in my scripts aprt from the perl syntax i use greek characatets. does that mean that i have to save my scripts in utf8 encoding or ansi?

      ANSI is not a specific encoding. It's Windows terminology to use the local encoding, for some definition of local.

      But it's moot. Unless you use the broken/weird use encoding, Perl only understands iso-8859-1 (use utf8; off) and UTF-8 (use utf8; on).

      iso-8859-1 doesn't support greek characters, so that leaves UTF-8.

      why utf8 without Bom?

      U+FEFF is only a BOM if it's the very first character of a file. (It's a zero-width no-break space elsewhere.)

      #! is only a shebang if it's the very first characters of a file.

      That means you can only use one or the other.

        This post i didnt't understand at all.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found