http://qs321.pair.com?node_id=912899

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hello is possible to convert php to perl script ?
<?php $foo = "My number is 123456"; $num = preg_replace('/(\W|\D)/e', '',$foo); echo $num; ?>
thanks you

Replies are listed 'Best First'.
Re^5: php to perl
by wazoox (Prior) on Jul 07, 2011 at 11:24 UTC
    Very easily.
    $foo = "My number is 123456"; $num = $foo; $num =~ s/(\W|\D)//g; print $num;
      very good

      thanks you

      for reponse :-)

      best regards

Re^5: php to perl
by Anonymous Monk on Jul 07, 2011 at 05:00 UTC
    Yes. What does it do? Does it operate on $foo?