Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: checking substring for numbers

by BrowserUk (Patriarch)
on Aug 01, 2002 at 22:11 UTC ( [id://186950]=note: print w/replies, xml ) Need Help??


in reply to checking substring for numbers

Now the guys have explained why your code is failing, you might also consider using:

my $shop = m/.{8}(\d{4})/ ? $1 : '0000';

or if you have an aversion to the ternary operator

my $shop = '0000'; $shop = $1 if $AResp =~ /.{8}(\d{4})/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found