Syntax change in 5.12

Discussion in 'Perl Misc' started by Roland Mösl, Sep 17, 2010.

  1. Roland Mösl

    Roland Mösl Guest

    Beyond the GUI problem and to find a
    replacement for Win32::Shell::Execute,
    I had an error message:

    my $mask = $word;
    $mask =~ y/0123456789/----------/;

    The line with the regular expression
    worked well in V5 built 522 from 1999.

    Where is the problem?

    --
    Roland Mösl - PEGE - http://www.pege.org
    Planetary Engineering Group Earth
     
    Roland Mösl, Sep 17, 2010
    #1
    1. Advertising

  2. Roland Mösl

    D. Stussy Guest

    "Roland Mösl" <> wrote in message
    news:i6vfjc$97f$...
    > Beyond the GUI problem and to find a
    > replacement for Win32::Shell::Execute,
    > I had an error message:
    >
    > my $mask = $word;
    > $mask =~ y/0123456789/----------/;
    >
    > The line with the regular expression
    > worked well in V5 built 522 from 1999.
    >
    > Where is the problem?


    Your code, probably.

    With Perl 5.12.0, it appears that certain constructs were tightened up to
    be more strict. Code that ran without wanrings under 5.10 and earlier now
    issue warnings.
     
    D. Stussy, Sep 17, 2010
    #2
    1. Advertising

  3. Roland Mösl

    Dr.Ruud Guest

    On 2010-09-17 12:23, Roland Mösl wrote:

    > I had an error message:
    >
    > my $mask = $word;
    > $mask =~ y/0123456789/----------/;
    >
    > The line with the regular expression
    > worked well in V5 built 522 from 1999.
    >
    > Where is the problem?


    The first problems are that you don't mention the message,
    and that you misspell transliteration.

    Just shorten the series of hypens to a single one.

    perl -MO=Deparse -we'
    my $mask;
    $mask =~ y/0123456789/----/;
    '

    --
    Ruud
     
    Dr.Ruud, Sep 17, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gabriele renzi
    Replies:
    2
    Views:
    238
    gabriele renzi
    Dec 31, 2005
  2. Ken Bloom
    Replies:
    3
    Views:
    243
  3. Good Night Moon
    Replies:
    9
    Views:
    316
    Rick DeNatale
    Jul 25, 2007
  4. Jacob Grover
    Replies:
    5
    Views:
    351
    Jacob Grover
    Jul 18, 2008
  5. Mark Richards
    Replies:
    3
    Views:
    348
    Tad McClellan
    Nov 18, 2007
Loading...

Share This Page