Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Why does

1 #!perl 2 # Utility vars 3 4 my $foo="Hello there" 5 6 # End utility vars. When do we make these go away? 7 8 ###################################################### 9 # We loop over each character and print them out 10 # this is mostly so that we can do the fnorzle with 11 # boopat over the dulwhup. Which can really pjorn your 12 # noodle 13 14 15 for my $i (0.. length($foo)-1) { 16 print "$i ",substr($foo,$i,1),"\n"; 17 }

produce the following error

syntax error at D:\perl\scratch\errors.pl line 15, near "$i (" Execution of D:\perl\scratch\errors.pl aborted due to compilation erro +rs.

I dont see why this doesn't produce something more intelligent. My general rule for perl errors is that if I don't see the problem immediately on the line that perl tells me I look on the one before, and as the contrived example shows here that can be quite a ways before.

:-)


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

In reply to Re: Re: Never lock $0 inside of a BEGIN block by demerphq
in thread Never lock $0 inside of a BEGIN block by demerphq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (7)
    As of 2014-12-27 10:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (177 votes), past polls