Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: php to perl

by Anonymous Monk
on Jul 06, 2011 at 01:46 UTC ( [id://912899]=perlquestion: print w/replies, xml ) Need Help??

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?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found