Pne more (very good) reason to always use strict and warnings, as that would have clearly pointed you to who's fault it is:

$ perl5.12.2 -we'use Switch' Switch will be removed from the Perl core distribution in the next maj +or release. Please install it from CPAN. It is being used at -e, line + 1. $

Switch is from 2009, and it has been deprecated in 5.12 and has been removed from 5.14 and up:

$ perl5.14.0 -we'use Switch' Can't locate Switch.pm in @INC (@INC contains: /media/Tux/perls/lib/si +te_perl/5.14.0/i686-linux-64int /media/Tux/perls/lib/site_perl/5.14.0 + /media/Tux/perls/lib/5.14.0/i686-linux-64int /media/Tux/perls/lib/5. +14.0 .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. $

As already noted, don't use Switch. With recent perl versions, use given/when or for/when.

FWIW Switch makes your whole script barf on unpredictable points when you are using defined-or // which is way more useful than Switch.


Enjoy, Have FUN! H.Merijn

In reply to Re: Switch and __DATA__ by Tux
in thread Switch and __DATA__ by atend

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.